/* 每日猜谜游戏站 — 样式 v1 */
:root {
  --green: #6aaa64;
  --yellow: #c9b458;
  --gray: #787c7e;
  --bg: #f6f7f8;
  --card: #ffffff;
  --fg: #1a1a1b;
  --muted: #6b7075;
  --line: #d8dcdf;
  --accent: #1a1a1b;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121213;
    --card: #1e1e1f;
    --fg: #e8e8e8;
    --muted: #9aa0a6;
    --line: #3a3a3c;
    --accent: #e8e8e8;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 18px 14px 40px; }

/* ── 头部 ── */
header.site { text-align: center; margin: 10px 0 16px; }
header.site h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: .3px; }
header.site p { margin: 0; color: var(--muted); font-size: 14px; }

/* ── 顶栏（题号 / 连胜 / 剩余次数） ── */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--muted); margin-bottom: 10px; gap: 8px;
}
.topbar .pill { white-space: nowrap; }

/* ── 主卡片 ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

/* ── 输入区 ── */
.inputrow { position: relative; display: flex; gap: 8px; margin-bottom: 8px; }
.inputrow input {
  flex: 1; min-width: 0;
  font-size: 16px; /* 16px 防止手机浏览器聚焦时自动放大 */
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
  outline: none;
}
.inputrow input:focus { border-color: var(--accent); }

button {
  font-size: 14px; font-weight: 600;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#guessBtn { flex: 1; }

/* ── 联想列表 ── */
#suggestions {
  position: absolute; top: 46px; left: 0; right: 0; z-index: 20;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.14);
  overflow: hidden;
}
.sg {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 9px 12px; font-size: 15px; cursor: pointer;
}
.sg:hover { background: rgba(120,124,126,.14); }
.sgsub { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ── 消息与提示 ── */
#msg { min-height: 18px; font-size: 13px; color: #b3261e; margin: 2px 0 8px; }
#hintBox { font-size: 13.5px; margin: 0 0 8px; color: var(--fg); }
#hintBox:empty { display: none; }

/* ── 表头 ── */
.boardhead {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px; margin: 4px 0 6px;
  font-size: 11px; color: var(--muted); text-align: center;
  text-transform: uppercase; letter-spacing: .4px;
}

/* ── 猜测行 ── */
.row {
  margin-bottom: 8px;
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(3px); opacity: .4; } to { transform: none; opacity: 1; } }
.gname { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cell {
  min-height: 42px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 4px 2px;
  border-radius: 6px;
  font-size: 12.5px; font-weight: 700;
  color: #fff;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.15;
}
.cell.green { background: var(--green); }
.cell.yellow { background: var(--yellow); }
.cell.gray { background: var(--gray); }

/* ── 结果区 ── */
.result { margin-top: 14px; }
.rmsg { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.result.win .rmsg { color: var(--green); }
.result.loss .rmsg { color: #b3261e; }
.rcard {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; margin-bottom: 12px;
}
.rname { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.rmeta { font-size: 13.5px; color: var(--muted); margin-bottom: 2px; }
.rhonours { font-size: 13.5px; margin-top: 6px; }
.countdown { font-size: 13px; color: var(--muted); margin-top: 12px; }
.cdTime { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--fg); }

/* ── 玩法说明 ── */
details.howto {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13.5px;
  margin-bottom: 14px;
}
details.howto summary { cursor: pointer; font-weight: 600; }
details.howto ul { margin: 8px 0 0; padding-left: 18px; }
details.howto li { margin-bottom: 5px; }

/* ── 页脚 ── */
footer.site {
  text-align: center; font-size: 13px; color: var(--muted);
  margin-top: 8px; line-height: 1.8;
}
footer.site a { color: var(--fg); text-decoration: none; font-weight: 600; }
footer.site a:hover { text-decoration: underline; }
footer.site .langs a.active { text-decoration: underline; }
footer.site .legal { font-size: 11.5px; margin-top: 6px; }

/* ── Hub / 语言入口页 ── */
.modecard {
  display: flex; gap: 14px; align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none; color: var(--fg);
  margin-bottom: 12px;
}
.modecard:hover { border-color: var(--accent); }
.modeemoji { font-size: 30px; }
.modeinfo { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.modeinfo small { color: var(--muted); }
.modego { font-size: 20px; color: var(--muted); }
.soon { text-align: center; color: var(--muted); font-size: 13px; }

/* ── 答案页 / 归档页 ── */
.intro { font-size: 14.5px; margin-top: 0; }
.hints { margin: 6px 0 14px; padding-left: 18px; font-size: 14.5px; }
.spoiler { margin: 10px 0 16px; }
.spoiler summary { cursor: pointer; font-weight: 600; font-size: 14.5px; }
.answerlist { list-style: none; padding: 0; margin: 0; }
.answerlist li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.answerlist li:last-child { border-bottom: none; }
.answerlist a { color: var(--fg); font-weight: 600; text-decoration: none; }
.answerlist a:hover { text-decoration: underline; }
.answerlist .aname { color: var(--muted); font-size: 13px; }
.datenav { display: flex; justify-content: space-between; margin: 14px 0 6px; font-size: 14px; }
.datenav a { color: var(--fg); font-weight: 600; text-decoration: none; }
.datenav a:hover { text-decoration: underline; }
.cta {
  display: inline-block; background: var(--accent); color: var(--bg);
  font-weight: 600; padding: 10px 16px; border-radius: 8px;
  text-decoration: none; margin-top: 10px;
}
main.card h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); margin: 14px 0 6px;
}
