/* ============================================================
 * 每日一问 · 样式（深夜星空风格）
 * ============================================================ */

:root {
  --bg: #0b1020;
  --bg-2: #161d36;
  --text: #f3eeda;
  --muted: #9aa4bd;
  --accent: #f2c579;
  --accent-deep: #d99e3f;
  --card-bg: rgba(255, 255, 255, 0.045);
  --card-line: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(60% 50% at 20% 0%, rgba(114, 137, 218, 0.22), transparent 60%),
    radial-gradient(50% 40% at 85% 90%, rgba(242, 197, 121, 0.12), transparent 60%),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-2) 100%);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 星空背景 ---------- */
.stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.stars i {
  position: absolute; left: 0; top: 0; width: 2px; height: 2px;
  border-radius: 50%; animation: twinkle 6s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

.page { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 48px 20px 64px; }

/* ---------- 头部 ---------- */
.brand-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #ffe3ae, #d99e3f);
  color: #241a08; font-size: 24px; font-weight: 700;
  box-shadow: 0 6px 24px rgba(242, 197, 121, 0.35);
}
.brand { margin: 0; font-size: 28px; letter-spacing: 3px; font-weight: 600; }
.slogan { margin: 12px auto 36px; text-align: center; color: var(--muted); font-size: 14px; letter-spacing: 1px; }

/* ---------- 问题卡片 ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: 22px;
  padding: 40px 36px 30px;
  text-align: center;
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.meta { margin: 0 0 22px; color: var(--muted); font-size: 13px; letter-spacing: 1px; }
.question {
  margin: 0 0 26px;
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  font-size: clamp(21px, 4.6vw, 30px);
  font-weight: 600;
  line-height: 1.85;
  letter-spacing: 1px;
}
.fade-in { animation: fadeIn 0.9s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.divider {
  width: 56px; height: 2px; margin: 0 auto 22px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.countdown { margin: 0; color: var(--muted); font-size: 13px; }
.countdown strong { color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 1px; }

/* ---------- 面板 ---------- */
.panel {
  margin-top: 22px; padding: 26px 30px;
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel h3 { margin: 0; font-size: 16px; letter-spacing: 1px; }

button { font: inherit; cursor: pointer; }
.ghost {
  background: transparent; border: 1px solid var(--card-line); color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; transition: all 0.2s;
}
.ghost:hover { color: var(--text); border-color: var(--accent); }
.primary {
  background: linear-gradient(135deg, #ffe3ae, #d99e3f); color: #241a08;
  border: none; padding: 10px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(242, 197, 121, 0.3);
  transition: transform 0.15s, box-shadow 0.2s;
}
.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(242, 197, 121, 0.4); }

/* ---------- 回答区 ---------- */
.answer { margin-top: 18px; }
textarea {
  width: 100%; min-height: 140px; resize: vertical;
  background: var(--input-bg); border: 1px solid var(--card-line); border-radius: 14px;
  color: var(--text); padding: 16px; font: inherit; font-size: 15px; line-height: 1.8;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 197, 121, 0.15); }
textarea::placeholder { color: #6b7390; }
.answer-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.hint { color: var(--muted); font-size: 12px; }

.stats { margin: 20px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- 我的记录 ---------- */
.history { margin-top: 24px; border-top: 1px solid var(--card-line); padding-top: 20px; }
.history ul { list-style: none; margin: 14px 0 0; padding: 0; max-height: 340px; overflow: auto; }
.history li {
  background: var(--input-bg); border: 1px solid var(--card-line);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
}
.history-date { color: var(--accent); font-size: 12px; letter-spacing: 1px; margin-bottom: 6px; }
.history-question {
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  font-size: 13px;
  line-height: 1.8;
  color: #cfd6e8;
  margin-bottom: 8px;
}
.history-text { font-size: 14px; line-height: 1.8; color: var(--text); white-space: pre-wrap; word-break: break-word; }

/* ---------- 底部 ---------- */
footer { margin-top: 30px; text-align: center; }
.tip { margin-top: 16px; color: var(--muted); font-size: 12px; }

@media (max-width: 560px) {
  .page { padding: 32px 14px 48px; }
  .card { padding: 30px 20px 24px; }
  .panel { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
