﻿/* ============================================================
   成语接龙 · 水墨风格 UI（按 Figma 设计 1:1 还原）
   字体：标题/成语用衬线（思源宋体系），正文/UI 用无衬线
   ============================================================ */
:root {
  --red: #c0392b;
  --red-dark: #a8301f;
  --red-soft: #fbeeec;
  --ink: #212121;
  --ink2: #292929;
  --ink3: #383630;
  --ink4: #736e66;
  --ink5: #8c857d;
  --muted: #948f85;
  --line: #ccc2b0;
  --line2: #d9cfba;
  --line3: #d6ccb8;
  --line4: #d6c9b2;
  --card-from: #fdfbf5;
  --card-to: #f4eddd;
  --rec-from: #fcf8ef;
  --rec-to: #f1e8d6;
  --paper: #f3eee3;
  --panel: #fbf9f4;
  --panel2: #fcfaf5;
  --field: #fcfbf8;
  --green: #4e8c5a;
  --gold: #d19929;
  --seg-off: #ded6c7;
  --shadow-card: 0 3px 10px rgba(102, 89, 71, .14);
  --shadow-rec: 0 2px 8px rgba(102, 89, 71, .15);
  --shadow-pop: 0 24px 70px rgba(41, 36, 31, .28);
  --chain-card-w: clamp(240px, 16vw, 285px);
  --chain-arrow-w: 24px;
  --chain-gap: 10px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", STSong, SimSun, "宋体", serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "Source Han Sans CN", "PingFang SC", "Microsoft YaHei", "微软雅黑", sans-serif;
  --maxw: 1440px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
p { margin: 0; }
.serif { font-family: var(--serif); }
[hidden] { display: none !important; }

/* ============================================================
   顶部导航
   ============================================================ */
.topnav {
  background: #fff;
  border-bottom: 1px solid #ece6d9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 40px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo {
  width: 44px; height: 44px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: contain;
}
.brand-name {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 30px;
  letter-spacing: 2px;
  color: var(--ink2);
}
.topnav-links { display: flex; align-items: center; gap: 30px; }
.navlink {
  font-size: 16px;
  color: var(--ink4);
  text-decoration: none;
  position: relative;
}
.navlink:hover { color: var(--ink2); }
.navlink.active { color: var(--ink2); font-weight: 500; }
.navlink + .navlink::before {
  content: "|";
  color: #c7bdad;
  font-size: 16px;
  position: absolute;
  left: -16px;
  font-weight: 400;
}

/* ============================================================
   App 容器 + 游戏页（首屏：水墨背景）
   ============================================================ */
.app { width: 100%; }
.page { display: none; }
.page.active { display: block; }

.game-layout {
  position: relative;
  min-height: calc(100vh - 66px);
  max-height: calc(100vh - 66px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vh, 16px);
  padding: 32px max(40px, calc((100% - var(--maxw)) / 2)) 0;
  background-image: linear-gradient(rgba(250, 247, 240, .12), rgba(250, 247, 240, .12)), url("./assets/ink-landscape.png");
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
}

/* ---------- 模式条 ---------- */
.mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 40px;
}
.mode-tabs {
  display: flex;
  gap: 36px;
  align-items: flex-end;
  border-bottom: 1px solid rgba(212, 201, 184, 0.5);
}
.mode-tab {
  background: none;
  border: 0;
  padding: 0 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  color: #383630;
  position: relative;
  margin-bottom: -1px;
  transition: color 0.25s ease;
}
.mode-tab.active {
  color: var(--red);
}
.mode-tab::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mode-tab.active::after {
  width: calc(100% + 16px);
}
.mode-opts { display: flex; gap: 14px; align-items: center; }
.custom-select {
  position: relative;
  width: 130px;
  height: 40px;
  user-select: none;
}
.cs-header {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  background: #fff;
  border: 1px solid #e0d5c1;
  border-radius: 8px;
  padding: 0 32px 0 14px;
  box-shadow: 0 1px 3px rgba(102, 89, 71, 0.04);
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: border-radius 0.2s;
}
.custom-select.open .cs-header {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}
.cs-lbl, .cs-val {
  font-size: 16px;
  color: var(--ink2);
}
.cs-header::after {
  content: "";
  width: 12px;
  height: 8px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6" fill="none" stroke="%23292929" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M1 1l4 4 4-4"/></svg>') no-repeat center;
  background-size: contain;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.2s;
}
.custom-select.open .cs-header::after {
  transform: translateY(-50%) rotate(180deg);
}
.cs-list {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #e0d5c1;
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 6px 12px rgba(102, 89, 71, 0.1);
  overflow: hidden;
  display: none;
  z-index: 10;
  margin-top: -1px;
}
.custom-select.open .cs-list {
  display: block;
}
.cs-opt {
  padding: 10px 14px;
  font-size: 16px;
  color: var(--ink2);
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}
.cs-opt:hover {
  background: #fdfbf5;
}
.cs-opt.active {
  color: var(--red);
  font-weight: 700;
  background: #fcf8ef;
}
.mode-date {
  font-size: 16px;
  font-weight: 600;
  color: #8b8378;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

/* ---------- 每日挑战进行中：进度头 ---------- */
.daily-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 12px;
}
.dp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(192, 57, 43, .55);
  border-radius: 999px;
  padding: 6px 16px;
  color: var(--red);
  background: rgba(255, 248, 244, .72);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .5px;
}
.dp-badge::before {
  content: "⏱";
  font-size: 16px;
}
.dp-headline {
  margin: 0;
  color: #2b2724;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.1;
}
.dp-track {
  width: min(100%, 420px);
  height: 10px;
  border-radius: 999px;
  background: #e5ddd0;
  overflow: hidden;
}
.dp-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--red);
  width: 0%;
  transition: width .35s ease;
}
.dp-meta {
  margin: 0;
  font-size: 16px;
  color: #8b8378;
  letter-spacing: .3px;
}
.game-layout.daily-playing {
  gap: 6px;
  padding-top: 12px;
}
.game-layout.daily-playing .mode-opts {
  display: none;
}
.game-layout.daily-playing .mode-date {
  display: block;
}
.game-layout.daily-playing #btn-hint {
  display: inline-flex;
}
.game-layout.daily-playing .spacer {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 16px;
}
.game-layout.daily-playing .chain-wrap {
    padding-top: clamp(14px, 2vh, 18px); /* 增加顶部内边距，防止起/我标签被遮挡 */
    padding-bottom: 4px;
  }
.game-layout.daily-playing .chain-arrow {
  width: var(--chain-arrow-w);
  min-width: var(--chain-arrow-w);
  height: auto;
  border: none;
  border-radius: 0;
  background: none;
  font-size: 20px;
}

/* ---------- 限时 VS-计时环 ---------- */
.timed-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  width: 100%;
  max-width: 460px;
  margin: -4px auto 0;
  padding: 0 12px;
}
.game-layout.timed-playing {
  gap: 12px;
}
.game-layout.timed-playing .timed-bar {
  min-height: 0;
  padding: 0 8px;
  border: none;
  background: none;
  box-shadow: none;
}
.game-layout.timed-playing .vs-side {
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
}
.game-layout.timed-playing .timed-bar > .vs-side:first-child,
.game-layout.timed-playing .vs-rightgroup .vs-side {
  border-bottom: none;
}
.game-layout.timed-playing .spacer {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 16px;
}
.vs-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vs-label { font-size: 17px; font-weight: 500; letter-spacing: 2px; color: #7a756e; }
.vs-count { display: flex; align-items: baseline; gap: 4px; }
.vs-count .tb-cnt { font-family: var(--serif); font-weight: 900; font-size: 38px; color: var(--red); line-height: 1; }
.vs-count .tb-cnt.ai { color: #2e2924; }
.vs-count span { font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--ink2); }
.vs-track { width: 96px; height: 6px; border-radius: 4px; background: #dbd4c4; overflow: hidden; }
.vs-fill { height: 100%; border-radius: 4px; transition: width .35s; }
.vs-fill.me { background: var(--red); }
.vs-fill.ai { background: #2e2924; }
.vs-rightgroup { display: flex; align-items: center; gap: 18px; }
.vs-vs { font-family: var(--serif); font-weight: 900; font-size: 26px; letter-spacing: 1px; color: var(--red); }
.tb-ring {
  --p: 100%;
  width: 108px; height: 108px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, .92) 78%, transparent 80%),
    conic-gradient(var(--red) var(--p), #d6cdbb 0);
}
.tb-num { font-family: var(--serif); font-weight: 900; font-size: 30px; color: var(--ink); }

/* ---------- 限时挑战空闲态 ---------- */
.timed-idle-card {
  width: min(920px, 100%);
  margin: 6px auto 0;
  padding: 64px 44px 60px;
  background: rgba(253, 250, 243, .9);
  border: 1.5px solid #d2c2aa;
  border-radius: 24px;
  box-shadow: 0 14px 36px rgba(102, 89, 71, .12);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
}
.tic-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(192, 57, 43, .55);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--red);
  background: #fff8f4;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}
.tic-title {
  margin: 0;
  color: #2b2724;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.18;
}
.tic-desc {
  max-width: 680px;
  color: #746e66;
  font-size: 18px;
  line-height: 1.75;
}
.tic-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.tic-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid #d8c8ae;
  border-radius: 999px;
  background: rgba(255, 252, 246, .72);
  color: #3e3933;
  font-size: 16px;
  font-weight: 700;
}
.tic-tags b { color: #2b2724; }
.tic-start {
  height: 70px;
  min-width: 248px;
  padding: 0 36px;
  border-radius: 14px;
  background: var(--red);
  color: #fffaf5;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 10px 22px rgba(192, 57, 43, .24);
}
.tic-start:hover { background: var(--red-dark); }
.tic-record {
  color: #8b8378;
  font-size: 16px;
}

/* ---------- 每日挑战空闲态 ---------- */
.daily-idle-card {
  width: min(920px, 100%);
  margin: 6px auto 0;
  padding: 64px 44px 60px;
  background: rgba(253, 250, 243, .9);
  border: 1.5px solid #d2c2aa;
  border-radius: 24px;
  box-shadow: 0 14px 36px rgba(102, 89, 71, .12);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
}
.dic-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(192, 57, 43, .55);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--red);
  background: #fff8f4;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}
