/* ========== 变量 ========== */
:root {
  --bg-page: #f5f0e1;
  --bg-card: #ffffff;
  --bg-paper: #faf6ed;
  --red: #c0392b;
  --red-deep: #96281b;
  --yellow: #e6b422;
  --green: #27ae60;
  --indigo: #2c3e50;
  --wood: #8b5e3c;
  --wood-light: #a07850;
  --text: #3e2723;
  --text-sub: #8d6e63;
  --border: #d4c5a9;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 48px;
  --tabbar-h: 56px;
  --text-min: 16px;
  --tag-c0: #faf6ed;
  --tag-c1: #eef4fb;
  --tag-c2: #eef8f0;
  --tag-c3: #fdf0ee;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background: #fff;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: var(--text-min);
  background: #fff;
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--wood); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; border: none; background: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


.page-intro {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ========== 布局 ========== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
}

.main-wrap {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(230, 180, 34, 0.06), transparent),
    var(--bg-page);
}

.main-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0 16px;
}

body[data-tab="game"] .main-content {
  padding-top: 16px;
}

/* ========== 顶部标题栏（PWA 刘海 / theme-color 白底延伸） ========== */
.app-header.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 10;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  background: #fff;
  border-bottom: 1px solid rgba(212, 197, 169, 0.4);
}

.app-title {
  flex: 1;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.06em;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wood);
  border-radius: 10px;
  flex-shrink: 0;
}

.icon-btn:active { background: rgba(0, 0, 0, 0.05); }

.brand-mark {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 8px;
}

.brand-mark:active { opacity: 0.85; }

.ico { width: 22px; height: 22px; display: block; }
.ico-sm { width: 16px; height: 16px; display: block; }
.ico-xs { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }

.icon-btn.is-muted { color: var(--text-sub); opacity: 0.72; }
.icon-btn .sound-off, .pc-nav-sound .sound-off { display: none; }
.icon-btn.is-muted .sound-on, .pc-nav-sound.is-muted .sound-on { display: none; }
.icon-btn.is-muted .sound-off, .pc-nav-sound.is-muted .sound-off { display: block; }

.pc-nav { display: none; }

/* ========== 游戏区 ========== */
.game-screen {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 10px;
  padding-top: 0;
  padding-bottom: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.game-screen::-webkit-scrollbar { display: none; }

body[data-tab="records"] .game-screen,
body[data-tab="tutorial"] .game-screen,
body[data-tab="about"] .game-screen {
  flex: 0 0 0;
  overflow: hidden;
  padding: 0;
  min-height: 0;
}

.page-lead {
  text-align: center;
  padding: 0 4px 4px;
  flex-shrink: 0;
}

.page-lead h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.page-lead-sub {
  font-size: 16px;
  color: var(--text-sub);
  margin-top: 4px;
}

@media (max-height: 780px) {
  .chain-card { padding: 12px; gap: 10px; }
  .tail-char { width: 56px; height: 56px; font-size: 36px; }
  .word-input, .btn-submit { height: 44px; }
}

/* ========== 接龙卡片（书卷主卡） ========== */
.chain-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(212, 197, 169, 0.55);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 0 auto;
  min-height: min-content;
  overflow: visible;
  transition: border-color 0.25s, box-shadow 0.25s;
  position: relative;
  scrollbar-width: none;
}

.chain-card::-webkit-scrollbar { display: none; }

.chain-card::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(230, 180, 34, 0.35), transparent);
  pointer-events: none;
}

.chain-card.is-win {
  border: 2px solid var(--green);
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.14), var(--shadow);
}

.chain-card.is-lose {
  border: 2px solid var(--red);
}

.chain-card.is-shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.chain-scroll-wrap {
  overflow: hidden;
  flex-shrink: 0;
  min-height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fdf9f0 0%, var(--bg-paper) 100%);
  border: 1px solid rgba(212, 197, 169, 0.45);
  box-shadow: inset 0 2px 6px rgba(139, 94, 60, 0.04);
}

