/* ============================================================
   仪表921班 · 30周年 — 正式版主题样式
   暖色怀旧风：珊瑚橙 + 琥珀黄 + 米白 + 深棕
   手机优先（max-width 520px 居中），微信内打开即用
   ============================================================ */
:root {
  --coral: #E8632E;
  --coral-dark: #C94E1F;
  --amber: #F5A623;
  --cream: #FDF6EE;
  --paper: #FFFFFF;
  --ink: #4A3426;
  --ink-soft: #8A7361;
  --line: #F0E4D6;
  --green: #2E9E6B;
  --gold: #D9A441;
  --shadow: 0 4px 16px rgba(74, 52, 38, 0.10);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  background: #F3E9DC;
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.55;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; font-size: 16px; }

/* ---------- 通用 ---------- */
.app { max-width: 520px; margin: 0 auto; padding-bottom: 76px; position: relative; }
.hidden, [hidden] { display: none !important; }
.btn-primary {
  display: inline-block; background: linear-gradient(135deg, var(--coral), #F07C3F);
  color: #fff; font-size: 15px; font-weight: 600; padding: 11px 22px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(232, 99, 46, 0.35); transition: transform .15s;
}
.btn-primary:active { transform: scale(0.96); }
.btn-ghost {
  display: inline-block; background: #fff; color: var(--coral); font-size: 14px; font-weight: 600;
  padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--coral);
}
.card {
  background: var(--paper); border-radius: 16px; padding: 16px; margin: 12px 16px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; color: var(--ink); }
.card-title::before { content: ""; display: inline-block; width: 4px; height: 14px; background: var(--coral); border-radius: 2px; margin-right: 7px; vertical-align: -2px; }

/* ---------- 认证页 ---------- */
.auth-page {
  max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #FDF0E2 0%, #FBE3C8 60%, #F6D3AE 100%);
  padding: 24px;
}
.auth-card {
  background: rgba(255,255,255,0.92); border-radius: 24px; padding: 32px 26px; width: 100%;
  box-shadow: 0 12px 40px rgba(201, 78, 31, 0.18); text-align: center;
}
.auth-logo { font-size: 46px; margin-bottom: 8px; }
.auth-card h1 { font-size: 21px; color: var(--ink); letter-spacing: 1px; }
.auth-card .auth-sub { font-size: 13px; color: var(--ink-soft); margin: 4px 0 20px; }
.auth-tabs { display: flex; background: var(--cream); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; padding: 8px; border-radius: 999px; font-size: 14px; color: var(--ink-soft); }
.auth-tabs button.on { background: var(--coral); color: #fff; font-weight: 600; }
.auth-card input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #FFFDF9; margin-bottom: 12px; text-align: center; color: var(--ink);
}
.auth-card input:focus { outline: none; border-color: var(--coral); }
.auth-hint { font-size: 12.5px; color: var(--ink-soft); min-height: 34px; margin-bottom: 6px; }
.auth-hint.err { color: var(--coral-dark); }
.auth-card .btn-primary { width: 100%; padding: 13px; font-size: 16px; }