.dic-title {
  margin: 0;
  color: #2b2724;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.18;
}
.dic-desc {
  max-width: 680px;
  color: #746e66;
  font-size: 18px;
  line-height: 1.75;
}
.dic-desc .hl-word {
  color: #2b2724;
  font-weight: 700;
}
.dic-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.dic-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid #d8c8ae;
  border-radius: 999px;
  background: rgba(255, 252, 246, .72);
  color: #3e3933;
  font-size: 16px;
  font-weight: 700;
}
.dic-tags b { color: #2b2724; }
.dic-week {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
}
.dic-week-lbl {
  font-size: 16px;
  font-weight: 700;
  color: #8b8378;
  letter-spacing: 1px;
}
.dic-week-days {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  width: 100%;
}
.dic-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 32px;
}
.dic-day-lbl {
  font-size: 16px;
  font-weight: 700;
  color: #9a9288;
}
.dic-day-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}
.dic-day.done .dic-day-dot {
  background: var(--red);
  color: #fffaf5;
  font-size: 16px;
}
.dic-day.today .dic-day-dot {
  background: #fffaf5;
  border: 2px solid var(--red);
  color: var(--red);
  font-family: var(--serif);
  font-weight: 900;
}
.dic-day.future .dic-day-dot,
.dic-day.missed .dic-day-dot {
  background: #ebe6dc;
  color: #b5aea3;
  font-size: 20px;
  font-weight: 700;
}
.dic-start {
  height: 70px;
  min-width: 268px;
  padding: 0 36px;
  border-radius: 14px;
  background: var(--red);
  color: #fffaf5;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 10px 22px rgba(192, 57, 43, .24);
}
.dic-start:hover:not(:disabled) { background: var(--red-dark); }
.dic-start:disabled {
  opacity: .62;
  cursor: default;
  box-shadow: none;
}
.dic-record {
  color: #8b8378;
  font-size: 16px;
}