.chain-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  min-height: 44px;
  align-items: center;
}

.chain-scroll::-webkit-scrollbar { display: none; }

.chain-empty {
  font-size: 16px;
  color: var(--text-sub);
  white-space: nowrap;
}

.chain-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
  border: 1px solid rgba(212, 197, 169, 0.35);
  white-space: nowrap;
  transition: transform 0.25s ease, border-color 0.25s, box-shadow 0.25s;
}

.chain-tag.is-system {
  color: var(--wood);
  border-color: rgba(139, 94, 60, 0.35);
  background: linear-gradient(180deg, #fff9f0 0%, #f5ead8 100%);
  font-weight: 600;
}

.chain-tag.is-system::before {
  content: "题 ";
  font-size: 12px;
  color: var(--red);
  font-weight: 700;
}

.chain-tag.is-ai {
  font-style: normal;
  color: var(--indigo);
  border-color: rgba(44, 62, 80, 0.15);
}

.chain-tag.is-ai::before {
  content: "AI ";
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 600;
}
.chain-tag.c0 { background: var(--tag-c0); }
.chain-tag.c1 { background: var(--tag-c1); }
.chain-tag.c2 { background: var(--tag-c2); }
.chain-tag.c3 { background: var(--tag-c3); }

.chain-tag.is-latest {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(230, 180, 34, 0.25);
  transform: scale(1.04);
}

.chain-tag.is-hint {
  border-color: var(--green);
  animation: hintFlash 1.5s ease;
}

@keyframes hintFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.chain-tag.pop-in {
  animation: popIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.85) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ========== 尾字展示（印玺风） ========== */
.tail-section {
  text-align: center;
  padding: 6px 0 2px;
  flex-shrink: 0;
}

.tail-char {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  color: var(--red);
  letter-spacing: 0.04em;
  border: 2px solid rgba(192, 57, 43, 0.25);
  border-radius: 12px;
  background: linear-gradient(145deg, #fff9f5 0%, #fceee8 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.8), 0 2px 8px rgba(192, 57, 43, 0.08);
}

.tail-char.is-gold {
  color: #b8860b;
  border-color: rgba(230, 180, 34, 0.45);
  background: linear-gradient(145deg, #fffdf5 0%, #faf0d0 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.9), 0 2px 8px rgba(230, 180, 34, 0.15);
}

.tail-hint {
  font-size: 16px;
  color: var(--text-sub);
  margin-top: 8px;
  line-height: 1.45;
  padding: 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== 输入区 ========== */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.word-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-paper);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.word-input:focus {
  border-color: var(--yellow);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(230, 180, 34, 0.18);
}

.word-input:disabled {
  opacity: 0.55;
  background: #f5f5f5;
}

.btn-submit {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #c0392b 0%, var(--red-deep) 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.16em;
  box-shadow: 0 3px 10px rgba(192, 57, 43, 0.28);
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn-submit:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(192, 57, 43, 0.2);
}

.btn-submit:disabled { opacity: 0.5; }

.btn-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: center;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(139, 94, 60, 0.25);
  color: var(--wood);
  font-size: 16px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-sm);
}

.btn-hint:disabled,
.btn-hint.is-exhausted { opacity: 0.45; }

.btn-hint.is-exhausted .hint-count { color: var(--text-sub); }

.hint-count { color: var(--text-sub); font-size: 16px; }

/* ========== 控制台面板（统计 + 设置 + 操作） ========== */
.deck-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(212, 197, 169, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.status-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex-shrink: 0;
}

.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  background: var(--bg-paper);
  border: 1px solid rgba(212, 197, 169, 0.4);
  border-radius: var(--radius-md);
  font-size: 16px;
  color: var(--text-sub);
  min-height: 46px;
}

.stat-label {
  font-size: 16px;
  color: var(--text-sub);
  line-height: 1.2;
}

.stat-chip b {
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
}

