:root {
  --bg: #f6f2ea;
  --surface: #fffdf8;
  --surface-2: #fbf6ee;
  --ink: #2a221d;
  --ink-2: #4d423a;
  --muted: #83776b;
  --accent: #9c2b25;
  --accent-2: #c04233;
  --accent-soft: #f3e3dd;
  --gold: #a9762a;
  --gold-soft: #f7eeda;
  --line: #e7ddcf;
  --green: #2f6b4f;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px -12px rgba(60, 40, 20, .18);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(196, 152, 90, .08), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(156, 43, 37, .06), transparent 38%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

h1, h2, h3, h4 {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  letter-spacing: .01em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 242, 234, .88);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  display: flex; align-items: center; gap: 18px;
  height: 58px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-family: "Songti SC", serif; font-size: 14px; font-weight: 700;
}
.brand span.name { font-family: "Songti SC", serif; font-size: 16px; letter-spacing: .02em; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--ink-2); padding: 6px 11px; border-radius: 999px;
  font-size: 14px; white-space: nowrap;
}
.nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.nav a.active { background: var(--accent); color: #fff; }

/* ---------- hero ---------- */
.hero { padding: 46px 0 30px; }
.hero .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: .16em; color: var(--gold);
  text-transform: uppercase; margin-bottom: 14px;
}
.hero .kicker::before { content: ""; width: 26px; height: 1px; background: var(--gold); display: block; }
.hero h1 { font-size: clamp(26px, 5vw, 42px); letter-spacing: .02em; }
.hero .lead { color: var(--muted); max-width: 620px; margin-top: 14px; font-size: 15.5px; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-notice { margin: 16px 0 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 600;
  cursor: pointer; transition: .18s ease; font-family: inherit;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-ghost { background: transparent; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 34px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .num { font-family: "Songti SC", serif; font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.stat .lbl { font-size: 12.5px; color: var(--muted); letter-spacing: .06em; }

.entry {
  display: block; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); transition: .2s ease; color: inherit;
}
.entry:hover { transform: translateY(-3px); text-decoration: none; border-color: #d8c8b4; }
.entry .ico { font-size: 22px; margin-bottom: 10px; }
.entry h3 { font-size: 17px; margin-bottom: 6px; }
.entry p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.entry-go { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--accent); font-weight: 600; }
.entry:hover .entry-go { text-decoration: underline; }
.entry:active { transform: translateY(-1px); }

/* ---------- section title ---------- */
.sec-head { display: flex; align-items: baseline; gap: 12px; margin: 40px 0 16px; }
.sec-head h2 { font-size: 20px; }
.sec-head .sub { color: var(--muted); font-size: 13px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(156, 43, 37, .16);
}
.badge.gold { background: var(--gold-soft); color: var(--gold); border-color: rgba(169, 118, 42, .2); }
.badge.green { background: #e4efe8; color: var(--green); border-color: rgba(47, 107, 79, .18); }
.badge.gray { background: #eee9e1; color: var(--muted); border-color: var(--line); }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 14.5px; font-family: inherit; color: var(--ink);
  transition: .15s ease; outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(156, 43, 37, .1);
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.7; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.counter { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }
.counter.warn { color: var(--accent); }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }

/* ---------- uploader ---------- */
.uploader {
  border: 1.5px dashed #d8c8b4; border-radius: 12px; padding: 26px 18px;
  text-align: center; cursor: pointer; background: var(--surface-2);
  transition: .18s ease;
}
.uploader:hover, .uploader.drag { border-color: var(--accent); background: #fdf1ed; }
.uploader .big { font-size: 26px; margin-bottom: 6px; }
.uploader .t { font-weight: 600; font-size: 14px; }
.uploader .s { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 14px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #eee; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .del {
  position: absolute; top: 5px; right: 5px; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; border: 0;
  cursor: pointer; font-size: 13px; line-height: 1; display: grid; place-items: center;
}

/* ---------- gallery ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 13.5px; font-family: inherit;
  color: var(--ink-2); transition: .15s ease;
}
.chip:hover { border-color: #d8c8b4; }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.dorm-card {
  display: block; color: inherit; overflow: hidden; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: .2s ease;
}
.dorm-card:hover { transform: translateY(-3px); text-decoration: none; }
.dorm-card .cover { aspect-ratio: 12 / 17; background: linear-gradient(135deg, #efe6d8, #e4d6c2); overflow: hidden; }
.dorm-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dorm-card .body { padding: 14px 16px 16px; }
.dorm-card .top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dorm-card .room { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.dorm-card h3 { font-size: 16px; margin-bottom: 6px; }
.dorm-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dorm-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- detail ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.viewer { border-radius: var(--radius); overflow: hidden; background: #efe6d8; border: 1px solid var(--line); aspect-ratio: 12 / 17; }
.viewer img { width: 100%; max-width: 100%; height: 100%; object-fit: contain; display: block; background: #2a221d; }
.viewer-strip { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.viewer-strip img { width: 66px; height: 66px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; flex: none; }
.viewer-strip img.active { border-color: var(--accent); }

.vote-box { text-align: center; padding: 24px 20px; }
.vote-box .big { font-family: "Songti SC", serif; font-size: 38px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.vote-box .lbl { font-size: 12.5px; color: var(--muted); letter-spacing: .08em; }
.vote-box .rules { font-size: 12.5px; color: var(--muted); margin-top: 14px; line-height: 1.6; text-align: left; }

.rubric-list { list-style: none; padding: 0; margin: 0; }
.rubric-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.rubric-list li:last-child { border-bottom: 0; }
.rubric-list .k { color: var(--ink-2); font-weight: 600; }
.rubric-list .max { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ---------- rank ---------- */
.rank-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rank-table th {
  text-align: left; font-size: 12px; letter-spacing: .1em; color: var(--muted);
  font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line);
  text-transform: uppercase; white-space: nowrap;
}
.rank-table td { padding: 13px 12px; border-bottom: 1px solid #f0e9df; }
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table .r1 { background: linear-gradient(90deg, rgba(169, 118, 42, .09), transparent); }
.rank-table .r2 { background: linear-gradient(90deg, rgba(120, 120, 130, .07), transparent); }
.rank-table .r3 { background: linear-gradient(90deg, rgba(150, 90, 50, .06), transparent); }
.rank-no { font-family: "Songti SC", serif; font-weight: 700; font-size: 16px; color: var(--muted); }
.rank-no.top { color: var(--accent); }

.bar { height: 6px; border-radius: 3px; background: #eee6d9; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* ---------- admin ---------- */
.admin-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 16px;
  font-size: 14px; font-family: inherit; color: var(--muted); cursor: pointer;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.admin-row {
  display: grid; grid-template-columns: 68px 1fr auto; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid #f0e9df; align-items: start;
}
.admin-row .thumbs2 { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.admin-row .thumbs2 img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

.kv { font-size: 12.5px; color: var(--muted); }
.kv b { color: var(--ink-2); font-weight: 600; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #2a221d; color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  animation: pop .22s ease; max-width: 90vw; text-align: center;
}
.toast.err { background: var(--accent); }
.toast.ok { background: var(--green); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.gallery-empty { grid-column: 1 / -1; padding: 34px 16px; }
.gallery-empty p { margin: 0 0 12px; }
#sorts[hidden] { display: none; }
.rank-notice { margin: 0 0 16px; }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .6; }

.notice {
  background: var(--gold-soft); border: 1px solid rgba(169, 118, 42, .22);
  color: #7a5317; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; line-height: 1.65;
}
.notice.red { background: var(--accent-soft); border-color: rgba(156, 43, 37, .2); color: #7d221d; }

.footer { margin-top: 60px; padding: 26px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.footer .inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.skeleton { background: linear-gradient(90deg, #f0e9df 25%, #f7f1e8 50%, #f0e9df 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
  .hero { padding: 30px 0 20px; }
  .site-header .inner { height: auto; padding: 10px 0; flex-wrap: wrap; }
  .nav { margin-left: 0; width: 100%; }
  .rank-table th:nth-child(4), .rank-table td:nth-child(4) { display: none; }
}

/* ==================== 移动优先补充样式 ==================== */
.narrow { max-width: 820px; }
.req { color: var(--accent); }
.fine { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.muted { color: var(--muted); }

/* ---------- 投稿页 ---------- */
.photo-count { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.photo-count.warn { color: var(--accent); }

/* 三组照片上传 */
.up-group { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.up-head { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; margin-bottom: 10px; }
.up-head b { font-family: "Songti SC", serif; font-size: 15px; }
.up-hint { color: var(--muted); font-size: 12.5px; flex: 1; }
.up-ct { color: var(--muted); font-size: 12px; white-space: nowrap; }
.up-drop {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px;
  border: 1.5px dashed #d8c8b4; border-radius: 10px; color: var(--ink-2); font: inherit; font-size: 14px;
  cursor: pointer; background: var(--surface); transition: .15s ease;
}
.up-drop:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.up-drop:disabled { opacity: .57; cursor: default; }
.up-drop:focus-visible, .member-remove:focus-visible, .up-cell .del:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.up-drop .plus { font-size: 20px; color: #c9b79f; line-height: 1; }
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 10px; }
.up-grid:empty { display: none; }
.up-cell { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.up-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-cell .del {
  position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0, 0, 0, .62); color: #fff; border: 0; cursor: pointer; font-size: 22px; line-height: 1;
}
.up-cell .del:focus-visible { outline-offset: -3px; outline-color: #fff; }
.field-head {
  margin: 34px 0 6px; padding-top: 22px; border-top: 1px solid var(--line);
  font-family: "Songti SC", serif; font-size: 17px; font-weight: 700; color: var(--ink);
}

.story-progress { height: 6px; border-radius: 3px; background: #eee6d9; overflow: hidden; margin-top: 10px; }
.story-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c04233, #9c2b25); transition: width .2s ease; }
.story-progress.full i { background: var(--green); }

.submit-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 248, .97); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.sb-left { flex: 1; min-width: 0; }
.sb-text { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.sb-text b { color: var(--accent); }
.sb-track { height: 5px; border-radius: 3px; background: #eee6d9; overflow: hidden; }
.sb-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c04233, #9c2b25); transition: width .2s ease; }
.sb-track.done i { background: var(--green); }
.submit-bar .btn { height: 44px; padding: 0 26px; flex: none; }

@media (min-width: 761px) {
  .submit-bar { display: none !important; }
}

/* 投稿页：填表时隐藏底部标签栏，把位置让给提交条 */
@media (max-width: 760px) {
  body.page-submit.has-submit-bar .tabbar { display: none; }
  body.page-submit.has-submit-bar { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
}

.poster-box {
  border: 1px dashed #d8c8b4; border-radius: 12px; padding: 12px;
  background: var(--surface-2); text-align: center;
}
.poster-box img { width: 100%; max-width: 340px; border-radius: 10px; display: block; margin: 0 auto; border: 1px solid var(--line); }
.poster-empty { color: var(--muted); font-size: 13px; padding: 30px 10px; }

.slogan-line {
  font-size: 12.5px; color: var(--gold); margin: 2px 0 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.photo-tag {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(0, 0, 0, .45); color: #fff; font-size: 12px;
  padding: 3px 10px; border-radius: 999px;
}
.detail-slogan { font-size: 14px; color: var(--gold); margin: 6px 0 0; }

/* AI 趣味点评 */
.ai-card { background: linear-gradient(180deg, #fffdf8, #fdf7ee); }
.ai-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ai-badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ai-score { font-family: "Songti SC", serif; font-size: 30px; font-weight: 700; color: var(--accent); line-height: 1; }
.ai-title { font-family: "Songti SC", serif; font-size: 17px; font-weight: 700; }
.ai-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.ai-tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); }
.ai-comment { font-size: 13.5px; color: var(--ink-2); line-height: 1.8; margin: 0; }
.ai-note { font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.ai-more { display: inline-block; margin-top: 8px; font-size: 13px; }

.fun-row {
  display: flex; gap: 14px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid #f0e9df;
}
.fun-row:last-child { border-bottom: 0; }
.fun-no { width: 30px; text-align: center; font-family: "Songti SC", serif; font-size: 17px; font-weight: 700; color: var(--muted); }
.fun-cover { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; flex: none; border: 1px solid var(--line); }
.fun-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fun-main { flex: 1; min-width: 0; }
.fun-name { font-weight: 700; font-size: 15px; }
.fun-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fun-comment { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fun-score { font-family: "Songti SC", serif; font-size: 22px; font-weight: 700; color: var(--accent); flex: none; }
.photo-count.warn { color: var(--accent); }
.form-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 4px; }
.success-card { text-align: center; padding: 40px 26px; }
.ok-mark {
  width: 56px; height: 56px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; font-size: 26px; margin: 0 auto 16px;
}

/* ---------- 作品墙 ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .filters { margin-bottom: 0; }
.toolbar-right { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.search { width: 210px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: 18px; }
.gate-mask {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(30, 22, 16, .55); backdrop-filter: blur(3px);
}
.gate-card {
  width: 100%; max-width: 340px; background: var(--surface); border-radius: 16px;
  padding: 26px 22px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
.gate-card h3 { font-family: "Songti SC", serif; font-size: 20px; margin-bottom: 6px; }
.gate-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.gate-err { min-height: 18px; font-size: 12.5px; color: #b3261e; margin: -4px 0 8px; }
.gate-actions { display: flex; gap: 10px; margin-top: 4px; }
.gate-actions .btn { flex: 1; }

.dim-list { margin-top: 4px; }
.dim-item { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.dim-item:last-child { border-bottom: none; padding-bottom: 0; }
.dim-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.dim-head b { font-size: 15px; }
.dim-pt { font-size: 12.5px; color: var(--accent); background: rgba(156, 43, 37, .08); padding: 2px 9px; border-radius: 999px; }
.dim-item p { font-size: 13.5px; line-height: 22px; color: var(--muted); }

.dims-bands { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.dims-bands span { font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 4px 12px; }
.dims-bands b { color: var(--accent); margin-right: 4px; }

.ai-retry { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ai-retry-tip { display: block; font-size: 12px; color: var(--muted); margin-top: 8px; }

.ai-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }

.ai-dims { margin: 14px 0 6px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; }
.dim-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 12px; }
.dim-name { width: 76px; color: var(--muted); flex: none; }
.dim-bar { flex: 1; height: 5px; border-radius: 3px; background: #e7ddcf; overflow: hidden; }
.dim-bar i { display: block; height: 100%; background: linear-gradient(90deg, #c04233, #9c2b25); }
.dim-val { width: 48px; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }

.member-note { margin: 0 0 14px; color: var(--ink-2); }
.member-review { margin: 0 0 12px; }
.member-row {
  padding: 12px 14px 14px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.member-head { display: flex; justify-content: space-between; align-items: center; min-height: 27px; }
.member-title { font-size: 14px; }
.member-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.member-field { color: var(--ink-2); font-size: 13px; }
.member-field span { display: block; margin: 6px 0 3px; }
.member-field .input { width: 100%; min-width: 0; }
.member-remove {
  min-height: 44px; padding: 0 10px; border: 0; background: transparent;
  color: var(--accent); font: inherit; font-size: 13px; cursor: pointer;
}
.member-action { min-height: 44px; }
.member-action[hidden] { display: none; }

.admin-adv { margin-top: 24px; border-top: 1px dashed var(--line); padding-top: 14px; }
.admin-adv summary { cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; }
.admin-adv summary::-webkit-details-marker { display: none; }
.admin-adv summary::before { content: "▸ "; }
.admin-adv[open] summary::before { content: "▾ "; }
.adv-body { margin-top: 14px; }

.vote-adjust {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.vote-adjust .va-label { font-size: 13px; color: var(--muted); margin-right: auto; }
.vote-adjust .va-label b { color: var(--accent); font-size: 16px; margin-left: 2px; }

.voted-tag {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(47, 107, 79, .92); color: #fff;
  font-size: 11px; padding: 2px 9px; border-radius: 999px;
}
.dorm-card .cover { position: relative; }

.cover-fallback { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 12.5px; }
.votes-mini { color: var(--accent); font-weight: 600; }
.more-btn { display: block; margin: 26px auto 0; }

/* ---------- 作品详情 ---------- */
.detail-wrap { padding-top: 22px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }
.viewer { position: relative; }
.counter-badge {
  position: absolute; right: 12px; bottom: 12px; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
}
.detail-photos, .detail-side { min-width: 0; }
.detail-side { display: grid; gap: 16px; }
.detail-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.detail-title { font-size: 26px; line-height: 1.35; }
.detail-time { font-size: 12.5px; color: var(--muted); margin: 8px 0 18px; }
.story { font-size: 15.5px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.vote-num { font-family: "Songti SC", serif; font-size: 44px; font-weight: 700; color: var(--accent); line-height: 1; }
.vote-num.small { font-size: 24px; }
.vote-lbl { font-size: 12.5px; color: var(--muted); letter-spacing: .08em; margin-top: 6px; }
.vote-btn { width: 100%; margin-top: 18px; }

/* 手机端吸底操作条 */
.mobile-action {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: none;
  gap: 14px; align-items: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 248, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.mobile-action .bar-count { font-size: 13px; color: var(--muted); flex: none; }
.mobile-action .bar-count b { font-family: "Songti SC", serif; font-size: 22px; color: var(--accent); margin-right: 3px; }
.mobile-action .btn { flex: 1; }

/* ---------- 排行榜 ---------- */
.rank-card { padding: 4px 0; overflow: hidden; }
.rank-row {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid #f0e9df;
}
.rank-row:last-child { border-bottom: 0; }
.rank-row.r1 { background: linear-gradient(90deg, rgba(169, 118, 42, .1), transparent); }
.rank-row.r2 { background: linear-gradient(90deg, rgba(120, 125, 135, .08), transparent); }
.rank-row.r3 { background: linear-gradient(90deg, rgba(150, 90, 50, .07), transparent); }
.rank-no { font-family: "Songti SC", serif; font-size: 20px; font-weight: 700; color: var(--muted); text-align: center; }
.rank-no.top { color: var(--accent); }
.rank-title { font-weight: 600; font-size: 15.5px; color: var(--ink); }
.rank-title:hover { color: var(--accent); }
.rank-sub { font-size: 12.5px; color: var(--muted); margin: 2px 0 9px; }
.rank-main .bar { max-width: 320px; }
.score-line { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; white-space: nowrap; overflow: hidden; }
.fun-ai-title { font-size: 12px; color: var(--accent); margin-top: 4px; }
.score-line b { color: var(--ink-2); font-weight: 600; }
.score-line .dot { opacity: .5; }
.tier-badge {
  display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-left: 6px;
}
.rank-right { text-align: right; min-width: 58px; }
.rank-votes { font-family: "Songti SC", serif; font-size: 20px; font-weight: 700; color: var(--accent); line-height: 1; }
.rank-lbl { font-size: 11px; color: var(--muted); margin-top: 3px; }
.award { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; margin-bottom: 6px; font-weight: 600; }
.aw1 { background: var(--gold-soft); color: var(--gold); }
.aw2 { background: #eceff2; color: #5c6570; }
.aw3 { background: #f3e6dc; color: #8a5a34; }

/* ---------- 管理后台 ---------- */
.login-card { max-width: 380px; margin: 56px auto; }
.admin-bar { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.admin-bar .tabs { border-bottom: 0; margin-bottom: 0; }
.admin-item { padding: 16px; margin-bottom: 14px; }
.ai-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.ai-title { color: var(--ink-2); }
.ai-votes { margin-left: auto; font-weight: 700; color: var(--accent); }
.ai-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.ai-thumbs img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.ai-meta { font-size: 12px; color: var(--muted); word-break: break-all; }
.ai-story { font-size: 13px; color: var(--ink-2); line-height: 1.7; margin: 8px 0 12px; white-space: pre-wrap; max-height: 84px; overflow: hidden; }
.ai-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-danger { color: var(--accent); border-color: rgba(156, 43, 37, .3); }
.btn-danger:hover { background: var(--accent-soft); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 400px; }
.data-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 10px; border-bottom: 1px solid #f0e9df; vertical-align: top; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.mon-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid #f0e9df; }
.mon-row:last-of-type { border-bottom: 0; }
.mon-main { flex: 1; min-width: 0; }
.mon-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mon-num { font-family: "Songti SC", serif; font-size: 18px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.event-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.event-list li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.ev-kind { color: var(--accent); font-weight: 600; min-width: 92px; }
.ev-detail { color: var(--ink-2); flex: 1; word-break: break-all; }
.ev-time { color: var(--muted); font-size: 12px; }
.admin-save { padding: 20px 0 28px; }
.qr-card { text-align: center; }
.qr-card img { display: block; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px; }
.qr-url { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--muted); word-break: break-all; margin: 0 0 18px; }
.qr-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr-row img { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; }

/* ---------- 手机端底部标签栏 ---------- */
.tabbar { display: none; }

@media (max-width: 760px) {
  body { padding-bottom: 64px; }
  body.page-dorm { padding-bottom: 78px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255, 253, 248, .98); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 0 6px; color: var(--muted); font-size: 11px; letter-spacing: .02em;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.active { color: var(--accent); font-weight: 600; }
  .tabbar svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  body.page-dorm .tabbar { display: none; }
  .mobile-action { display: flex; }

  .site-header .inner { height: auto; padding: 9px 16px; }
  .nav { display: none; }
  .detail-grid { grid-template-columns: 1fr; gap: 16px; }
  .row-2 { grid-template-columns: 1fr; }
  .hero { padding: 26px 0 12px; }
  .hero .lead { font-size: 14.5px; }
  .sec-head { margin: 28px 0 14px; }
  .sec-head h2 { font-size: 18px; }
  .detail-title { font-size: 21px; }
  .rank-row { grid-template-columns: 38px 1fr auto; gap: 10px; padding: 12px 14px; }
  .rank-no { font-size: 18px; }
  .rank-main .bar { max-width: none; }

  .input, .select, .textarea { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .chip { padding: 8px 15px; }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .dorm-card .cover { aspect-ratio: 12 / 17; }
  .dorm-card .body { padding: 10px 11px 12px; }
  .dorm-card .top { gap: 6px; margin-bottom: 4px; }
  .dorm-card .badge { font-size: 11px; padding: 2px 7px; }
  .dorm-card h3 { font-size: 13.5px; margin-bottom: 4px; }
  .dorm-card p { font-size: 11.5px; line-height: 1.5; }
  .dorm-card .foot { font-size: 11px; margin-top: 8px; }

  .toolbar { gap: 10px; }
  .toolbar-right { width: 100%; margin-left: 0; }
  .search { flex: 1; width: auto; }
  .toolbar-right .filters { width: 100%; }

  .footer { margin-top: 40px; padding: 22px 0 28px; }
  .footer .inner { flex-direction: column; gap: 6px; }
  .login-card { margin: 24px auto; }
  .admin-item { padding: 14px; }
  .ai-story { max-height: 68px; }

  /* 统计卡在手机上排成一行 */
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 10px; margin-top: 26px; }
  .stat { padding: 12px 12px; }
  .stat .num { font-size: 23px; }
  .stat .lbl { font-size: 11.5px; letter-spacing: 0; }

  /* 规则行允许换行，避免左右挤在一起 */
  .rubric-list li { flex-wrap: wrap; }
  .rubric-list .max { white-space: normal; text-align: right; }

  /* 详情页票数卡只保留数字与规则，按钮由吸底条承担 */
  body.page-dorm .desk-vote .vote-btn { display: none; }
  body.page-dorm .desk-vote { padding: 18px 20px; }
}



/* ========================================================
   视觉打磨（2026-11）：统一的层次、质感与微交互
   ======================================================== */

:root {
  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow-sm: 0 1px 2px rgba(70, 48, 26, .06);
  --shadow-md: 0 2px 4px rgba(70, 48, 26, .05), 0 10px 28px -16px rgba(70, 48, 26, .28);
  --shadow-lg: 0 4px 10px rgba(70, 48, 26, .06), 0 24px 48px -24px rgba(70, 48, 26, .38);
  --ring: 0 0 0 3px rgba(156, 43, 37, .14);
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: .01em;
}

::selection { background: rgba(156, 43, 37, .16); }

h1, h2 { letter-spacing: .015em; }
p { text-wrap: pretty; }

/* 头部：更明确的层次 */
.site-header {
  background: rgba(250, 246, 238, .82);
  box-shadow: 0 1px 0 rgba(231, 221, 207, .8);
  border-bottom: none;
}
.brand .mark {
  background: linear-gradient(145deg, #b2362d, #8d221c);
  box-shadow: 0 2px 6px rgba(156, 43, 37, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
}

/* 首屏：更强的重心 */
.hero { padding: 54px 0 26px; }
.hero h1 {
  font-size: clamp(28px, 5.4vw, 46px);
  letter-spacing: .03em;
  color: #2a221d;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 {
    background: linear-gradient(180deg, #2a221d 30%, #6b3a2a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.hero .lead { font-size: 15.5px; line-height: 1.85; }
.hero .kicker { letter-spacing: .2em; }

/* 按钮：更明确的按压与焦点 */
.btn {
  min-height: 44px;
  box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn:hover { box-shadow: var(--shadow-md); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary {
  background: linear-gradient(180deg, #a83029, #8f2620);
  border-color: #8f2620;
  box-shadow: 0 1px 2px rgba(120, 30, 24, .25), 0 8px 20px -10px rgba(120, 30, 24, .55);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #b53a32, #9a2a23);
  border-color: #9a2a23;
  box-shadow: 0 2px 4px rgba(120, 30, 24, .25), 0 12px 26px -12px rgba(120, 30, 24, .6);
}
.btn-sm { min-height: 34px; }

/* 卡片：更细腻的描边与阴影 */
.card, .stat, .entry, .dorm-card {
  box-shadow: var(--shadow-md);
  border-color: rgba(231, 221, 207, .9);
}
.card-pad { padding: 24px; }

/* 数据条：数字更醒目 */
.stat { position: relative; overflow: hidden; }
.stat .num {
  font-size: 32px;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.stat .lbl { margin-top: 2px; }
.stat::after {
  content: "";
  position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px;
  background: linear-gradient(90deg, rgba(169, 118, 42, .5), transparent);
}

/* 章节标题：加一条短横线，节奏更稳 */
.sec-head { margin: 44px 0 18px; align-items: center; }
.sec-head h2 { position: relative; padding-left: 16px; font-size: 21px; }
.sec-head h2::before {
  content: "";
  position: absolute; left: 0; top: .28em; bottom: .28em; width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
}

/* 玩法卡片 */
.entry { transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
.entry:hover { box-shadow: var(--shadow-lg); }
.entry .ico { font-family: "Songti SC", serif; color: var(--gold); letter-spacing: .04em; }

/* 作品卡：图片轻微缩放 */
.dorm-card { transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.dorm-card .cover img { transition: transform .35s var(--ease); }
.dorm-card:hover .cover img { transform: scale(1.03); }

/* 输入控件：更舒展 */
.input, .select, .textarea { padding: 12px 14px; border-radius: 12px; }
.input:hover, .select:hover, .textarea:hover { border-color: #d8c8b4; }
.input:focus, .select:focus, .textarea:focus { box-shadow: var(--ring); }

/* 筛选 chip */
.chip { transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease); }
.chip:active { transform: scale(.97); }

/* 列表行：hover 时轻微提亮 */
.rank-row, .fun-row { transition: background .18s var(--ease); }
.rank-row:hover, .fun-row:hover { background: rgba(169, 118, 42, .06); }

/* 底部标签栏：更轻的玻璃质感 */
.tabbar {
  background: rgba(252, 248, 241, .94);
  box-shadow: 0 -1px 0 rgba(231, 221, 207, .9);
  border-top: none;
}

/* 降低动效偏好 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .dorm-card:hover, .entry:hover, .btn:hover { transform: none; }
}

/* ==========================================================
   响应式适配：小屏手机 / 折叠屏展开 / 平板
   ========================================================== */

/* 长数字（比如手机号）不撑破卡片 */
.dorm-card { min-width: 0; }
.dorm-card h3, .dorm-card .room, .dorm-card .foot, .dorm-card p { overflow-wrap: anywhere; }

/* —— 401—430：单列横排，信息不挤 —— */

/* —— ≤430：作品墙改单列横排 —— */
@media (max-width: 430px) {
  .container { padding: 0 16px; }

  .gallery-grid { grid-template-columns: 1fr; gap: 12px; }
  .dorm-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
  .dorm-card .cover { aspect-ratio: auto; height: 100%; min-height: 142px; }
  .dorm-card .body { padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; }
  .dorm-card h3 { font-size: 15px; margin-bottom: 4px; }
  .dorm-card p { font-size: 12.5px; line-height: 1.55; }
  .dorm-card .foot { font-size: 11.5px; gap: 6px; flex-wrap: wrap; }

  /* 规则列表：标签在上、内容在下，不再挤成两列 */
  .rubric-list li { flex-direction: column; align-items: flex-start; gap: 3px; }
  .rubric-list .max { white-space: normal; text-align: left; }

  .hero h1 { font-size: 30px; }
  .hero .lead { font-size: 15px; }
  .sec-head { flex-wrap: wrap; gap: 6px 10px; }
  .stat-row { gap: 10px; }
  .stat .num { font-size: 26px; }
}

/* —— 431—760：两列，但允许右侧换行 —— */
@media (min-width: 431px) and (max-width: 760px) {
  .runtime-hint { display: none; }
  .rubric-list .max { white-space: normal; text-align: right; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}

/* —— 761—1024：折叠屏展开、小平板 —— */
@media (min-width: 761px) and (max-width: 1024px) {
  .container { max-width: 920px; padding: 0 28px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  .detail-grid { grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr); gap: 20px; }
  .hero h1 { font-size: 40px; }
}

/* —— ≥1440：宽屏时别把内容拉太散 —— */
@media (min-width: 1440px) {
  .container { max-width: 1160px; }
}


@media (max-width: 430px) {
  .member-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-class { grid-column: 1 / -1; }
  .member-fields .input { font-size: 16px; padding-left: 9px; padding-right: 8px; }
}


@media (max-width: 760px) {
  /* 手机上票数在底部悬浮条里，卡片里不再重复一遍 */
  body.page-dorm .desk-vote .vote-num,
  body.page-dorm .desk-vote .vote-lbl { display: none; }
  body.page-dorm .desk-vote { padding: 16px 18px; text-align: left; }
  body.page-dorm .desk-vote .rules { margin-top: 0; }

  .submit-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
}


/* ---------- 投票卡（分享用） ---------- */
.share-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.share-entry-t { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.share-entry-t .muted { color: var(--muted); font-size: 12px; line-height: 1.5; }

.share-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(30,22,16,.62); padding: 16px; }
.share-card { width: min(420px, 100%); max-height: 92vh; overflow: auto; background: var(--surface);
  border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.share-head { display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.share-close { border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.share-body { padding: 14px 16px 18px; text-align: center; }
.share-canvas img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--line); }
.share-tip { font-size: 12.5px; color: var(--muted); line-height: 1.65; margin: 12px 0 14px; }
.share-actions { display: flex; gap: 10px; justify-content: center; }
.share-fail { padding: 40px 0; color: var(--muted); font-size: 13px; }


.vote-browse { display: inline-block; margin-top: 8px; color: var(--accent); font-size: 12.5px; text-decoration: none; }
.vote-browse:hover { text-decoration: underline; }


/* ==========================================================
   跨端适配：iOS / Android / 鸿蒙 / 微信内置浏览器
   ========================================================== */

:root { color-scheme: light; }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "MiSans", "Noto Sans CJK SC", "Source Han Sans SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  overscroll-behavior-y: contain;
}

/* 长按保存图片的地方要保留长按菜单 */
.share-canvas img, .poster-box img, .viewer img { -webkit-touch-callout: default; }

/* 刘海屏 / 挖孔屏：顶部和左右留出安全区（保留原有的内边距） */
.site-header { padding-top: env(safe-area-inset-top); }
.submit-bar {
  padding-left: calc(18px + env(safe-area-inset-left));
  padding-right: calc(18px + env(safe-area-inset-right));
}
.mobile-action {
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
}
.tabbar {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* 滚动区域用惯性滚动（iOS） */
.share-card, .viewer-strip, .admin-scroll { -webkit-overflow-scrolling: touch; }

/* 下拉框统一外观：安卓/iOS/鸿蒙看起来一致 */
.select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2383776B' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 9px;
  padding-right: 38px;
}

/* 输入框在 iOS 上不触发自动放大（16px 已保证），并去掉内阴影 */
.input, .select, .textarea {
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
}
.input[type="search"]::-webkit-search-decoration,
.input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* 键盘弹出时，底部悬浮条先收起来，避免挡住输入框 */
body.kb-open .tabbar,
body.kb-open .mobile-action,
body.kb-open .submit-bar { display: none !important; }

/* 微信 / 鸿蒙 内置浏览器：100vh 高度不准，用 dvh 兜底 */
.full-screen { min-height: 100vh; min-height: 100dvh; }

/* 安卓部分机型会把 font-weight 渲染得更粗，标题减一档 */
@media (max-width: 430px) {
  .hero h1, .detail-title { font-weight: 600; }
}


/* 排行榜：窄屏别让分数挤到卡片外面 */
.rank-main { min-width: 0; }
@media (max-width: 430px) {
  .rank-row { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; padding: 12px 12px; }
  .rank-main .bar { max-width: 100%; }
  .score-line { flex-wrap: wrap; white-space: normal; gap: 3px 8px; line-height: 1.5; margin-bottom: 6px; }
  .rank-right { min-width: 46px; }
  .rank-votes { font-size: 18px; }
  .rank-lbl { font-size: 10.5px; }
  .rank-title { font-size: 14.5px; }
  .rank-sub { font-size: 12px; margin-bottom: 7px; }
}


/* 分享入口：按钮不折行，挤的时候自动换到下一行 */
.share-entry { flex-wrap: wrap; }
.share-entry-t { min-width: 0; flex: 1 1 180px; }
.share-entry #shareBtn, .share-entry .btn { white-space: nowrap; flex: none; }

