/* ===== 中秋寄相思 · 设计系统基础 ===== */
:root {
  --bg: #f7f3ec;            /* 月白偏暖底 */
  --surface: #fffdf8;       /* 卡片面 */
  --surface-2: #f1eadd;     /* 次级面 */
  --ink: #33302a;           /* 主文字 */
  --ink-2: #6f6759;         /* 次级文字 */
  --ink-3: #a39a89;         /* 弱文字 */
  --line: #e7dfd0;          /* 分隔线 */
  --gold: #c08a2d;          /* 金桂 */
  --gold-deep: #9c6d1c;
  --gold-soft: #f5e8cd;     /* 金桂浅底 */
  --danger: #b3462e;
  --danger-soft: #f9e9e4;
  --ok: #3d7a4f;
  --ok-soft: #e4f0e7;

  /* 投票等级色（配文字与勾选标识，不单靠颜色） */
  --lv1: #bc4a2f;  --lv1-soft: #fae9e3;  --lv1-deep: #96351f;
  --lv2: #a97b16;  --lv2-soft: #f7edd2;  --lv2-deep: #7d5a0d;
  --lv3: #2f6f6a;  --lv3-soft: #e2efee;  --lv3-deep: #1f504c;

  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(60, 48, 24, 0.06), 0 6px 20px rgba(60, 48, 24, 0.07);
  --shadow-lg: 0 8px 40px rgba(50, 38, 16, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -8%, rgba(232, 196, 124, 0.18), transparent 60%),
    radial-gradient(900px 420px at -10% 8%, rgba(192, 138, 45, 0.08), transparent 55%),
    var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden; /* 手机端禁止横向滚动，宫格自适应宽度 */
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.3; }
p { margin: 0; }
a { color: var(--gold-deep); text-decoration: none; }
button { font-family: inherit; }
img { display: block; }

/* ---- 通用组件 ---- */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  border-radius: var(--radius-s);
  padding: 10px 18px; font-size: 15px; font-weight: 600;
  background: var(--surface-2); color: var(--ink);
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease, opacity .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #d9a441, var(--gold));
  color: #fff; box-shadow: 0 4px 14px rgba(192, 138, 45, 0.35);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(192, 138, 45, 0.45); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.btn-danger-ghost { background: transparent; border-color: #e5c4ba; color: var(--danger); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: 13.5px; border-radius: 9px; }
.btn-block { width: 100%; }

.input, select.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink);
  padding: 11px 13px; font-size: 15px; font-family: inherit; min-height: 46px;
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(192, 138, 45, 0.15); }
.input::placeholder { color: var(--ink-3); }
.field-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px 2px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---- 徽标 / 状态 ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; border-radius: 999px;
  padding: 3px 10px; background: var(--surface-2); color: var(--ink-2);
  white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--gold-soft); color: var(--gold-deep); }
.badge-muted { background: var(--surface-2); color: var(--ink-3); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* ---- Toast ---- */
.toast-wrap {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(92vw, 480px);
}
.toast {
  background: rgba(40, 35, 26, 0.92); color: #fdf9ef;
  padding: 11px 18px; border-radius: 12px; font-size: 14.5px; font-weight: 500;
  box-shadow: var(--shadow-lg); max-width: 100%;
  animation: toast-in .22s ease;
  text-align: center;
}
.toast-ok { background: rgba(45, 90, 58, 0.94); }
.toast-err { background: rgba(146, 55, 34, 0.95); }
.toast.hide { opacity: 0; transition: opacity .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }

/* ---- 加载 ---- */
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: spin .7s linear infinite; display: inline-block;
}
.spinner-dark { border-color: rgba(0,0,0,0.15); border-top-color: var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-block, .empty-block {
  padding: 60px 20px; text-align: center; color: var(--ink-3); font-size: 15px;
}
.empty-block .empty-icon { font-size: 40px; margin-bottom: 10px; }

.skeleton-thumb {
  background: linear-gradient(100deg, var(--surface-2) 30%, #faf6ec 50%, var(--surface-2) 70%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 0;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- 登录视图 ---- */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-card { width: min(400px, 100%); padding: 34px 28px 28px; }
.auth-moon { text-align: center; font-size: 44px; line-height: 1; margin-bottom: 6px; }
.auth-title { text-align: center; font-size: 24px; letter-spacing: 2px; }
.auth-sub { text-align: center; color: var(--ink-2); font-size: 14px; margin: 8px 0 22px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-error {
  background: var(--danger-soft); color: var(--danger);
  border-radius: var(--radius-s); padding: 9px 12px; font-size: 13.5px; display: none;
}
.auth-error.show { display: block; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
