/* === 全域設定（深色模式）=== */
body {
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  background: #1e1f20;
  color: #e6e6e6;
  margin: 0;
  padding: 0;
}

/* === 卡片容器 === */
.card {
  background: #2a2b2d;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  max-width: 720px;
  margin: 3rem auto;
  padding: 2rem 2.5rem;
  text-align: center;
  font-size: 1.1rem;
  word-break: break-word;
}

/* === 標題與說明 === */
h2 {
  font-size: 2rem;
  margin-bottom: 0.2rem;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.version-note {
  display: block;
  color: #aaa;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
}

/* === 倒數顯示 === */
#externalCountdown {
  margin-top: 1.2rem;
  text-align: left;
  font-size: 1.1rem;
  line-height: 1.8;
  font-weight: bold;
  padding: 0.5rem 0.6rem; /* 新增內距防貼邊 */
  word-wrap: break-word;
}

#externalCountdown div {
  margin-bottom: 0.5rem;
}

/* === 倒數區圖示 === */
.icon {
  width: 26px;
  height: 26px;
  vertical-align: middle;
  margin-right: 5px;
  transform: translateY(-2px);
  filter: brightness(0.9);
}

.icon-inline {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 4px;
  transform: translateY(-1px);
  filter: brightness(0.9);
}

/* === 按鈕（保留原計算功能備用）=== */
button {
  background: #10a37f;
  color: #fff;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin: 0.4rem;
  transition: background 0.2s, transform 0.1s;
}

button:hover:not(:disabled) {
  background: #0e8f71;
  transform: translateY(-1px);
}

button.secondary {
  background: #555;
}

button.secondary:hover {
  background: #666;
}

button:disabled {
  background: #333;
  color: #777;
  cursor: not-allowed;
}

/* === 頁尾 === */
footer {
  margin-top: 2rem;
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  padding: 0 1rem;
}

footer a {
  color: #10a37f;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* === 遮罩編輯區 === */
.overlay {
  background: rgba(0, 0, 0, 0.8);
}

.editor {
  background: #2f3032;
  border-radius: 12px;
  padding: 1.5rem;
  color: #eee;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

.editor img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.editor-actions button {
  margin: 0.3rem;
}

/* === 手機版優化 === */
@media (max-width: 768px) {
  .card {
    width: 90%;
    padding: 1.4rem 1.2rem;
    font-size: 1rem;
    margin: 2rem auto;
  }

  #externalCountdown {
    font-size: 1rem;
    line-height: 1.7;
    padding: 0.8rem 0.6rem;
  }

  .icon {
    width: 22px;
    height: 22px;
    margin-right: 4px;
    transform: translateY(-1px);
  }

  .icon-inline {
    width: 18px;
    height: 18px;
    margin-right: 3px;
  }

  h2 {
    font-size: 1.6rem;
  }

  footer {
    font-size: 0.8rem;
    padding: 0 0.8rem;
    line-height: 1.5;
  }
}

/* 更小螢幕再縮一點 */
@media (max-width: 400px) {
  .card {
    padding: 1.1rem 1rem;
  }
  #externalCountdown {
    font-size: 0.95rem;
    line-height: 1.6;
  }
  .icon {
    width: 20px;
    height: 20px;
  }
}