/* ---------- 顶栏 ---------- */
.app-header {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  background: rgba(253, 246, 238, 0.94); backdrop-filter: blur(8px);
  padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.brand { font-size: 15px; font-weight: 700; letter-spacing: 0.5px; }
.clap-badge {
  display: flex; align-items: center; gap: 5px; background: #fff; border: 1.5px solid var(--amber);
  border-radius: 999px; padding: 4px 12px; font-weight: 700; color: var(--coral-dark); font-size: 14px;
}

/* ---------- 首页 Hero ---------- */
.hero {
  background: linear-gradient(150deg, #F6B26B 0%, var(--coral) 55%, var(--coral-dark) 100%);
  color: #fff; text-align: center; padding: 34px 20px 30px; margin: 12px 16px; border-radius: 20px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after {
  content: "30"; position: absolute; right: -14px; bottom: -34px; font-size: 130px; font-weight: 800;
  color: rgba(255,255,255,0.10); line-height: 1;
}
.hero-title { font-size: 26px; font-weight: 800; letter-spacing: 2px; position: relative; z-index: 1; }
.hero-dates { font-size: 14px; opacity: 0.95; margin-top: 4px; position: relative; z-index: 1; }
.countdown {
  display: flex; justify-content: center; gap: 8px; margin: 18px 0 16px; position: relative; z-index: 1;
}
.countdown .cd-item { background: rgba(255,255,255,0.16); border-radius: 12px; padding: 8px 12px; min-width: 64px; }
.countdown .cd-num { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.countdown .cd-label { font-size: 11px; opacity: 0.85; }

/* ---------- 寻宝横幅 ---------- */
.treasure-banner {
  display: flex; align-items: center; gap: 12px; margin: 12px 16px; padding: 14px 16px;
  background: linear-gradient(120deg, #2C5F8A, #3E7CB1); color: #fff; border-radius: 16px;
  box-shadow: var(--shadow); cursor: pointer;
}
.treasure-banner .tb-icon { font-size: 30px; }
.treasure-banner .tb-title { font-size: 15px; font-weight: 700; }
.treasure-banner .tb-sub { font-size: 12px; opacity: 0.85; }

/* ---------- 温度计 ---------- */
.thermometer-card { text-align: center; }
.temp-level { font-size: 20px; font-weight: 800; color: var(--coral-dark); margin-bottom: 12px; }
.temp-bar {
  height: 22px; background: var(--cream); border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line); position: relative;
}
.temp-fill {
  height: 100%; border-radius: 999px; transition: width 0.8s cubic-bezier(.2,.8,.2,1);
  background: linear-gradient(90deg, var(--amber), var(--coral), #E0402A);
  min-width: 6px;
}
.temp-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; }
.temp-meta b { color: var(--coral-dark); font-size: 15px; }

/* ---------- 我的掌声卡 ---------- */
.my-card { display: flex; align-items: center; justify-content: space-between; }
.my-card .mc-left b { font-size: 26px; color: var(--coral-dark); }
.my-card .mc-title { font-size: 13px; color: var(--ink-soft); }

/* ---------- 资讯卡 ---------- */
.info-card h4 { font-size: 14px; margin: 8px 0 4px; color: var(--coral-dark); }
.info-card p { font-size: 13px; color: var(--ink-soft); }
.info-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.info-row .btn-ghost { font-size: 13px; padding: 8px 14px; }
.schedule-day { font-size: 13px; padding: 6px 10px; background: var(--cream); border-radius: 10px; margin-top: 6px; }
.schedule-day b { color: var(--coral-dark); }

/* ---------- 动态流 ---------- */
.feed-item {
  display: flex; align-items: flex-start; gap: 9px; padding: 9px 2px; border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.feed-item:last-child { border-bottom: none; }
.feed-item .fi-name { font-weight: 700; color: var(--ink); white-space: nowrap; }
.feed-item .fi-text { color: var(--ink-soft); }
.feed-item .fi-time { margin-left: auto; font-size: 11px; color: #C4B3A2; white-space: nowrap; }
.feed-item.secret { background: linear-gradient(90deg, #FFF3D6, transparent); border-radius: 8px; padding: 8px 10px; }
.feed-item.secret .fi-text { color: #B0781F; font-weight: 600; }
.feed-empty { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 18px 0; }

/* ---------- 时光馆 ---------- */
.gallery-head { display: flex; align-items: center; gap: 10px; margin: 14px 16px 4px; }
.gallery-limit { font-size: 12px; color: var(--ink-soft); }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 8px 16px 20px; }
.photo-card {
  background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
  position: relative; break-inside: avoid;
}
.photo-card img { width: 100%; display: block; aspect-ratio: 1/1; object-fit: cover; background: var(--cream); }
.photo-info { padding: 8px 10px; }
.photo-cap { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-actions { display: flex; align-items: center; gap: 12px; }
.photo-actions button { font-size: 12.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 3px; }
.photo-actions button.on { color: var(--coral); font-weight: 700; }
.photo-owner { position: absolute; top: 8px; left: 8px; background: rgba(74,52,38,0.65); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 999px; backdrop-filter: blur(2px); }
.placeholder-photo {
  width: 100%; aspect-ratio: 1/1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #F2D9B3, #E7C08E); color: #A97C45; gap: 6px; font-size: 13px; font-weight: 600;
}
.placeholder-photo .ph-icon { font-size: 30px; }
.upload-empty { text-align: center; color: var(--ink-soft); padding: 40px 0; font-size: 13px; }

/* ---------- 游戏 ---------- */
.game-card { text-align: center; }
.game-card .gc-title { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.game-card .gc-desc { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.quiz-options { display: grid; gap: 8px; margin-top: 12px; }
.quiz-options button {
  padding: 11px; border-radius: 12px; border: 1.5px solid var(--line); background: #FFFDF9;
  font-size: 15px; color: var(--ink); transition: all .15s;
}
.quiz-options button:active { transform: scale(0.98); }
.quiz-options button.correct { background: var(--green); color: #fff; border-color: var(--green); }
.quiz-options button.wrong { background: #F8D7D0; color: var(--coral-dark); border-color: #E8B4A6; }
.quiz-clue { font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; font-style: italic; }
.game-result { font-size: 15px; font-weight: 700; color: var(--green); margin-top: 10px; }
.puzzle-board {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; aspect-ratio: 1/1;
  background: var(--cream); border-radius: 12px; padding: 4px; margin-top: 12px; position: relative; overflow: hidden;
}
.puzzle-board .pz-empty { background: var(--line); border-radius: 8px; }
.puzzle-board .pz-tile { border-radius: 8px; overflow: hidden; cursor: pointer; position: relative; }
.puzzle-board .pz-tile img { width: 100%; height: 100%; display: block; }
.puzzle-board .pz-tile:active { transform: scale(0.96); }

/* ---------- 寻宝 ---------- */
.treasure-head { margin: 14px 16px 4px; }
.treasure-progress { display: flex; align-items: center; gap: 10px; }
.treasure-progress .tp-bar { flex: 1; height: 12px; background: var(--cream); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.treasure-progress .tp-fill { height: 100%; background: linear-gradient(90deg, #3E7CB1, #2C5F8A); border-radius: 999px; transition: width .5s; }
.treasure-progress .tp-text { font-size: 13px; font-weight: 700; color: #2C5F8A; white-space: nowrap; }
.spot-card {
  background: #fff; border-radius: 16px; padding: 14px 16px; margin: 10px 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px; cursor: pointer; border-left: 4px solid var(--amber);
}
.spot-card.done { border-left-color: var(--green); opacity: 0.75; }
.spot-card.hidden-spot { border-left-color: #8A7361; background: #FAF4EC; }
.spot-card.locked { cursor: default; opacity: 0.75; }
.spot-num { font-size: 18px; font-weight: 800; color: var(--coral-dark); width: 30px; text-align: center; }
.spot-card.done .spot-num { color: var(--green); }
.spot-name { font-size: 15.5px; font-weight: 700; }
.spot-area { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.spot-why { font-size: 12px; color: #B0781F; margin-top: 2px; }
.spot-state { margin-left: auto; font-size: 12px; font-weight: 700; white-space: nowrap; }
.spot-state.done { color: var(--green); }
.spot-state.locked { color: var(--ink-soft); }
.spot-state.ready { color: var(--coral); }
.spot-lock-icon { margin-left: auto; font-size: 18px; }
.secret-hints { margin: 14px 16px; }
.secret-hint {
  background: linear-gradient(120deg, #FFF3D6, #FFE9B8); border: 1px dashed #D9A441; border-radius: 14px;
  padding: 14px; margin-top: 10px; font-size: 13.5px; color: #8A6D1F; line-height: 1.7;
}
.secret-hint .sh-label { font-weight: 800; display: block; margin-bottom: 4px; }

/* ---------- 我的 ---------- */
.me-head {
  display: flex; align-items: center; gap: 14px; margin: 16px 16px 4px; padding: 18px 16px;
  background: linear-gradient(135deg, var(--amber), var(--coral)); border-radius: 20px; color: #fff; box-shadow: var(--shadow);
}
.avatar {
  width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,0.22); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800;
  border: 2px solid rgba(255,255,255,0.6);
}
.me-name { font-size: 19px; font-weight: 800; }
.me-title { font-size: 13px; opacity: 0.92; margin-top: 2px; }
.me-admin-tag { font-size: 11px; background: rgba(255,255,255,0.25); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.me-points-card { text-align: center; }
.me-points-card .mp-num { font-size: 32px; font-weight: 800; color: var(--coral-dark); }
.me-points-card .mp-bar { height: 14px; background: var(--cream); border-radius: 999px; overflow: hidden; margin: 10px 0 6px; border: 1px solid var(--line); }
.me-points-card .mp-fill { height: 100%; background: linear-gradient(90deg, var(--amber), var(--coral)); border-radius: 999px; }
.me-points-card .mp-meta { font-size: 12.5px; color: var(--ink-soft); }
.me-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.me-row:last-child { border-bottom: none; }
.me-row .mr-title { font-size: 14.5px; font-weight: 600; }
.me-row .mr-sub { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.me-row .mr-right { font-size: 13px; color: var(--ink-soft); }
.task-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 13.5px; }
.task-item .tk-state { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-soft); flex-shrink: 0; }
.task-item .tk-state.done { background: var(--green); border-color: var(--green); color: #fff; }
.task-item .tk-label { flex: 1; }
.task-item .tk-claim { font-size: 12px; color: var(--coral); font-weight: 700; white-space: nowrap; }
.task-item .tk-claimed { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.rank-row .rk-num { width: 22px; text-align: center; font-weight: 800; color: var(--ink-soft); }
.rank-row .rk-num.top { color: var(--gold); }
.rank-row .rk-name { font-weight: 600; }
.rank-row .rk-me { font-size: 11px; background: var(--cream); color: var(--coral-dark); padding: 1px 7px; border-radius: 999px; }
.rank-row .rk-points { margin-left: auto; font-weight: 700; color: var(--coral-dark); }
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 6px 0 10px; }
.memory-cell { text-align: center; }
.memory-cell .mc-avatar { width: 46px; height: 46px; margin: 0 auto 5px; border-radius: 50%; background: linear-gradient(135deg, var(--amber), var(--coral)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.memory-cell .mc-name { font-size: 11.5px; color: var(--ink-soft); }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  display: flex; z-index: 100; padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; padding: 8px 0 9px; text-align: center; font-size: 11px; color: var(--ink-soft); }
.tab .tab-icon { display: block; font-size: 20px; margin-bottom: 1px; }
.tab.on { color: var(--coral); font-weight: 700; }
.page { display: none; padding-top: 6px; }
.page.on { display: block; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(74,52,38,0.45); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s;
}
.modal-sheet {
  width: 100%; max-width: 520px; background: var(--paper); border-radius: 22px 22px 0 0;
  padding: 22px 20px 30px; max-height: 86vh; overflow-y: auto; animation: slideUp .25s;
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } }
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 14px; text-align: center; }
.modal-close { position: absolute; top: 12px; right: 16px; font-size: 22px; color: var(--ink-soft); }
.modal-body input, .modal-body textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #FFFDF9; margin: 8px 0; color: var(--ink);
}
.modal-body input:focus, .modal-body textarea:focus { outline: none; border-color: var(--coral); }
.modal-body textarea { min-height: 80px; resize: none; }
.modal-body .btn-primary { width: 100%; padding: 12px; margin-top: 8px; }
.answer-options { display: grid; gap: 8px; margin-top: 10px; }
.answer-options button {
  padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #FFFDF9; font-size: 15px; text-align: left;
}
.answer-options button:active { border-color: var(--coral); }
.answer-options button.correct { background: var(--green); color: #fff; border-color: var(--green); }
.answer-options button.wrong { background: #F8D7D0; color: var(--coral-dark); border-color: #E8B4A6; }
.answer-input { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #FFFDF9; font-size: 16px; margin-top: 10px; }
.comment-item { padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.comment-item:last-child { border-bottom: none; }
.comment-item .cm-name { font-weight: 700; color: var(--coral-dark); margin-right: 6px; }
.comment-item .cm-time { font-size: 11px; color: #C4B3A2; margin-left: 6px; }

/* ---------- Toast & 庆祝 ---------- */
.toast {
  position: fixed; top: 18%; left: 50%; transform: translateX(-50%); z-index: 300;
  background: rgba(74,52,38,0.92); color: #fff; padding: 10px 22px; border-radius: 999px;
  font-size: 14px; max-width: 84vw; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  animation: fadeIn .2s;
}
.celebrate {
  position: fixed; inset: 0; z-index: 260; display: flex; align-items: center; justify-content: center;
  background: rgba(74,52,38,0.72); padding: 24px;
}
.celebrate-card {
  background: #fff; border-radius: 24px; padding: 30px 24px; max-width: 420px; width: 100%; text-align: center;
  animation: popIn .35s cubic-bezier(.2,1.4,.4,1);
}
@keyframes popIn { from { transform: scale(0.7); opacity: 0; } }
.celebrate-card .ce-icon { font-size: 56px; margin-bottom: 8px; }
.celebrate-card .ce-title { font-size: 22px; font-weight: 800; color: var(--coral-dark); margin-bottom: 8px; }
.celebrate-card .ce-text { font-size: 14px; color: var(--ink-soft); line-height: 1.8; }
.celebrate-card .ce-text.speech { font-size: 15px; color: var(--ink); font-weight: 600; line-height: 2; }
.celebrate-card .btn-primary { margin-top: 18px; width: 100%; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 270; }

/* ---------- 足迹分享卡 ---------- */
.share-card-canvas { width: 100%; border-radius: 14px; border: 1px solid var(--line); }
.share-tip { font-size: 12px; color: var(--ink-soft); text-align: center; margin-top: 8px; }

/* ---------- 管理入口按钮 ---------- */
.admin-entry { text-align: center; padding: 16px; }
.logout-btn { width: calc(100% - 32px); margin: 10px 16px 20px; padding: 12px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink-soft); font-size: 14px; background: #fff; }
.loading { text-align: center; color: var(--ink-soft); padding: 26px 0; font-size: 13px; }