.stat-combo.is-hot {
  background: linear-gradient(180deg, #fff5f0 0%, #ffece6 100%);
  border-color: rgba(192, 57, 43, 0.3);
}

.stat-combo.is-hot .stat-label,
.stat-combo.is-hot b { color: var(--red); }

.combo-fire { color: #e67e22; margin-bottom: -2px; }

.combo-praise {
  color: var(--red);
  font-weight: 700;
  font-size: 16px;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 0;
  border-top: 1px dashed rgba(212, 197, 169, 0.55);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.control-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--wood);
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.chip-row {
  display: flex;
  gap: 6px;
  width: 100%;
}

.chip-btn {
  flex: 1 1 0;
  min-height: 26px;
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid rgba(212, 197, 169, 0.55);
  background: var(--bg-paper);
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.chip-btn:active:not(:disabled) { transform: scale(0.98); }

.chip-btn.active {
  background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood) 100%);
  border-color: var(--wood);
  color: #fff;
  font-weight: 400;
  box-shadow: 0 1px 4px rgba(139, 94, 60, 0.18);
}

.chip-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ========== 操作按钮 ========== */
.action-row {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  padding-top: 0;
}

.btn-action {
  flex: 1 1 0;
  min-width: 0;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(212, 197, 169, 0.55);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.btn-action-primary {
  flex: 1.2 1 0;
  background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood) 100%);
  border-color: var(--wood);
  color: #fff;
  font-weight: 400;
  box-shadow: 0 1px 5px rgba(139, 94, 60, 0.16);
}

.btn-action:active:not(:disabled) { opacity: 0.88; }
.btn-action:disabled { opacity: 0.45; }

.game-msg {
  text-align: center;
  font-size: 16px;
  color: var(--green);
  font-weight: 600;
  flex-shrink: 0;
}

.game-msg.is-lose { color: var(--red); }

.game-msg[hidden] { display: none; }

/* ========== 胜负弹窗 ========== */
.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  padding-bottom: calc(24px + var(--safe-bottom));
}

.result-overlay[hidden] { display: none; }

.result-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(62, 39, 35, 0.45);
  backdrop-filter: blur(2px);
}

.result-card {
  position: relative;
  width: min(100%, 300px);
  padding: 22px 20px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #fffdf8 0%, #faf3e6 100%);
  border: 1px solid rgba(212, 197, 169, 0.75);
  box-shadow: 0 12px 40px rgba(62, 39, 35, 0.22);
  text-align: center;
  animation: resultPop 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes resultPop {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.result-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 14px;
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.08em;
}

.result-seal.is-win {
  color: #b8860b;
  border: 2px solid rgba(230, 180, 34, 0.45);
  background: linear-gradient(145deg, #fffdf5 0%, #faf0d0 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.9), 0 2px 10px rgba(230, 180, 34, 0.18);
}

.result-seal.is-lose {
  color: var(--red);
  border: 2px solid rgba(192, 57, 43, 0.28);
  background: linear-gradient(145deg, #fff9f5 0%, #fceee8 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.85), 0 2px 8px rgba(192, 57, 43, 0.1);
}

.result-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 6px;
}

.result-desc {
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 10px;
}

.result-stats {
  font-size: 14px;
  color: var(--wood);
  line-height: 1.45;
  margin-bottom: 16px;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.result-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(212, 197, 169, 0.65);
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
}

.result-btn-primary {
  background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood) 100%);
  border-color: var(--wood);
  color: #fff;
  box-shadow: 0 1px 5px rgba(139, 94, 60, 0.18);
}

.result-btn:active { opacity: 0.88; }

/* ========== 文章区 ========== */
.article-content {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 0 16px;
  scrollbar-width: thin;
}

body[data-tab="records"] .article-records,
body[data-tab="tutorial"] .article-tutorial,
body[data-tab="about"] .article-about {
  display: block;
}

.article-content h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 10px;
}

.article-content h2:first-child { margin-top: 4px; }