/* ---------- 限时进行中：水墨战绩横幅 ---------- */
.ink-stats {
  position: relative;
  min-height: 76px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
}
.ink-stats::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./assets/ink-brush-bar.png") center/cover no-repeat;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.ink-stats > * { position: relative; z-index: 1; }
.is-item { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.is-ic { font-size: 18px; }
.is-ic.orange { color: #ed854d; }
.is-ic.gold { color: #ebbd61; }
.is-lbl { font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: 1px; color: #f5f0e5; }
.is-num { font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: 1px; color: #f5f0e5; }
.is-num.orange { color: #ed854d; }
.is-num.gold { color: #ebbd61; }
.is-div { width: 1px; height: 26px; background: rgba(255, 255, 255, .28); }

/* ---------- 空闲态 / 进行态切换 ---------- */
.game-layout:not(.playing) .input-row,
.game-layout:not(.playing) #paths { display: none; }
.game-layout.playing #action-row { display: none; }
.game-layout.timed-playing #btn-hint { display: none; }
.game-layout.timed-idle .chain-wrap,
.game-layout.timed-idle .timed-bar,
.game-layout.timed-idle .play-area,
.game-layout.timed-idle #action-row,
.game-layout.timed-idle .spacer,
.game-layout.daily-idle .daily-progress,
.game-layout.daily-idle .chain-wrap,
.game-layout.daily-idle .play-area,
.game-layout.daily-idle #action-row,
.game-layout.daily-idle .spacer {
  display: none;
}
.game-layout:not(.playing):not(.timed-idle):not(.daily-idle) .spacer {
  flex: 0 1 auto;
  max-height: 24px;
}
.game-layout.playing .spacer {
  flex: 0 1 auto;
  max-height: 36px;
}
.game-layout:not(.playing):not(.timed-idle):not(.daily-idle) .chain-wrap {
  display: none;
}
.action-row { display: flex; gap: 10px; align-items: center; justify-content: center; width: 100%; }

/* ============================================================
   接龙链
   ============================================================ */
.chain-wrap {
  width: 100%;
  overflow-x: scroll;
  overflow-y: visible;
  padding: clamp(14px, 2.8vh, 36px) 6px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 140, 115, .15) transparent;
}
.chain-wrap::-webkit-scrollbar { height: 3px; }
.chain-wrap::-webkit-scrollbar-track { background: transparent; }
.chain-wrap::-webkit-scrollbar-thumb {
  background: rgba(160, 140, 115, .18);
  border-radius: 999px;
}
.chain-wrap:hover::-webkit-scrollbar-thumb {
  background: rgba(160, 140, 115, .32);
}
.chain {
  display: flex;
  align-items: stretch;
  gap: var(--chain-gap);
  min-width: min-content;
  width: max-content;
  margin: 0 auto;
  padding: 0 20px 0 0;
}
.chain-card {
  position: relative;
  flex: 0 0 auto;
  width: 168px;
  background: linear-gradient(180deg, var(--card-from), var(--card-to));
  border: 1px solid #ccbda3;
  border-radius: 14px;
  padding: 7px;
  box-shadow: 0 8px 22px rgba(102, 89, 71, .18), 0 2px 5px rgba(102, 89, 71, .1);
}
.cc-role {
  position: absolute;
  top: -9px;
  left: 12px;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fffaf5;
  border: 1px solid rgba(255, 250, 245, .9);
  box-shadow: 0 3px 8px rgba(102, 89, 71, .18);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .5px;
}
.chain-card .cc-inner {
  border: 1px solid var(--line4);
  border-radius: 9px;
  padding: 22px 12px 19px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.cc-word {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(36px, 2.35vw, 46px);
  letter-spacing: 5px;
  color: #29241f;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .75);
}
.cc-word .last { color: var(--red); }
.cc-py {
  font-size: 16px;
  letter-spacing: .5px;
  color: #807a73;
  white-space: nowrap;
}
.chain-card.start .cc-inner { border-color: #cdbfa3; }
.chain-card.start .cc-role { background: #9b7a3f; }
.chain-card.ai {
  background: linear-gradient(180deg, #f7f4ee, #ede7da);
  border-color: #938777;
}
.chain-card.ai .cc-inner { border-color: #9d907f; }
.chain-card.ai .cc-role {
  background: #2e2924;
}
.chain-card:not(.ai):not(.start) {
  border-color: rgba(192, 57, 43, .58);
}
.chain-card:not(.ai):not(.start) .cc-inner {
  border-color: rgba(192, 57, 43, .45);
}
.chain-card.goal .cc-inner { border-color: var(--red); }
.chain-card.blank { display: flex; align-items: center; justify-content: center; min-width: 110px; }
.chain-card.blank .cc-q {
  font-family: var(--serif);
  font-size: 34px;
  color: #b9ad99;
}
.chain-card.blank.cur { border-color: var(--red); box-shadow: 0 0 0 2px rgba(192, 57, 43, .25), var(--shadow-card); }
.game-layout.timed-playing .chain-wrap {
  padding-top: clamp(10px, 2vh, 28px);
}
.game-layout.timed-playing .chain {
  width: max-content;
}
.game-layout.timed-playing .chain-card {
  width: clamp(190px, 21vw, 270px);
}
.game-layout.timed-playing .chain-arrow {
  flex: 0 0 auto;
  min-width: 20px;
}
.chain-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--chain-arrow-w);
  color: #8c857a;
  font-size: 20px;
}
.chain-arrow svg { display: none; }

/* ============================================================
   输入区
   ============================================================ */
.play-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
}
.prompt {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  text-align: center;
  color: var(--ink2);
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prompt > * { overflow: hidden; text-overflow: ellipsis; }
.prompt .hl { color: var(--red); }
.prompt.thinking { color: var(--ink4); }
.input-row { display: flex; gap: 14px; align-items: center; }
.answer-input {
  width: 360px;
  height: 52px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  font-size: 16px;
  color: var(--ink2);
  outline: none;
}
.answer-input::placeholder { color: #948f85; }
.answer-input:focus { border-color: var(--red); }
.answer-input:disabled { background: #f4f1ea; color: #b3ac9f; }

.btn {
  height: 52px;
  border-radius: 8px;
  border: 0;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: filter .15s, background .15s, color .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--red);
  color: #fff;
  font-weight: 500;
  letter-spacing: 2px;
  padding: 0 28px;
  min-width: 96px;
}
.btn-primary:not(:disabled):hover { background: var(--red-dark); }
.btn-ghost {
  background: var(--field);
  border: 1.5px solid var(--red);
  color: var(--red);
  font-weight: 500;
  padding: 0 22px;
}
.btn-ghost:not(:disabled):hover { background: #fbeeec; }
.play-tip { font-size: 16px; color: var(--ink5); height: 22px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.play-tip.ok { color: var(--green); }
.play-tip.err { color: var(--red); }

/* ============================================================
   多路径推荐
   ============================================================ */
.paths { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.paths-head { display: flex; align-items: center; gap: 8px; width: 100%; }
.paths-title { font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--ink2); }
.paths-title::before { content: "⚘"; color: var(--ink5); font-weight: 400; margin-right: 6px; font-family: var(--sans); }
.paths-sub { font-size: 16px; color: var(--ink5); }
.paths-head::after { content: ""; flex: 1; height: 1px; background: #d4c9b8; }
.paths-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: auto;
  align-content: start;
  gap: 10px;
  max-height: 260px;
  overflow: hidden;
}
.game-layout.timed-playing .paths-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: auto;
  max-height: 140px;
  overflow: visible;
}
.paths-waiting .paths-grid {
  opacity: .5;
  pointer-events: none;
  transition: opacity .15s;
}
.path-card {
  text-align: left;
  background: linear-gradient(180deg, var(--rec-from), var(--rec-to));
  border: 1px solid var(--line2);
  border-radius: 10px;
  box-shadow: var(--shadow-rec);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 0;
}
.path-card:hover { filter: brightness(1.02); border-color: #c9bca3; }
.path-card-ghost {
  pointer-events: none;
  opacity: .72;
}
.path-card-slot {
  pointer-events: none;
  opacity: .62;
  border-style: dashed;
}
.path-card-ghost .pc-word,
.path-card-ghost .pc-py,
.path-card-ghost .pc-meta,
.path-card-slot .pc-word,
.path-card-slot .pc-py,
.path-card-slot .pc-meta {
  color: #8c857a;
}
.path-card-ghost .pc-seg.on {
  background: linear-gradient(90deg, rgba(192, 57, 43, .45), rgba(209, 153, 41, .45));
}
.pc-word, .pc-py, .pc-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pc-word { font-family: var(--serif); font-weight: 700; font-size: 20px; letter-spacing: 2px; color: var(--ink); }
.pc-py { font-size: 16px; letter-spacing: .4px; color: #858078; }
.pc-meta { font-size: 16px; font-weight: 500; }
.pc-meta b { font-weight: 700; }
.pc-bar { display: flex; gap: 5px; width: 100%; }
.pc-seg { flex: 1; height: 5px; border-radius: 3px; background: var(--seg-off); }
.lv-hard .pc-meta { color: var(--red); }
.lv-hard .pc-seg.on { background: var(--red); }
.lv-mid .pc-meta { color: var(--gold); }
.lv-mid .pc-seg.on { background: var(--gold); }
.lv-easy .pc-meta { color: var(--green); }
.lv-easy .pc-seg.on { background: var(--green); }
.pc-tag { font-weight: 500; }

/* ---------- 每日可接提示 ---------- */
.paths.daily-hints-mode .paths-sub,
.paths.daily-hints-mode .paths-head::after {
  display: none;
}
.paths.daily-hints-mode .paths-title::before {
  content: "★";
  color: var(--red);
  font-weight: 700;
  margin-right: 6px;
  font-family: var(--sans);
}
.paths.daily-hints-mode .paths-title {
  font-size: 16px;
  color: var(--ink2);
}
.paths.daily-hints-mode .paths-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  height: auto;
  gap: 14px;
}
.hint-card {
  text-align: left;
  background: rgba(255, 252, 246, .82);
  border: 1px solid #e0d4c0;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(102, 89, 71, .1);
  padding: 14px 16px 14px 52px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 96px;
  position: relative;
  cursor: pointer;
}
.hint-card:hover {
  border-color: #d1c2a8;
  background: rgba(255, 254, 250, .95);
}
.hint-card-slot {
  pointer-events: none;
  opacity: .55;
  border-style: dashed;
}
.hc-num {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red);
  color: #fffaf5;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.hc-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.hc-word {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--ink);
}
.hc-py {
  font-size: 16px;
  color: #858078;
  letter-spacing: .3px;
}
.hc-exp {
  font-size: 16px;
  line-height: 1.55;
  color: #8c857a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 弹性占位（把状态栏推到底部，保证首屏定高） ---------- */
.spacer { flex: 1 1 0; min-height: 0; }
.ad {
  height: 60px;
  width: 100%;
  flex-shrink: 0;
  border: 1px dashed var(--line3);
  border-radius: 8px;
  background: #f2f0e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9e968c;
  font-size: 16px;
  margin-bottom: 0;
}
.ad:empty::before { content: "广告位"; }

/* ============================================================
   状态栏 + 操作
   ============================================================ */
.statusbar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line3);
  border-radius: 10px;
  padding: 10px 20px;
  width: 100%;
}
.st-list {
  display: flex;
  align-items: center;
  gap: 14px;
}
.st { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.st-lbl { font-size: 16px; color: var(--ink3); }
.st-val { font-size: 16px; color: var(--ink3); font-weight: 500; }
.st-combo { color: var(--red); font-weight: 700; font-family: var(--serif); font-size: 16px; }
#st-score { color: var(--red); font-weight: 700; font-family: var(--serif); font-size: 16px; }
.st::after { content: "·"; color: #b2a899; margin-left: 8px; }
.st:last-of-type::after { content: none; }
.sb-spacer { flex: 1; }
.action-row { display: flex; gap: 10px; align-items: center; }
.btn-line {
  height: auto;
  font-size: 16px;
  font-weight: 500;
  border-radius: 8px;
  padding: 7px 14px;
  background: transparent;
  border: 1.3px solid #b8ad9e;
  color: var(--ink4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-line.danger { border-color: var(--red); color: var(--red); }
.btn-line:hover { background: rgba(0, 0, 0, .03); }
/* 每日水墨横幅里的按钮：小尺寸适应深色背景 */
.daily-ctrl-btn {
  border-color: rgba(255, 255, 255, .38);
  color: #e8dfc8;
  font-size: 16px;
  padding: 4px 10px;
  height: auto;
  line-height: 1.4;
  white-space: nowrap;
}
.daily-ctrl-btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .7); }
.daily-ctrl-btn.danger { border-color: rgba(210, 100, 80, .6); color: #f5a090; }
.daily-ctrl-btn.danger:hover { background: rgba(210, 100, 80, .15); }
.btn-start {
  height: auto;
  background: var(--red);
  color: #fff;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 1px;
  border-radius: 8px;
  padding: 9px 26px;
}
.btn-start:hover { background: var(--red-dark); }

/* ---------- 广告位 ---------- */
/* 广告位样式由上方 .ad 统一定义（已移至 spacer 区域旁），这里仅保留空备注 */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ============================================================
   第二屏：玩法 / 每日成语 / 玩法规则 / 词典入口
   ============================================================ */
.home2 {
  position: relative;
  background: #f4f0e7;
  padding: 56px 60px 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
}
.home2::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("./assets/ink-landscape.png");
  background-size: cover;
  background-position: center;
  opacity: .1;
  pointer-events: none;
}
.home2 > * { position: relative; z-index: 1; }
.sec { width: 100%; max-width: var(--maxw); display: flex; flex-direction: column; align-items: center; gap: 28px; }
.sec-head { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sec-title {
  display: flex; align-items: center; gap: 14px;
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 30px;
  letter-spacing: 3px;
  color: #242424;
}
.ink-line { width: 34px; height: 2px; background: var(--red); opacity: .5; }
.sec-sub { font-size: 16px; letter-spacing: 1px; color: #807870; }
.ink-divider {
  width: 380px; height: 2px;
  background: linear-gradient(90deg, rgba(89, 77, 64, 0), rgba(89, 77, 64, .38) 50%, rgba(89, 77, 64, 0));
}

/* 玩法卡片 */
.mode-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; width: 100%; }
.mode-card {
  background: linear-gradient(180deg, #fdfaf3, #f2ead9);
  border: 1px solid var(--line2);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(102, 89, 71, .16);
  padding: 32px 26px 30px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.mc-icon { width: 60px; height: 60px; border-radius: 30px; display: grid; place-items: center; font-size: 26px; }
.mc-icon.red { background: rgba(192, 57, 43, .12); color: var(--red); }
.mc-icon.green { background: rgba(78, 140, 90, .12); color: var(--green); }
.mc-icon.gold { background: rgba(209, 153, 41, .12); color: var(--gold); }
.mc-title { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 21px; letter-spacing: 1px; color: #242424; }
.mc-desc { font-size: 16px; line-height: 1.65; color: #757069; text-align: center; }
.mc-btn { border: 0; border-radius: 8px; padding: 9px 22px; font-size: 16px; font-weight: 500; }
.mc-btn.primary { background: var(--red); color: #fff; }
.mc-btn.primary:hover { background: var(--red-dark); }
.mc-btn.outline { background: transparent; border: 1.3px solid var(--red); color: var(--red); }
.mc-btn.outline:hover { background: var(--red-soft); }

/* 每日成语卡 */
.daily-word-card {
  width: 100%;
  background: linear-gradient(180deg, #fdfbf5, #f3ebda);
  border: 1px solid var(--line2);
  border-radius: 16px;
  box-shadow: 0 5px 16px rgba(102, 89, 71, .16);
  display: flex;
  align-items: stretch;
}
.dw-left { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 30px; }
.dw-badge { background: rgba(192, 57, 43, .1); color: var(--red); font-size: 16px; font-weight: 500; border-radius: 20px; padding: 5px 12px; }
.dw-word { font-family: var(--serif); font-weight: 900; font-size: 46px; letter-spacing: 6px; color: var(--ink); }
.dw-py { font-size: 16px; letter-spacing: 1px; color: var(--ink5); }
.dw-divider { width: 1px; background: var(--line2); flex-shrink: 0; }
.dw-right { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 34px; }
.dw-row { display: flex; gap: 12px; align-items: flex-start; }
.dw-lbl { flex-shrink: 0; width: 46px; font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--red); }
.dw-row p { flex: 1; font-size: 16px; line-height: 1.72; color: var(--ink4); }

/* 玩法步骤 */
.steps { display: flex; align-items: center; gap: 16px; width: 100%; }
.step-card {
  flex: 1;
  background: linear-gradient(180deg, #fdfaf3, #f2ead9);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 28px 20px 26px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.step-card .step-n {
  width: 44px; height: 44px; border-radius: 22px;
  background: var(--red); color: #fff;
  font-family: var(--serif); font-weight: 700; font-size: 20px;
  display: grid; place-items: center;
}
.step-t { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: 1px; color: #242424; }
.step-d { font-size: 16px; line-height: 1.65; color: #7a756e; text-align: center; }
.step-arrow { color: #999185; font-size: 22px; flex-shrink: 0; }

/* 词典入口 */
.dict-banner {
  width: 100%;
  text-decoration: none;
  background: linear-gradient(180deg, #eadec9, #e1d2b9);
  border: 1px solid #ccbda3;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(102, 89, 71, .14);
  padding: 40px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.db-title { margin: 0; font-family: var(--serif); font-weight: 900; font-size: 30px; letter-spacing: 3px; color: #292624; }
.db-desc { margin-top: 12px; font-size: 16px; color: #6b665c; }
.db-actions { display: flex; gap: 12px; align-items: center; }
.db-search { height: 50px; width: 240px; background: #fff; border: 1px solid #ccbda3; border-radius: 8px; display: flex; align-items: center; padding: 0 18px; color: #8c857a; font-size: 16px; }
.db-enter { height: 50px; width: 140px; background: var(--red); color: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 500; }
.dict-banner:hover .db-enter { background: var(--red-dark); }

/* ============================================================
   页脚
   ============================================================ */
.site-footer { background: #2b2724; color: #cdc6ba; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 48px 60px 28px; }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; }
.footer-brand { display: flex; gap: 14px; align-items: flex-start; }
.footer-brand .brand-logo { width: 40px; height: 40px; }
.footer-name { font-family: var(--serif); font-weight: 700; font-size: 20px; color: #f2ede3; letter-spacing: 1px; }
.footer-desc { margin-top: 8px; font-size: 16px; color: #9a9286; max-width: 240px; line-height: 1.6; }
.footer-cols { display: flex; gap: 64px; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.fc-title { font-size: 16px; color: #f2ede3; font-weight: 500; margin-bottom: 2px; }
.fc-link { font-size: 16px; color: #a39b8f; text-decoration: none; }
.fc-link:hover { color: #e7ddcd; }
.footer-bottom {
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid #423c36;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; color: #8d8579;
  flex-wrap: wrap; gap: 8px;
}
.footer-bottom .fc-link { font-size: 16px; }

@media (min-width: 768px) {
  .chain-wrap {
    width: min(100%, calc(4 * var(--chain-card-w) + 3 * var(--chain-arrow-w) + 6 * var(--chain-gap) + 56px));
    margin: 0 auto;
    padding: 14px 20px 12px;
    border-radius: 14px;
    scroll-snap-type: x proximity;
    scrollbar-color: rgba(160, 140, 115, .15) transparent;
    overflow-x: scroll;
    overflow-y: visible;
  }
  .chain {
    padding-right: 20px;
  }
  .chain-card,
  .game-layout.timed-playing .chain-card {
    width: var(--chain-card-w);
    scroll-snap-align: start;
  }
  .chain-arrow,
  .game-layout.timed-playing .chain-arrow {
    flex: 0 0 var(--chain-arrow-w);
    width: var(--chain-arrow-w);
    min-width: var(--chain-arrow-w);
  }
  .chain-wrap:hover {
    background: rgba(253, 250, 243, .24);
  }
  .game-layout.timed-playing .chain-wrap {
    margin-top: -4px;
    padding-top: clamp(10px, 1.8vh, 22px);
  }
}

@media (min-width: 768px) and (max-height: 820px) {
  .game-layout {
    gap: 8px;
  }
  .chain-wrap {
    padding-top: 14px;
    padding-bottom: 8px;
  }
  .chain-card,
  .game-layout.timed-playing .chain-card {
    width: clamp(220px, 15vw, 250px);
  }
  .chain-card .cc-inner {
    min-height: 94px;
    padding: 18px 10px 15px;
  }
  .cc-word {
    font-size: clamp(32px, 2vw, 38px);
    letter-spacing: 4px;
  }
  .cc-py {
    font-size: 16px;
  }
  .prompt {
    font-size: 20px;
  }
  .paths {
    gap: 9px;
  }
  .paths-grid {
    grid-auto-rows: auto;
    max-height: 240px;
  }
  .path-card {
    padding: 10px 12px;
    min-height: 0;
  }
  .pc-word {
    font-size: 20px;
  }
  .statusbar {
    padding: 6px 18px;
    gap: 10px;
  }
  .game-layout {
    padding-top: 18px;
  }
  .game-layout.daily-playing {
    padding-top: 10px;
  }
  .chain-card .cc-inner {
    min-height: 78px;
    padding: 12px 10px 10px;
  }
  .paths-grid {
    max-height: 200px;
  }
  .path-card {
    padding: 7px 12px;
    gap: 2px;
  }
  .ink-stats {
    min-height: 52px;
    padding: 6px 16px;
  }
  .daily-progress {
    gap: 3px;
    margin: 4px 0 0;
  }
  .dp-headline {
    font-size: 22px;
    margin-bottom: 2px;
  }
  .dp-track {
    margin-bottom: 2px;
  }
  .dp-badge {
    padding: 2px 10px;
    font-size: 11px;
    margin-bottom: 2px;
  }
  .dp-badge::before {
    font-size: 12px;
  }
  .dp-headline {
    font-size: 22px;
    margin-bottom: 4px;
  }
  .dp-track {
    height: 6px;
    max-width: 200px;
    margin-bottom: 4px;
  }
  .dp-meta {
    font-size: 11px;
  }
  .play-area {
    gap: 6px;
  }
}

@media (min-width: 768px) and (min-height: 960px) {
  .chain-wrap {
    padding-top: 58px;
  }
}

@media (max-width: 767px) {
  /* 顶部文字导航交给底部 TabBar，移动端只留 logo */
  .topnav-links { display: none; }
  .topnav { padding: 8px 16px; }
  /* 全站底部预留 TabBar 高度，内容不被遮挡 */
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .game-layout {
    min-height: auto;
    max-height: none;
    overflow: visible;
    padding: 12px 14px 0;
  }
  .chain-wrap {
    margin: 0;
    padding: 24px 0 12px;
    display: flex;
    overflow-x: auto;
    overflow-y: visible; /* 允许纵向溢出（如角标）显示 */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }
  .chain-wrap::-webkit-scrollbar { display: none; }
  .chain {
    margin: 0;
    padding: 0;
    justify-content: flex-start;
    width: max-content;
    min-width: 100%;
    gap: 12px;
  }
  .mode-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .mode-tabs {
    justify-content: center;
    gap: 20px;
  }
  .mode-opts {
    justify-content: center;
    flex-wrap: nowrap;
  }
  .timed-idle-card,
  .daily-idle-card {
    margin-top: 0;
    padding: 24px 16px;
    border-radius: 16px;
    gap: 12px;
  }
  .dic-title, .tic-title {
    font-size: 24px;
    margin: 4px 0;
  }
  .daily-idle-card .dic-desc {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 4px;
  }
  .dic-tags {
    gap: 8px;
  }
  .dic-tags span {
    min-height: 32px;
    padding: 0 12px;
    font-size: 14px;
  }
  .dic-week {
    margin-top: 4px;
    gap: 12px;
  }
  .dic-week-lbl {
    font-size: 14px;
    margin-bottom: 4px;
  }
  .dic-week-days {
    gap: 8px;
  }
  .dic-day-dot {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .dic-start {
    width: 100%;
    min-width: 0;
    height: 48px;
    font-size: 18px;
    margin-top: 4px;
  }
  .dic-record, .tic-record {
    font-size: 13px;
    margin-top: 4px;
  }
  .tic-desc {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 4px;
  }
  .tic-tags {
    gap: 8px;
  }
  .tic-tags span {
    min-height: 32px;
    padding: 0 12px;
    font-size: 14px;
  }
  .tic-start {
    width: 100%;
    min-width: 0;
    height: 48px;
    font-size: 18px;
    margin-top: 4px;
  }
  .game-layout.timed-playing .timed-bar {
    min-height: 0;
    gap: 12px;
    max-width: 100%;
    margin-top: -2px;
    padding: 0 4px;
    overflow-x: auto;
    justify-content: center;
  }
  .game-layout.timed-playing .vs-side {
    min-width: 0;
    padding: 0;
  }
  .vs-count .tb-cnt {
    font-size: 34px;
  }
  .vs-track {
    width: 86px;
  }
  .tb-ring {
    width: 104px;
    height: 104px;
  }
  .tb-num {
    font-size: 27px;
  }
  .game-layout.timed-playing .chain-card {
    width: calc(50% - 6px); /* 统一宽度，只显示两个 */
  }
  .game-layout.timed-playing .paths-grid {
    grid-template-columns: 1fr;
  }
  /* 多路径推荐：改为单行横向滑动 */
  .paths-grid {
    display: flex !important;
    overflow-x: auto;
    overflow-y: hidden;
    grid-template-columns: none !important;
    gap: 12px;
    margin: 0; /* 去掉负边距 */
    padding: 4px 0 12px; /* 去掉左右内边距 */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .paths-grid::-webkit-scrollbar {
    display: none; /* 隐藏滚动条 */
  }
  .path-card {
    flex: 0 0 calc(50% - 6px);
    scroll-snap-align: start;
    min-height: 90px;
    padding: 8px;
  }
  .pc-word {
    font-size: 15px;
  }
  .pc-pinyin {
    font-size: 11px;
  }
  .pc-sub {
    font-size: 12px;
  }
  .mode-date {
    display: none !important;
  }
  .paths.daily-hints-mode .paths-grid {
    display: flex !important;
    overflow-x: auto;
    overflow-y: hidden;
    grid-template-columns: none !important;
    gap: 12px;
    margin: 0;
    padding: 4px 0 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .paths.daily-hints-mode .path-card {
    flex: 0 0 calc(50% - 6px);
    scroll-snap-align: start;
    min-height: 90px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s;
  }
  .paths.daily-hints-mode .path-card:active {
    transform: scale(0.98);
  }
  .paths.daily-hints-mode .path-card .step-n {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    font-size: 11px;
    text-align: center;
    background: var(--red);
    color: #fff;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: text-bottom;
  }
  .paths.daily-hints-mode .path-card .pc-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .paths.daily-hints-mode .pc-word {
    font-size: 16px;
    margin-bottom: 2px;
    white-space: nowrap;
  }
  .paths.daily-hints-mode .pc-pinyin {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .paths.daily-hints-mode .pc-sub {
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: 2px;
    line-height: 1.3;
  }
  .paths.daily-hints-mode .paths-grid::-webkit-scrollbar {
    display: none;
  }
  .paths-sub {
    display: none;
  }
  /* 修复移动端间距 */
  .game-layout.playing .spacer {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 10px; /* 进一步压缩留白 */
  }
  .custom-select {
    width: calc(50% - 4px);
    max-content: 160px;
    height: 36px;
  }
  .mode-opts {
    gap: 8px;
    justify-content: center;
  }
  .cs-header {
    padding: 0 20px 0 8px;
    border-radius: 6px;
  }
  .cs-lbl, .cs-val {
    font-size: 16px; /* 增大移动端下拉框字号 */
  }
  .cs-header::after {
    right: 8px;
    width: 10px;
    height: 6px;
  }
  /* 修复移动端接龙卡片 */
  .chain-card {
    width: calc(50% - 6px); /* 占据一半宽度减去间距 */
    max-width: none;
    height: auto; /* 不再强制固定高度，让内容撑开 */
    min-height: 70px; /* 进一步降低最小高度，使其更像长方形 */
    padding: 6px 8px; /* 减小上下内边距 */
    flex-shrink: 0;
    scroll-snap-align: start; /* 改为起点吸附 */
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .chain-card .cc-inner {
    min-height: 56px; /* 减小装饰边框的最小高度 */
    padding: 10px 8px 8px; /* 减小内边距 */
  }
  .cc-word {
    font-size: 20px;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
  }
  .cc-pinyin {
    font-size: 10px; /* 进一步减小拼音字号，防止溢出 */
    white-space: nowrap;
    letter-spacing: 0;
  }
  .chain-arrow {
    display: none !important; /* 隐藏箭头查看效果 */
  }

  /* 针对 383px 以下超小屏幕的特殊适配 */
  @media (max-width: 383px) {
    .mode-opts {
      gap: 4px;
    }
    .custom-select {
      width: calc(50% - 2px);
    }
    .cs-header {
      padding: 0 14px 0 4px;
    }
    .cs-lbl, .cs-val {
      font-size: 13px; /* 383px 以下也相应增大一点 */
    }
    .chain-card,
    .game-layout.timed-playing .chain-card {
      width: calc(50% - 4px);
      height: auto;
      min-height: 60px; /* 进一步压扁 */
      padding: 4px;
    }
    .chain-card .cc-inner {
      min-height: 50px;
      padding: 8px 6px 6px;
    }
    .cc-word {
      font-size: 18px;
      letter-spacing: 0px;
    }
    .cc-pinyin {
      font-size: 9px; /* 超小屏幕下再缩减一点 */
    }
    .path-card,
    .paths.daily-hints-mode .path-card {
      flex: 0 0 calc(50% - 4px);
    }
    .history-hero-title {
      font-size: 20px;
    }
    .stat-card {
      min-height: 104px;
      padding: 12px 10px;
      gap: 10px;
    }
    .sc-num {
      font-size: 24px;
    }
    .stat-note,
    .sc-unit,
    .rtc-lbl,
    .rtc-date {
      font-size: 11px;
    }
    .trend-chart {
      gap: 4px;
    }
    .tc-count,
    .tc-lbl {
      font-size: 10px;
    }
    .rt-card {
      padding: 12px;
    }
    .rt-card-body {
      gap: 8px;
    }
  }
  /* 修复移动端输入区域 */
  .input-row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .answer-input {
    width: 100%;
    height: 46px;
  }
  .btn-primary, .btn-ghost {
    flex: 1;
    height: 46px;
    min-width: 0; /* 防止内容撑开 */
    padding: 0 10px;
  }
  .btn-primary {
    width: auto; /* 覆盖之前的 100% */
  }
  /* 状态栏适配：全部横向滑动显示 */
  .statusbar {
    flex-direction: row !important;
    justify-content: flex-start !important;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    margin: -10px 0 0; /* 使用负 margin 强行向上移动 */
    padding: 10px 12px;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 10px;
    border-left: 1px solid var(--line3);
    border-right: 1px solid var(--line3);
  }
  .statusbar::-webkit-scrollbar {
    display: none;
  }
  .st-list {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
  }
  .st {
    flex-shrink: 0;
  }
  .st::after {
    display: none;
  }
  .sb-spacer {
    display: none;
  }
  .btn-line {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 14px;
  }
  .daily-progress {
    padding: 0 4px;
    gap: 10px;
  }
  .dp-headline {
    font-size: 26px;
  }
  .mode-date {
    font-size: 16px;
  }
  .footer-inner { padding: 32px 20px 22px; }
  .footer-top { flex-direction: column; gap: 26px; }
  .footer-desc { max-width: none; }
  .footer-cols { gap: 24px 40px; flex-wrap: wrap; width: 100%; }
  .footer-col { gap: 10px; }
  .fc-title { white-space: nowrap; }
  .fc-link { white-space: nowrap; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
  .history-head {
    align-items: flex-start;
  }
  .history-hero {
    padding: 18px 16px;
    gap: 14px;
  }
  .history-kicker {
    min-height: 26px;
    padding: 0 10px;
    font-size: 12px;
  }
  .history-hero-title {
    font-size: 22px;
  }
  .history-hero-sub {
    font-size: 14px;
    line-height: 1.65;
  }
  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat-card {
    min-height: 116px;
    padding: 14px 12px;
    gap: 14px;
  }
  .stat-card.is-primary {
    grid-column: span 2;
  }
  .stat-top {
    gap: 6px;
  }
  .sc-num {
    font-size: 28px;
  }
  .sc-lbl {
    font-size: 14px;
  }
  .stat-note,
  .sc-unit {
    font-size: 12px;
  }
  
  /* 近 7 日活跃图适配 */
  .trend-chart {
    gap: 6px;
    padding-top: 10px;
    justify-content: space-between;
    width: 100%;
  }
  .tc-bar-wrap {
    height: 108px;
    width: 100%;
    max-width: 24px;
  }
  .tc-bar {
    width: 100%;
    max-width: 18px;
  }
  .tc-count {
    min-height: 16px;
    font-size: 11px;
  }
  .tc-lbl {
    font-size: 11px;
    white-space: nowrap;
  }
  .history-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .panel-side {
    width: 100%;
  }
  .mode-row {
    padding: 12px;
    gap: 8px;
  }
  .mr-top b {
    font-size: 15px;
  }
  .mr-top span,
  .mr-meta strong {
    font-size: 13px;
  }
  .mr-meta {
    font-size: 12px;
  }
  .rec-table {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .rt-card {
    padding: 14px;
    gap: 10px;
  }
  .rt-card-head {
    padding-bottom: 8px;
  }
  .rtc-mode {
    font-size: 15px;
  }
  .rtc-result {
    font-size: 13px;
  }
  .rtc-lbl {
    font-size: 12px;
  }
  .rtc-val {
    font-size: 14px;
  }
  .rtc-date {
    font-size: 12px;
  }
  .rt-card-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rtc-item-date {
    grid-column: span 2;
    align-items: flex-start;
    text-align: left;
    padding-top: 2px;
    border-top: 1px dashed #eee2cf;
  }
  .theme-bars {
    grid-template-columns: 1fr;
  }
  .badges {
    grid-template-columns: repeat(2, 1fr);
  }
  .rank-banner {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  .rb-seal-wrap {
    margin-bottom: 10px;
  }
  /* 段位阶梯：移动端在滚动容器内横向排列 */
  .rank-ladder-scroll {
    padding-bottom: 6px;
  }
  .rank-ladder {
    justify-content: flex-start;
    gap: 18px;
    min-width: max-content;
    padding: 4px 2px 6px;
  }
  .ladder-step {
    flex-shrink: 0;
  }
  /* 子页头部 */
  .sub-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
  }
  .back-btn {
    padding: 7px 12px;
    font-size: 14px;
    gap: 4px;
  }
  .back-arrow {
    font-size: 16px;
  }
  .back-label {
    font-size: 13px;
  }
  .sub-titles {
    text-align: right;
    flex: 1;
    min-width: 0;
  }
  .sub-title {
    font-size: 22px;
  }
  .sub-sub {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .panel-h {
    font-size: 15px;
  }
  .mr-top b {
    font-size: 14px;
  }
  .tbar-lbl, .tbar-pct {
    font-size: 14px;
  }
  .ww, .we, .wrev {
    font-size: 14px;
  }
  .title-pill {
    padding: 6px 12px;
    font-size: 14px;
  }
  .privacy-card {
    padding: 24px 16px;
    font-size: 16px;
  }
  .privacy-card h2 {
    font-size: 20px;
  }
  .privacy-card h3 {
    font-size: 18px;
  }
  
  /* ---- 第二屏 home2 ---- */
  .home2 { padding: 36px 16px 60px; gap: 36px; }
  .ink-divider { width: 100%; }
  .sec-title { font-size: 22px; letter-spacing: 2px; }
  .sec-sub { font-size: 16px; }
  /* 三大玩法：移动端单列 */
  .mode-cards { grid-template-columns: 1fr; gap: 14px; }
  .mode-card { padding: 20px 18px 18px; gap: 10px; }
  .mc-icon { width: 44px; height: 44px; font-size: 20px; }
  .mc-title { font-size: 18px; }
  .mc-desc { font-size: 16px; }
  /* 每日成语卡片：竖排 */
  .daily-word-card { flex-direction: column; gap: 16px; padding: 20px 18px; }
  .dw-left { width: 100%; padding: 20px 0; }
  .dw-right { padding: 0 0 20px; }
  .dw-divider { display: none; }
  .dw-word { font-size: 30px; }
  /* 步骤：纵向 */
  .steps { flex-direction: column; gap: 0; }
  .step-arrow { transform: rotate(90deg); margin: -2px 0; }
  .step-card { padding: 18px 18px 16px; flex-direction: row; align-items: center; gap: 14px; }
  .step-card .step-n { width: 36px; height: 36px; font-size: 18px; flex-shrink: 0; }
  .step-t { font-size: 17px; }
  .step-d { text-align: left; font-size: 16px; }
  /* 词典入口 */
  .dict-banner { flex-direction: column; padding: 24px 20px; gap: 16px; align-items: flex-start; }
  .db-title { font-size: 22px; }
  .db-desc { font-size: 16px; }
  .db-actions { width: 100%; flex-direction: column; align-items: stretch; gap: 10px; }
  .db-search { width: 100%; }
  .db-enter { width: 100%; justify-content: center; }

  /* ---- 子页（战绩/成长）移动端 ---- */
  .subpage { min-height: auto; background-attachment: scroll; }
  .sub-wrap { padding: 16px 16px 40px; gap: 16px; }
  .sub-title { font-size: 22px; }
  .panel { padding: 16px; }
  .panel-row { flex-direction: column; gap: 12px; }
  .panel-side { width: 100%; }
}

/* ========== 返回顶部按钮 ========== */
#btn-back-top {
  position: fixed;
  right: 20px;
  bottom: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  z-index: 180;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
#btn-back-top::before {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  border-left: 2.5px solid var(--ink3, #383630);
  border-top: 2.5px solid var(--ink3, #383630);
  transform: rotate(45deg) translateY(2px);
  border-radius: 1px;
}
#btn-back-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#btn-back-top:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.26); }
@media (max-width: 767px) {
  #btn-back-top { right: 12px; bottom: calc(68px + env(safe-area-inset-bottom)); }
}

/* ============================================================
   移动端底部标签栏（桌面隐藏）
   ============================================================ */
.tabbar { display: none; }

@media (max-width: 767px) {
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: rgba(252, 250, 245, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #e6ddcc;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 16px rgba(102, 89, 71, 0.1);
  }
  .tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: 0;
    padding: 5px 0;
    color: var(--ink5);
    font-size: 12px;
    line-height: 1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
  }
  .tab-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .tab-btn span {
    font-size: 12px;
    font-weight: 500;
  }
  .tab-btn.active {
    color: var(--red);
  }
  .tab-btn.active svg {
    stroke-width: 2.2;
  }
}

/* ============================================================
   弹窗：遮罩通用
   ============================================================ */
.card-mask, .result-mask, .confirm-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.card-mask { background: rgba(26, 20, 15, .55); }
.result-mask { background: rgba(20, 15, 13, .62); }
.confirm-mask { background: rgba(26, 20, 15, .5); }
.card-mask.show, .result-mask.show, .confirm-mask.show { display: flex; }

/* 成语解释弹窗 */
.idiom-modal {
  background: var(--panel2);
  border: 1px solid #d1c2a8;
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  padding: 34px 38px;
  width: 600px;
  max-width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.im-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.im-titles { display: flex; flex-direction: column; gap: 6px; }
.im-titlerow { display: flex; align-items: center; gap: 10px; }
.sc-word { margin: 0; font-family: var(--serif); font-weight: 900; font-size: 32px; color: #29241f; }
.im-tag { background: #ede0c7; color: #806b4d; font-size: 16px; font-weight: 500; border-radius: 6px; padding: 3px 8px; }
.sc-pinyin { font-size: 16px; color: var(--ink4); }
.im-close { width: 34px; height: 34px; border-radius: 999px; border: 0; background: #f0e8d9; color: var(--ink4); font-size: 16px; flex-shrink: 0; }
.im-close:hover { background: #e8ddc8; }
.im-divider { height: 1px; background: #e0d4bd; }
.im-section { display: flex; flex-direction: column; gap: 7px; }
.im-h { font-weight: 700; font-size: 16px; color: var(--red); }
.sc-text { font-size: 16px; line-height: 25px; color: #474038; }
.im-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.im-chip { background: #f6f1e7; border: 1px solid #d1c2a8; border-radius: 8px; padding: 8px 14px; font-size: 16px; font-weight: 500; color: #29241f; }
.im-chip:hover { background: #efe7d6; }
.sc-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.sc-tag { font-size: 16px; color: var(--ink4); background: #f1ebdd; border-radius: 999px; padding: 3px 10px; }
.im-actions { display: flex; gap: 12px; align-items: center; }
.im-join { flex: 1; border: 0; background: var(--red); color: #fffaf5; font-weight: 700; font-size: 16px; padding: 13px; border-radius: 10px; }
.im-join:hover { background: var(--red-dark); }
.im-fav { border: 1.5px solid #d1c2a8; border-radius: 10px; padding: 12px 22px; font-size: 16px; color: #4d453d; text-decoration: none; font-weight: 500; }
.im-fav:hover { background: #f4eee1; }

/* 结算 / 胜利弹窗 */
.result-card {
  background: var(--panel2);
  border: 1px solid #d1c2a8;
  border-radius: 22px;
  box-shadow: 0 20px 54px rgba(0, 0, 0, .4);
  padding: 40px 48px;
  width: 620px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.res-seal {
  width: 92px; height: 92px; border-radius: 999px;
  background: var(--red);
  border: 2.5px solid #d1a852;
  color: #fff7eb;
  font-family: var(--serif); font-weight: 900; font-size: 46px;
  display: grid; place-items: center;
}
.res-seal.lose { background: #6e655b; border-color: #b6a98c; }
.res-title { margin: 0; font-family: var(--serif); font-weight: 900; font-size: 32px; color: #29241f; }
.res-sub { font-size: 16px; color: #736b61; }
.res-stats {
  display: flex;
  width: 100%;
  background: #f6f1e7;
  border: 1px solid #e0d4bd;
  border-radius: 14px;
  padding: 20px 0;
}
.res-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.rs-num { font-family: var(--serif); font-weight: 900; font-size: 26px; color: var(--red); }
.rs-lbl { font-size: 16px; font-weight: 500; color: #736b61; }
.res-best {
  background: #f7eddb;
  border: 1px solid rgba(209, 168, 82, .6);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 16px;
  font-weight: 700;
  color: #8c6626;
  text-align: center;
}
.res-best b { color: var(--red); }
.res-actions { display: flex; gap: 12px; width: 100%; }
.res-actions .btn-primary { flex: 1; height: auto; padding: 14px; border-radius: 10px; box-shadow: 0 5px 14px rgba(153, 46, 33, .3); }
.res-btn-line { border: 1.5px solid #d1c2a8; background: transparent; border-radius: 10px; padding: 14px 22px; font-size: 16px; font-weight: 500; color: #4d453d; }
.res-btn-line:hover { background: #f4eee1; }

/* 确认弹窗 */
.confirm-card {
  background: var(--panel2);
  border: 1px solid #d1c2a8;
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  padding: 28px 30px;
  width: 380px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.confirm-title { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--ink2); }
.confirm-sub { font-size: 16px; line-height: 1.6; color: #736b61; }
.confirm-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 6px; }
.confirm-actions .btn-line { padding: 9px 18px; }
.confirm-actions .btn-primary { height: auto; padding: 9px 22px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(41, 36, 31, .94);
  color: #f5f0e5;
  font-size: 16px;
  padding: 10px 20px;
  border-radius: 999px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   子页（战绩 / 成长）通用
   ============================================================ */
.subpage {
  background-image: linear-gradient(rgba(248, 244, 236, .55), rgba(248, 244, 236, .55)), url("./assets/ink-landscape.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: calc(100vh - 64px);
}
.sub-wrap { max-width: var(--maxw); margin: 0 auto; padding: 24px 40px 56px; display: flex; flex-direction: column; gap: 20px; }
.sub-head { display: flex; align-items: center; gap: 18px; flex-wrap: nowrap; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font-size: 16px; color: var(--ink4); white-space: nowrap; flex-shrink: 0; }
.back-btn:hover { background: #f4eede; }
.back-arrow { font-size: 18px; line-height: 1; }
.back-label { font-size: 16px; }
.sub-titles { display: flex; flex-direction: column; gap: 4px; }
.sub-title { margin: 0; font-family: var(--serif); font-weight: 900; font-size: 32px; color: #29241f; }
.sub-sub { font-size: 16px; color: #736b61; }

.history-wrap { gap: 18px; }
.history-head { align-items: flex-start; justify-content: space-between; }
.history-hero {
  padding: 24px;
  gap: 18px;
  background:
    radial-gradient(circle at top right, rgba(209, 168, 82, .12), transparent 32%),
    linear-gradient(180deg, rgba(252, 247, 237, .96), rgba(248, 242, 230, .92));
}
.history-copy { display: flex; flex-direction: column; gap: 8px; max-width: 620px; }
.history-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(209, 168, 82, .14);
  color: #8c6626;
  font-size: 14px;
  font-weight: 700;
}
.history-hero-title { margin: 0; font-size: 28px; color: #29241f; }
.history-hero-sub { margin: 0; font-size: 16px; line-height: 1.7; color: #736b61; }
.history-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .9fr); gap: 20px; }
.history-panel { min-height: 100%; }
.history-records { gap: 14px; }

.panel {
  background: var(--panel2);
  border: 1px solid #d1c2a8;
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel-h { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: 16px; color: #29241f; }
.panel-tick { width: 4px; height: 17px; border-radius: 2px; background: var(--red); display: inline-block; }
.panel-h small { font-family: var(--sans); font-weight: 400; font-size: 16px; color: var(--ink5); }
.panel-row { display: flex; gap: 20px; align-items: stretch; }
.panel-grow { flex: 1; }
.panel-side { width: 420px; flex-shrink: 0; }

/* 统计卡 */
.stat-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat-card {
  background: rgba(255, 250, 243, .72);
  border: 1px solid #d9ccb6;
  border-radius: 16px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 136px;
}
.stat-card.is-primary {
  background: linear-gradient(180deg, #fff7ea, #f7ecdb);
  border-color: rgba(209, 168, 82, .75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}
.stat-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.sc-lbl { font-size: 15px; font-weight: 700; color: #5b5248; }
.stat-note { font-size: 13px; color: #9b8f7c; line-height: 1.4; }
.stat-main { display: flex; align-items: flex-end; gap: 8px; }
.sc-num { font-family: var(--serif); font-weight: 900; font-size: 34px; line-height: 1; color: var(--red); }
.sc-unit { font-size: 15px; font-weight: 700; color: #8b7f70; line-height: 1.3; padding-bottom: 2px; }

/* 近 7 日柱状图 */
.trend-chart { display: flex; gap: 18px; justify-content: center; align-items: flex-end; }
.tc-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
.tc-count {
  min-height: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #8b7f70;
}
.tc-count.today { color: var(--red); }
.tc-bar-wrap { height: 150px; width: 100%; max-width: 36px; display: flex; align-items: flex-end; justify-content: center; }
.tc-bar { width: 30px; border-radius: 6px; background: linear-gradient(180deg, #db8c4d, #cc753d); }
.tc-bar.today { background: linear-gradient(180deg, #cc472e, #b83326); }
.tc-lbl { font-size: 16px; color: #736b61; }
.tc-lbl.today { color: var(--red); }

/* 模式战绩 */
.mode-stats { display: flex; flex-direction: column; gap: 16px; }
.mode-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  background: rgba(255, 250, 243, .72);
  border: 1px solid #e5dbc9;
}
.mr-top { display: flex; align-items: center; justify-content: space-between; }
.mr-top b { font-size: 16px; color: #29241f; }
.mr-top span { font-size: 16px; color: #736b61; }
.mr-track { height: 8px; border-radius: 999px; background: #e5dbc9; overflow: hidden; }
.mr-fill { height: 100%; border-radius: 999px; }
.mr-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #8c847a;
}
.mr-meta strong {
  font-size: 15px;
  color: #29241f;
}

/* 最近对局表 */
.rec-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.rt-card {
  background: linear-gradient(180deg, #fdf8ef, #faf2e7);
  border: 1px solid #e5dbc9;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rt-card-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed #e5dbc9; padding-bottom: 10px; }
.rtc-mode { font-size: 16px; font-weight: 700; color: #29241f; }
.rtc-result { font-size: 15px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.rtc-result.win { background: #feebe8; color: var(--red); }
.rtc-result.lose { background: #f0ede8; color: #736b61; }
.rt-card-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
.rtc-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.rtc-item-date { align-items: flex-end; text-align: right; }
.rtc-lbl { font-size: 13px; color: #8c847a; }
.rtc-val { font-size: 15px; font-weight: 500; color: #29241f; }
.rtc-date { color: #736b61; font-weight: 400; font-size: 14px; }
.history-empty {
  min-height: 140px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px dashed #d8ccb8;
  border-radius: 14px;
  background: rgba(255, 250, 243, .58);
}
.history-empty strong {
  font-size: 18px;
  color: #4f463d;
}
.history-empty span {
  color: #8c847a;
}

/* 段位横幅 */
.rank-banner {
  display: flex; align-items: center; gap: 26px;
  border: 1px solid #d1c2a8; border-radius: 16px;
  padding: 26px 30px;
  background: linear-gradient(165deg, #fcf7ed, #f5e9d9 74%);
}
.rb-seal-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rb-seal { width: 88px; height: 88px; border-radius: 999px; background: var(--red); border: 2px solid #d1a852; color: #fffaf0; font-family: var(--serif); font-weight: 900; font-size: 40px; display: grid; place-items: center; }
.rb-rankname { font-family: var(--serif); font-weight: 700; font-size: 19px; color: #29241f; }
.rb-body { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.rb-top { display: flex; align-items: center; justify-content: space-between; }
.rb-top b { font-size: 17px; color: #29241f; }
.rb-top span { font-size: 16px; font-weight: 500; color: #736b61; }
.rb-track { height: 14px; border-radius: 999px; background: #e5dbc9; overflow: hidden; }
.rb-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #db8c4d, #cc472e); }
.rb-exp { font-size: 16px; color: #736b61; }

/* 段位阶梯滚动外壳 */
.rank-ladder-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.rank-ladder-scroll::-webkit-scrollbar { display: none; }

/* 段位阶梯 */
.rank-ladder { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.ladder-step { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ls-circle { width: 46px; height: 46px; border-radius: 999px; font-family: var(--serif); font-weight: 700; font-size: 16px; display: grid; place-items: center; }
.ladder-step.done .ls-circle { background: #ede0c7; color: #8c734d; }
.ladder-step.cur .ls-circle { background: var(--red); border: 2px solid #d1a852; color: #fffaf0; font-size: 16px; }
.ladder-step.lock .ls-circle { background: #f0ede8; border: 1px solid #d9d4cc; color: #a69e94; }
.ls-lbl { font-size: 16px; font-weight: 500; color: #736b61; }
.ladder-step.cur .ls-lbl { color: var(--red); }

/* 成长页双栏：默认单列（移动端优先），PC 端由后面媒体查询覆盖 */
.growth-cols { display: flex; flex-direction: column; gap: 16px; }
.growth-col-a { min-width: 0; }
.growth-col-b { width: 100%; }

/* 成就徽章 */
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 0; border-radius: 12px; border: 1px solid #d1c2a8; background: #f6f1e7; }
.badge.lock { background: #f5f2f0; border-color: #dbd6cf; }
.badge-circle { width: 52px; height: 52px; border-radius: 999px; font-family: var(--serif); font-weight: 900; font-size: 24px; display: grid; place-items: center; }
.badge.ok .badge-circle { background: var(--red); border: 1.5px solid #d1a852; color: #fffaf0; }
.badge.half .badge-circle { background: #d1a852; color: #fffaf0; }
.badge.lock .badge-circle { background: #e0ded9; color: #99948c; font-size: 20px; }
.badge-name { font-size: 16px; font-weight: 700; color: #29241f; }
.badge.lock .badge-name { color: #99948c; }
.badge-status { font-size: 16px; font-weight: 500; color: var(--red); }
.badge.half .badge-status { color: #cc8033; }
.badge.lock .badge-status { color: #a6a199; }

/* 主题掌握度 */
.theme-bars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 28px; }
.tbar { display: flex; align-items: center; gap: 12px; }
.tbar-lbl { width: 36px; font-size: 16px; color: #29241f; }
.tbar-track { flex: 1; height: 8px; border-radius: 999px; background: #e5dbc9; overflow: hidden; }
.tbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #db8c4d, #c0392b); }
.tbar-pct { width: 40px; text-align: right; font-size: 16px; color: #736b61; }

/* 错题本 */
.wrong-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wrong-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #e5dbc9; }
.wrong-list li:first-child { border-top: 0; }
.ww { font-family: var(--serif); font-weight: 700; font-size: 16px; color: #29241f; min-width: 80px; }
.we { flex: 1; font-size: 16px; color: #736b61; }
.wrev { font-size: 16px; color: var(--red); cursor: pointer; }
.wrev:hover { text-decoration: underline; }

/* 称号收集 */
.titles { display: flex; flex-wrap: wrap; gap: 10px; }
.title-pill { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 999px; font-size: 16px; font-weight: 700; }
.title-pill.ok { background: #f7eddb; border: 1px solid rgba(209, 168, 82, .6); color: #8c6626; }
.title-pill.lock { background: #f5f2f0; border: 1px solid #d9d4cc; color: #999187; font-weight: 500; }

.empty-tip { font-size: 16px; color: var(--ink5); padding: 16px 0; text-align: center; list-style: none; }

/* 隐私政策 */
.privacy-card {
  background: var(--panel2);
  border: 1px solid #d1c2a8;
  border-radius: 14px;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #474038;
  font-size: 16px;
  line-height: 1.75;
}
.privacy-card h3 {
  margin: 16px 0 8px;
  font-family: var(--serif);
  font-size: 18px;
  color: #29241f;
}
.privacy-card h3:first-of-type {
  margin-top: 8px;
}
.privacy-card ul {
  margin: 0;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.privacy-card p {
  margin: 0;
}
.privacy-card .muted {
  color: #8c857a;
  font-size: 16px;
  margin-bottom: 8px;
}
.privacy-card em {
  font-style: normal;
  color: var(--red);
  font-weight: 700;
}
.sub-foot {
  text-align: center;
  font-size: 16px;
  color: #8c857a;
  margin-top: 10px;
}

/* ============================================================
   PC 端子页覆盖（在全局子页样式之后确保级联正确）
   ============================================================ */
@media (min-width: 768px) {
  /* 通用子页 */
  .sub-wrap { padding: 24px 40px 56px; gap: 20px; }
  .panel { padding: 22px 24px; }

  /* 战绩页 */
  .stat-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
  .stat-card { min-height: 136px; padding: 18px 18px 16px; gap: 18px; }
  .sc-num { font-size: 34px; }
  .history-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .9fr); gap: 20px; }
  .trend-chart { gap: 18px; justify-content: center; }
  .tc-bar-wrap { height: 150px; max-width: 36px; }
  .tc-bar { width: 30px; }
  .rec-table { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

  /* 成长页 */
  .badges { grid-template-columns: repeat(4, 1fr); }
  .badge { padding: 18px 0; gap: 8px; }
  .badge-circle { width: 52px; height: 52px; font-size: 24px; }
  .badge-name { font-size: 16px; }
  .badge-status { font-size: 16px; }
  /* growth-cols 等分双栏，左列 theme-bars 3 列，右列 titles 充分换行 */
  .growth-cols { flex-direction: row; gap: 20px; align-items: flex-start; }
  .growth-col-a { flex: 1; min-width: 0; }
  .growth-col-b { flex: 1; width: auto; min-width: 0; }
  .theme-bars { grid-template-columns: repeat(3, 1fr); gap: 8px 20px; }
}

/* ============================================================
   移动端子页覆盖（在全局子页样式之后，纠正级联优先级）
   ============================================================ */
@media (max-width: 767px) {
  /* 通用子页 */
  .sub-wrap { padding: 12px 12px 52px; gap: 14px; }
  .panel { padding: 14px 12px; }
  .panel-row { flex-direction: column; gap: 12px; }

  /* 战绩页 */
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { min-height: 96px; padding: 12px 10px; gap: 10px; }
  .stat-card.is-primary { grid-column: span 2; }
  .sc-num { font-size: 26px; }
  .sc-lbl { font-size: 13px; }
  .stat-note { font-size: 11px; }
  .sc-unit { font-size: 13px; }
  .history-grid { grid-template-columns: 1fr; gap: 12px; }
  .trend-chart { gap: 6px; justify-content: space-between; }
  .tc-bar-wrap { height: 100px; max-width: 100%; }
  .tc-bar { width: 100%; max-width: 20px; }
  .tc-count { font-size: 11px; }
  .tc-lbl { font-size: 11px; }
  .rec-table { grid-template-columns: 1fr; gap: 10px; }
  .rt-card { padding: 12px 10px; }

  /* 成长页 */
  .badges { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .badge { padding: 14px 6px; gap: 6px; }
  .badge-circle { width: 44px; height: 44px; font-size: 20px; }
  .badge-name { font-size: 13px; text-align: center; line-height: 1.3; }
  .badge-status { font-size: 12px; }
  .theme-bars { grid-template-columns: 1fr; }
  .rank-banner { padding: 16px; }
  .rb-seal { width: 72px; height: 72px; font-size: 32px; }
  .rb-track { height: 10px; }

  /* 弹窗移动端适配 */
  .result-card, .idiom-modal, .confirm-card {
    padding: 24px 20px;
    gap: 16px;
    border-radius: 18px;
  }
  .res-seal { width: 72px; height: 72px; font-size: 36px; }
  .res-title { font-size: 26px; }
  .res-stats { padding: 14px 4px; gap: 2px; }
  .rs-num { font-size: 22px; }
  .rs-lbl { font-size: 12px; white-space: nowrap; transform: scale(0.95); }
  .res-best { font-size: 13px; padding: 8px 12px; line-height: 1.5; }
  
  .res-actions { flex-wrap: wrap; gap: 10px; }
  .res-actions .btn-primary { flex: 0 0 100%; padding: 12px; font-size: 16px; }
  .res-btn-line { flex: 1; padding: 12px 0; text-align: center; font-size: 15px; display: flex; justify-content: center; }
  
  .sc-word { font-size: 26px; }
  .im-head { gap: 8px; }
  .im-close { width: 30px; height: 30px; font-size: 14px; }
  .im-actions { gap: 10px; }
  .im-join { padding: 12px; font-size: 15px; }
  .im-fav { padding: 12px 0; font-size: 15px; flex: 1; text-align: center; display: flex; justify-content: center; }
  .im-chip { padding: 6px 12px; font-size: 14px; }
}