.panel-sub, .intro-text {
  font-size: 16px;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.tutorial-steps, .tutorial-tips {
  padding-left: 1.25em;
  font-size: 16px;
  color: var(--text);
}

.tutorial-steps li, .tutorial-tips li { margin-bottom: 8px; }

.example-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.example-card {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  border: 1px solid rgba(212, 197, 169, 0.45);
  box-shadow: var(--shadow-sm);
}

.example-chain-text {
  display: block;
  font-size: 16px;
  color: var(--indigo);
  line-height: 1.55;
  letter-spacing: 0.02em;
}

.example-chain-text b {
  font-weight: 600;
  color: var(--wood);
  font-size: 14px;
  margin-right: 2px;
}

.example-note {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.5;
}

.record-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.record-empty {
  text-align: center;
  color: var(--text-sub);
  padding: 24px 12px;
  font-size: 16px;
}

.record-item {
  padding: 12px 14px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(212, 197, 169, 0.45);
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}

.record-item[hidden] { display: none; }

.record-best {
  margin-top: 12px;
  font-size: 16px;
  color: var(--text-sub);
}

.record-best b { color: var(--red); font-size: 18px; }

.faq-list { font-size: 16px; }
.faq-list dt { font-weight: 700; color: var(--text); margin-top: 12px; }
.faq-list dd { color: var(--text-sub); margin-left: 0; margin-top: 4px; }

.about-site {
  font-size: 16px;
  color: var(--text-sub);
  line-height: 1.7;
}

.about-site a { color: var(--wood); }

.site-footer {
  display: none;
  flex-shrink: 0;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  text-align: center;
  font-size: 14px;
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(212, 197, 169, 0.35);
}

.site-footer a { color: var(--wood); }

/* ========== 广告位 ========== */
.ad-slot {
  display: none;
  min-height: 60px;
  max-height: 60px;
  margin: 10px 0;
  color: #999;
  font-size: 14px;
  border-radius: 8px;
  border: 1px dashed #ccc;
  background: #fafafa;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.ad-slot:not(:empty) {
  display: flex;
  flex: 0 0 60px;
}

/* ========== TabBar ========== */
.tab-bar {
  display: flex;
  order: 999;
  flex-shrink: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid rgba(212, 197, 169, 0.45);
  box-shadow: 0 -2px 12px rgba(62, 39, 35, 0.04);
  z-index: 20;
}

.tab-btn {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 16px;
  color: var(--text-sub);
  padding: 4px 0 2px;
  transition: color 0.15s;
}

.tab-btn.active { color: var(--red); }
.tab-ico { width: 22px; height: 22px; }

/* ========== Toast ========== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%) translateY(20px);
  background: rgba(62, 39, 35, 0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 90;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { background: rgba(39, 174, 96, 0.95); }
.toast.error { background: rgba(192, 57, 43, 0.92); }

/* ========== PC 适配 ========== */
@media (min-width: 768px) {
  body {
    overflow-y: auto;
    min-height: 100dvh;
    background:
      radial-gradient(ellipse 600px 600px at 85% 15%, rgba(212, 197, 169, 0.15), transparent),
      radial-gradient(ellipse 400px 400px at 10% 80%, rgba(141, 110, 99, 0.08), transparent),
      var(--bg-page);
  }

  .app-container {
    max-width: 700px;
    height: 100dvh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
  }

  .app-header.top-nav { display: none; }

  .pc-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(212, 197, 169, 0.4);
    flex-shrink: 0;
    flex-wrap: wrap;
  }

  .pc-nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-right: auto;
    text-decoration: none;
  }

  .pc-nav-brand:hover { text-decoration: none; opacity: 0.9; }

  .pc-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    color: var(--text-sub);
    padding: 8px 10px;
    border-radius: 10px;
    transition: background 0.15s, color 0.15s;
  }

  .pc-nav-link .ico { width: 18px; height: 18px; }
  .pc-nav-link.active { color: var(--red); background: rgba(192, 57, 43, 0.08); }
  .pc-nav-link:hover { background: rgba(0, 0, 0, 0.04); }

  .tab-bar { display: none; }

  .site-footer { display: block; }

  .toast {
    bottom: calc(var(--safe-bottom) + 24px);
  }
}
