/* ===== assets/css/themes.css ===== */
/* ==========================================================================
   烛生烟 · 五套主题
   粉色 / 绿色 采用低饱和度配色；白色明亮；黑色为烛火暖金暗色。
   所有颜色集中在 CSS 变量里，切换 <html data-theme="..."> 即可整体换肤。
   ========================================================================== */

:root {
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --appbar-h: 54px;
  --tabbar-h: 60px;
  --danger: #d4726a;
  --danger-rgb: 212, 114, 106;
  --success: #63a37a;
  --success-rgb: 99, 163, 122;
  --warn: #d9a441;
  --warn-rgb: 217, 164, 65;
  --gold: #c9a86a;
}

/* ---------------------------------------------------------------- 粉色（低饱和） */
html[data-theme="pink"] {
  --bg: #faf6f7;
  --bg-2: #f3eaed;
  --surface: #ffffff;
  --surface-2: #f8f0f2;
  --surface-3: #f1e5e9;
  --text: #4b3b41;
  --text-2: #8d7981;
  --text-3: #a9969d;
  --border: #efdfe4;
  --border-2: #e6d2d8;
  --primary: #d4a0ae;
  --primary-2: #c0899a;
  --primary-rgb: 212, 160, 174;
  --on-primary: #ffffff;
  --accent: #e8c6cf;
  --shadow: 196, 152, 165;
  --meta: #d4a0ae;
}

/* ---------------------------------------------------------------- 绿色（低饱和） */
html[data-theme="green"] {
  --bg: #f5f8f5;
  --bg-2: #eaf1ec;
  --surface: #ffffff;
  --surface-2: #eff5f1;
  --surface-3: #e4ede7;
  --text: #39443c;
  --text-2: #78877d;
  --text-3: #93a198;
  --border: #dee9e1;
  --border-2: #cfdfd5;
  --primary: #94b7a1;
  --primary-2: #7aa088;
  --primary-rgb: 148, 183, 161;
  --on-primary: #ffffff;
  --accent: #c6dccd;
  --shadow: 140, 175, 153;
  --meta: #94b7a1;
}

/* ---------------------------------------------------------------- 蓝色 */
html[data-theme="blue"] {
  --bg: #f3f7fb;
  --bg-2: #e7eef8;
  --surface: #ffffff;
  --surface-2: #edf3fb;
  --surface-3: #e2ebf7;
  --text: #2f3a4a;
  --text-2: #6f7d92;
  --text-3: #8b98ab;
  --border: #dbe5f2;
  --border-2: #c9d8ec;
  --primary: #7fa3d1;
  --primary-2: #648bba;
  --primary-rgb: 127, 163, 209;
  --on-primary: #ffffff;
  --accent: #bed2ea;
  --shadow: 122, 155, 197;
  --meta: #7fa3d1;
}

/* ---------------------------------------------------------------- 白色（明亮） */
html[data-theme="white"] {
  --bg: #fafafa;
  --bg-2: #f1f1f3;
  --surface: #ffffff;
  --surface-2: #f6f6f7;
  --surface-3: #eeeef0;
  --text: #1e2126;
  --text-2: #6d737c;
  --text-3: #8e939b;
  --border: #e7e8eb;
  --border-2: #d8dade;
  --primary: #4d545e;
  --primary-2: #343a42;
  --primary-rgb: 77, 84, 94;
  --on-primary: #ffffff;
  --accent: #e0e2e6;
  --shadow: 120, 126, 136;
  --meta: #fafafa;
}

/* ---------------------------------------------------------------- 黑色（烛火） */
html[data-theme="black"] {
  --bg: #101114;
  --bg-2: #16181c;
  --surface: #1a1c21;
  --surface-2: #212429;
  --surface-3: #282c33;
  --text: #e9eaee;
  --text-2: #98a0aa;
  --text-3: #7b838e;
  --border: #2b2f36;
  --border-2: #383d46;
  --primary: #d3b078;
  --primary-2: #e3c694;
  --primary-rgb: 211, 176, 120;
  --on-primary: #1d160b;
  --accent: #3b3226;
  --shadow: 0, 0, 0;
  --meta: #101114;
  color-scheme: dark;
}

html[data-theme="black"] img {
  filter: brightness(.92);
}

/* 主题切换过渡 */
html.theme-anim,
html.theme-anim * {
  transition: background-color .22s ease, color .22s ease, border-color .22s ease !important;
}

/* ===== assets/css/base.css ===== */
/* ==========================================================================
   烛生烟 · 布局骨架（移动优先，>=900px 转为侧边栏布局）
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body.no-scroll { overflow: hidden; }

a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* 内联 SVG 图标的默认尺寸（更具体的规则可覆盖它） */
svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: middle;
}
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 启动画面 */
.boot {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg);
  z-index: 999;
}
.boot-logo { font-size: 46px; animation: flicker 1.8s ease-in-out infinite; }
.boot-name { font-size: 22px; letter-spacing: .4em; text-indent: .4em; font-weight: 600; }
.boot-tip { color: var(--text-3); font-size: 13px; }
@keyframes flicker {
  0%, 100% { opacity: 1; transform: translateY(0) scale(1); }
  45% { opacity: .72; transform: translateY(-2px) scale(.97); }
  70% { opacity: .92; }
}

/* ---------------------------------------------------------------- 顶栏 */
.appbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--appbar-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  padding-right: 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
@supports not (backdrop-filter: blur(4px)) {
  .appbar { background: var(--surface); }
}

.appbar-back {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-left: -4px;
  border: none; background: transparent; border-radius: 50%;
  cursor: pointer; color: var(--text-2);
}
.appbar-back:active { background: var(--surface-2); }

.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { font-size: 20px; line-height: 1; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-size: 16px; font-weight: 700; letter-spacing: .18em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-slogan {
  font-size: 10px; color: var(--text-3); letter-spacing: .05em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar-spacer { flex: 1; }
.appbar-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-2);
  border-radius: 50%; cursor: pointer; position: relative;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid var(--surface);
}
.icon-btn .pts {
  font-size: 11px; font-weight: 700; color: var(--warn);
  position: absolute; bottom: 1px; right: 2px;
}

/* ---------------------------------------------------------------- 主体 */
.shell { display: block; }

.view {
  padding: calc(var(--appbar-h) + env(safe-area-inset-top) + 12px) 12px
           calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 26px);
  max-width: 900px;
  margin: 0 auto;
  outline: none;
  animation: viewIn .22s ease;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- 底部导航 */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  align-items: stretch;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-top: 1px solid var(--border);
  z-index: 50;
}
@supports not (backdrop-filter: blur(4px)) {
  .tabbar { background: var(--surface); }
}
.tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  border: none; background: transparent;
  color: var(--text-3);
  font-size: 10.5px;
  cursor: pointer;
  padding: 6px 2px 4px;
  position: relative;
  transition: color .16s;
}
.tab svg { width: 21px; height: 21px; }
.tab .tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab.active { color: var(--primary-2); font-weight: 600; }
.tab.active::after {
  content: "";
  position: absolute; top: 4px;
  width: 16px; height: 3px; border-radius: 3px;
  background: var(--primary);
}
.tab.active svg { transform: translateY(1px); }
.tab .tab-badge {
  position: absolute; top: 5px; left: 50%; margin-left: 4px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 9px; line-height: 15px; text-align: center; font-weight: 700;
}

/* ---------------------------------------------------------------- 桌面端 */
@media (min-width: 900px) {
  .shell { display: flex; align-items: flex-start; gap: 22px; max-width: 1200px; margin: 0 auto; }
  .tabbar {
    position: sticky;
    top: calc(var(--appbar-h) + 18px);
    left: auto; bottom: auto; right: auto;
    flex-direction: column;
    width: 196px;
    height: auto;
    padding: 10px;
    gap: 4px;
    margin-top: calc(var(--appbar-h) + 18px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    backdrop-filter: none;
    box-shadow: 0 8px 26px rgba(var(--shadow), .07);
  }
  .tab {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    font-size: 14px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
  }
  .tab.active { background: rgba(var(--primary-rgb), .13); color: var(--primary-2); }
  .tab.active::after { display: none; }
  .tab:hover { background: var(--surface-2); }
  .tab .tab-badge { position: static; margin-left: auto; }
  .view {
    flex: 1;
    min-width: 0;
    padding: calc(var(--appbar-h) + 18px) 4px 60px;
    max-width: none;
  }
  .appbar { padding-left: max(18px, calc((100vw - 1200px) / 2 + 18px)); padding-right: max(18px, calc((100vw - 1200px) / 2 + 18px)); }
}

/* ---------------------------------------------------------------- 工具类 */
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 600; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; word-break: break-word; }
.break { word-break: break-word; overflow-wrap: anywhere; }
.gold { color: var(--gold); }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== assets/css/components.css ===== */
/* ==========================================================================
   烛生烟 · 组件
   ========================================================================== */

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 6px 20px rgba(var(--shadow), .05);
}
.card.tight { padding: 10px 12px; }
.card.flush { padding: 0; overflow: hidden; }
.card + .card { margin-top: 12px; }
.card-link { cursor: pointer; transition: transform .14s ease, box-shadow .14s ease; }
.card-link:active { transform: scale(.985); }
@media (hover: hover) {
  .card-link:hover { box-shadow: 0 10px 28px rgba(var(--shadow), .11); border-color: var(--border-2); }
}

.section { margin-top: 18px; }
.section:first-child { margin-top: 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 10px; padding: 0 2px;
}
.section-title { font-size: 15.5px; font-weight: 700; letter-spacing: .04em; }
.section-title::before {
  content: ""; display: inline-block;
  width: 3px; height: 14px; border-radius: 2px;
  background: var(--primary); margin-right: 8px; vertical-align: -1.5px;
}
.section-more { font-size: 12.5px; color: var(--text-2); }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: filter .15s, background .15s, transform .1s;
  white-space: nowrap;
  user-select: none;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn-primary:not(:disabled):hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: rgba(var(--primary-rgb), .14); border-color: transparent; color: var(--primary-2); font-weight: 600; }
.btn-danger { color: var(--danger); border-color: rgba(var(--danger-rgb), .35); background: rgba(var(--danger-rgb), .07); }
.btn-danger:not(:disabled):hover { background: rgba(var(--danger-rgb), .14); }
.btn-sm { padding: 5px 12px; min-height: 30px; font-size: 12.5px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { padding: 12px 22px; min-height: 46px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 8px; min-width: 38px; }

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(var(--primary-rgb), .45);
  cursor: pointer; z-index: 40;
  transition: transform .15s;
}
.fab svg { width: 24px; height: 24px; }
.fab:active { transform: scale(.92); }
@media (min-width: 900px) {
  .fab { right: auto; left: calc(50% + 300px); bottom: 30px; }
}

/* ---------------------------------------------------------------- 头像 */
.avatar {
  flex: 0 0 auto;
  border-radius: 50% !important;
  background: rgba(var(--primary-rgb), .18);
  color: var(--primary-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
  border: 1px solid var(--border);
  text-transform: uppercase;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  display: block;
}
.avatar.ring { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(var(--primary-rgb), .5); }
/* 尺寸由 JS 内联给出；这里只保留字号兜底 */
.av-24 { font-size: 11px; }
.av-32 { font-size: 13px; }
.av-40 { font-size: 15px; }
.av-56 { font-size: 20px; }
.av-72 { font-size: 26px; }
.av-96 { font-size: 32px; }

/* ---------------------------------------------------------------- 徽章 / 标签 */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 18px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-primary { background: rgba(var(--primary-rgb), .16); color: var(--primary-2); border-color: transparent; font-weight: 600; }
.badge-gold { background: rgba(var(--warn-rgb), .16); color: var(--warn); border-color: transparent; font-weight: 600; }
.badge-danger { background: rgba(var(--danger-rgb), .13); color: var(--danger); border-color: transparent; }
.badge-success { background: rgba(var(--success-rgb), .14); color: var(--success); border-color: transparent; }
.badge-admin { background: rgba(var(--warn-rgb), .18); color: var(--warn); border-color: transparent; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(var(--primary-rgb), .12);
  color: var(--primary-2);
  font-size: 11.5px;
}

/* ---------------------------------------------------------------- 表单 */
.field { margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px;
}
.label .opt { font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.input, .textarea, .select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px; /* 防止 iOS 自动放大 */
  outline: none;
  transition: border-color .15s, background .15s;
  appearance: none;
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.select { background-image: none; cursor: pointer; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .16);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:disabled, .textarea:disabled { opacity: .6; }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; min-width: 0; }
.counter { font-size: 11px; color: var(--text-3); text-align: right; margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

.search {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  height: 40px;
}
.search svg { width: 17px; height: 17px; color: var(--text-3); flex: 0 0 auto; }
.search input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font-size: 16px; height: 100%;
}
.search input::placeholder { color: var(--text-3); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  width: 44px; height: 25px; border-radius: 999px;
  background: var(--border-2); position: relative; transition: background .18s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2.5px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* 图片上传 */
.uploader { display: flex; flex-wrap: wrap; gap: 8px; }
.upload-tile {
  width: 76px; height: 76px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-2);
  background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; color: var(--text-3); font-size: 10.5px;
  position: relative; overflow: hidden;
}
.upload-tile svg { width: 20px; height: 20px; }
.upload-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload-tile .rm {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 12px; line-height: 1;
}
.upload-tile input[type=file] { display: none; }

/* ---------------------------------------------------------------- 列表 */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .14s;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--surface-2); }
@media (hover: hover) { .list-item:hover { background: var(--surface-2); } }
.list-item.static { cursor: default; }
.list-title { font-weight: 600; font-size: 14.5px; }
.list-sub { font-size: 12.5px; color: var(--text-2); }
.list-meta { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.list-meta .mi { display: inline-flex; align-items: center; gap: 3px; }
.list-meta svg { width: 13px; height: 13px; }

/* ---------------------------------------------------------------- 首页 */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 18px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .22), rgba(var(--primary-rgb), .06));
  border: 1px solid var(--border);
  overflow: hidden;
}
.hero::after {
  content: "🕯️";
  position: absolute; right: -6px; bottom: -14px;
  font-size: 74px; opacity: .16; transform: rotate(-8deg);
}
.hero-hello { font-size: 19px; font-weight: 700; letter-spacing: .02em; }
.hero-slogan { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.signin-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.signin-ring {
  width: 62px; height: 62px; flex: 0 0 auto;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--primary-rgb), .14);
  color: var(--primary-2);
  font-size: 22px;
}
.signin-card.done .signin-ring { background: rgba(var(--success-rgb), .15); color: var(--success); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 380px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
}
.stat-num { font-size: 18px; font-weight: 700; color: var(--primary-2); }
.stat-label { font-size: 11px; color: var(--text-3); }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px; color: var(--text-2);
}
.quick .qi {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--primary-rgb), .14); color: var(--primary-2);
}
.quick .qi svg { width: 20px; height: 20px; }

/* 横向滚动卡片 */
.hscroll {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }

/* ---------------------------------------------------------------- 人设 */
.char-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 620px) { .char-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .char-grid { grid-template-columns: repeat(3, 1fr); } }

.char-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.char-card:active { transform: scale(.98); }
@media (hover: hover) { .char-card:hover { box-shadow: 0 12px 30px rgba(var(--shadow), .13); } }
.char-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, rgba(var(--primary-rgb), .22), var(--surface-2));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.char-cover img { width: 100%; height: 100%; object-fit: cover; }
.char-cover .ph { font-size: 34px; opacity: .45; }
.char-code {
  position: absolute; top: 7px; left: 7px;
  padding: 1px 8px; border-radius: 999px;
  background: rgba(0,0,0,.42); color: #fff;
  font-size: 10.5px; backdrop-filter: blur(4px);
  letter-spacing: .04em;
}
.char-body { padding: 9px 10px 11px; }
.char-name { font-weight: 700; font-size: 15px; }
.char-pos { font-size: 11.5px; color: var(--text-2); }
.char-owner { font-size: 11px; color: var(--text-3); margin-top: 5px; display: flex; align-items: center; gap: 5px; }

.char-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(160deg, rgba(var(--primary-rgb), .3), var(--surface-2));
  min-height: 190px;
  display: flex; align-items: flex-end;
  border: 1px solid var(--border);
}
.char-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.char-hero .shade {
  position: relative;
  width: 100%;
  padding: 34px 16px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,.12) 62%, transparent);
  color: #fff;
}
.char-hero .shade .nm { font-size: 22px; font-weight: 700; letter-spacing: .03em; }
.char-hero .shade .sub { font-size: 12.5px; opacity: .88; }
.char-hero-empty {
  position: relative; width: 100%; padding: 46px 16px 20px;
  text-align: center; color: var(--text-2);
}
.char-hero-empty .ph { font-size: 42px; opacity: .5; }

.dl { display: grid; gap: 0; }
.dl-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.dl-row:last-child { border-bottom: none; }
.dl-k { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.dl-v { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.dl-v.empty { color: var(--text-3); }

.quote-block {
  border-left: 3px solid var(--primary);
  padding: 8px 0 8px 12px;
  color: var(--text-2);
  font-style: italic;
  background: rgba(var(--primary-rgb), .05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  cursor: zoom-in;
}

/* ---------------------------------------------------------------- 帖子 */
.post-card .post-title { font-size: 15.5px; font-weight: 700; line-height: 1.45; }
.post-card .post-sum { font-size: 13px; color: var(--text-2); margin-top: 5px; }
.post-thumbs { display: flex; gap: 6px; margin-top: 9px; }
.post-thumbs img {
  width: 62px; height: 62px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.post-foot {
  display: flex; align-items: center; gap: 14px;
  margin-top: 10px; padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.post-foot .pf { display: inline-flex; align-items: center; gap: 4px; }
.post-foot svg { width: 15px; height: 15px; }

.post-content {
  font-size: 15.5px;
  line-height: 1.85;
  word-break: break-word;
  white-space: pre-wrap;
}
.post-images { display: grid; gap: 8px; margin-top: 12px; }
.post-images img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }

.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface);
  color: var(--text-2); font-size: 13.5px; cursor: pointer;
}
.like-btn.on { color: var(--danger); border-color: rgba(var(--danger-rgb), .4); background: rgba(var(--danger-rgb), .09); font-weight: 600; }
.like-btn svg { width: 17px; height: 17px; }

/* 评论 */
.comment { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.comment:last-child { border-bottom: none; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.comment-name { font-size: 13px; font-weight: 600; }
.comment-time { font-size: 11px; color: var(--text-3); }
.comment-body { font-size: 14px; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.comment-reply-to { font-size: 11.5px; color: var(--primary-2); }
.comment-actions { margin-top: 5px; display: flex; gap: 12px; font-size: 11.5px; color: var(--text-3); }
.comment-actions button { border: none; background: none; color: inherit; cursor: pointer; padding: 0; font-size: inherit; }
.comment-actions button:hover { color: var(--primary-2); }

.composer {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.composer textarea {
  flex: 1; min-height: 40px; max-height: 140px; resize: none;
  border: none; background: transparent; outline: none;
  font-size: 16px; line-height: 1.6; padding: 8px 4px;
}

.sticky-composer {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 8px 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  z-index: 30;
}
@media (min-width: 900px) {
  .sticky-composer {
    left: auto; right: auto;
    width: min(900px, calc(100% - 240px));
    bottom: 0;
  }
}

/* ---------------------------------------------------------------- 留言 */
.msg { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.msg:last-child { border-bottom: none; }
.msg-main { flex: 1; min-width: 0; }
.msg-arrow { color: var(--text-3); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.msg-body {
  margin-top: 5px; padding: 9px 12px;
  background: var(--surface-2);
  border-radius: 4px var(--radius-sm) var(--radius-sm) var(--radius-sm);
  font-size: 14px; white-space: pre-wrap; word-break: break-word;
}
.msg.private .msg-body { background: rgba(var(--primary-rgb), .09); }

/* ---------------------------------------------------------------- 排行 */
.rank-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}
.rank-row:last-child { border-bottom: none; }
.rank-row.me { background: rgba(var(--primary-rgb), .08); }
.rank-no {
  width: 26px; height: 26px; flex: 0 0 auto;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700;
  background: var(--surface-2); color: var(--text-2);
}
.rank-no.r1 { background: linear-gradient(135deg, #f0c674, #d9a441); color: #45330c; }
.rank-no.r2 { background: linear-gradient(135deg, #d9dde3, #b6bdc7); color: #3a3f47; }
.rank-no.r3 { background: linear-gradient(135deg, #e0b48b, #c08a5a); color: #40280f; }
.rank-points { font-size: 16px; font-weight: 700; color: var(--warn); }

.my-rank-card {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .2), rgba(var(--primary-rgb), .06));
  border: 1px solid var(--border);
}

/* ---------------------------------------------------------------- 背包 */
.item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 620px) { .item-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .item-grid { grid-template-columns: repeat(5, 1fr); } }
.item-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform .14s, border-color .14s;
}
.item-card:active { transform: scale(.96); }
.item-card .ic { font-size: 27px; line-height: 1.2; }
.item-card .nm { font-size: 12px; font-weight: 600; margin-top: 5px; }
.item-card .qt {
  position: absolute; top: 5px; right: 6px;
  font-size: 11px; font-weight: 700; color: var(--on-primary);
  background: var(--primary); border-radius: 999px; padding: 0 6px; line-height: 16px;
}
.item-card.empty-slot { opacity: .38; }
.rarity-普通 { color: var(--text-2); }
.rarity-稀有 { color: var(--primary-2); }
.rarity-史诗 { color: #a970d8; }
.rarity-传说 { color: var(--warn); }

/* ---------------------------------------------------------------- 日历（签到） */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-h { text-align: center; font-size: 11px; color: var(--text-3); padding-bottom: 2px; }
.cal-d {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  font-size: 12px;
  background: var(--surface-2);
  color: var(--text-3);
}
.cal-d.on { background: rgba(var(--success-rgb), .2); color: var(--success); font-weight: 700; }
.cal-d.today { outline: 2px solid var(--primary); outline-offset: -2px; color: var(--primary-2); font-weight: 700; }
.cal-d.blank { background: transparent; }

/* ---------------------------------------------------------------- 标签页 */
.tabs {
  display: flex; gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1 0 auto;
  padding: 7px 14px;
  border: none; background: transparent;
  border-radius: 999px;
  font-size: 13px; color: var(--text-2);
  cursor: pointer; white-space: nowrap;
}
.tab-btn.active { background: var(--surface); color: var(--primary-2); font-weight: 700; box-shadow: 0 1px 4px rgba(var(--shadow), .12); }

/* ---------------------------------------------------------------- 空态 / 骨架 */
.empty { padding: 40px 16px; text-align: center; color: var(--text-3); }
.empty .ei { font-size: 38px; opacity: .5; }
.empty .et { margin-top: 8px; font-size: 13.5px; }

.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skel-line { height: 13px; margin-bottom: 8px; }
.skel-card { height: 88px; border-radius: var(--radius); margin-bottom: 12px; }

.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid rgba(var(--primary-rgb), .28);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { padding: 34px 0; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------------------------------------------------------------- 提示 / 弹窗 */
.toast-wrap {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 420px);
}
@media (min-width: 900px) { .toast-wrap { bottom: 26px; } }
.toast {
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13.5px;
  box-shadow: 0 8px 26px rgba(var(--shadow), .3);
  animation: toastIn .22s ease;
  word-break: break-word;
}
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--success); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

.modal-root { position: fixed; inset: 0; z-index: 300; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 620px) { .modal-root { align-items: center; } }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); animation: fadeIn .18s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  animation: sheetUp .24s cubic-bezier(.2,.8,.3,1);
  border: 1px solid var(--border);
}
@media (min-width: 620px) {
  .modal-panel { border-radius: var(--radius-lg); padding-bottom: 18px; animation: popIn .2s ease; }
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes popIn { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title { font-size: 16.5px; font-weight: 700; margin-bottom: 4px; }
.modal-desc { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }
.modal-grab { width: 38px; height: 4px; border-radius: 3px; background: var(--border-2); margin: -6px auto 12px; }

/* ---------------------------------------------------------------- 主题选择 */
.theme-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.theme-item { text-align: center; cursor: pointer; }
.theme-dot {
  width: 100%; aspect-ratio: 1; border-radius: 14px;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  position: relative;
  overflow: hidden;
}
.theme-item.active .theme-dot { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .22); }
.theme-item .tn { font-size: 11px; color: var(--text-2); margin-top: 5px; }
.theme-item.active .tn { color: var(--primary-2); font-weight: 700; }
.td-pink { background: linear-gradient(135deg, #faf6f7, #d4a0ae); }
.td-green { background: linear-gradient(135deg, #f5f8f5, #94b7a1); }
.td-blue { background: linear-gradient(135deg, #f3f7fb, #7fa3d1); }
.td-white { background: linear-gradient(135deg, #ffffff, #d8dade); }
.td-black { background: linear-gradient(135deg, #101114, #d3b078); }

/* ---------------------------------------------------------------- 个人页 */
.profile-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .2), rgba(var(--primary-rgb), .05));
  border: 1px solid var(--border);
}
.profile-name { font-size: 18px; font-weight: 700; }
.profile-sub { font-size: 12px; color: var(--text-2); }

.menu-list { display: flex; flex-direction: column; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 14.5px;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--surface-2); }
.menu-item .mi { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: rgba(var(--primary-rgb), .13); color: var(--primary-2); flex: 0 0 auto; }
.menu-item .mi svg { width: 17px; height: 17px; }
.menu-item .chev { color: var(--text-3); }
.menu-item .chev svg { width: 17px; height: 17px; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .mi { background: rgba(var(--danger-rgb), .12); color: var(--danger); }

/* ---------------------------------------------------------------- 管理端 */
.admin-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(var(--warn-rgb), .12);
  border: 1px solid rgba(var(--warn-rgb), .3);
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
}
.admin-user-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-user-row:last-child { border-bottom: none; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.kv-hint { font-size: 11.5px; color: var(--text-3); }
.code-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* ---------------------------------------------------------------- 登录页 */
.auth-wrap { padding: 26px 0 10px; text-align: center; }
.auth-logo { font-size: 46px; }
.auth-title { font-size: 23px; font-weight: 700; letter-spacing: .28em; text-indent: .28em; margin-top: 6px; }
.auth-slogan { font-size: 12.5px; color: var(--text-2); margin-top: 4px; letter-spacing: .06em; }
.auth-card { margin-top: 20px; text-align: left; }
.auth-hint {
  margin-top: 14px; padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  font-size: 12px; color: var(--text-2); line-height: 1.7;
}

/* ---------------------------------------------------------------- 图片查看 */
.lightbox {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.9);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn .18s;
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }

/* 分页 */
.pager { display: flex; justify-content: center; padding: 16px 0 4px; }

/* ==========================================================================
   实时状态 / 在线点
   ========================================================================== */
html[data-live="on"] .appbar .brand-mark::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px; margin-left: 3px;
  border-radius: 50%; background: var(--success);
  vertical-align: 8px;
  animation: livePulse 2.2s ease-out infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--success-rgb), .55); }
  70% { box-shadow: 0 0 0 7px rgba(var(--success-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--success-rgb), 0); }
}
.avatar-wrap { position: relative; flex: 0 0 auto; display: inline-flex; }
.dot-on {
  position: absolute; right: -1px; bottom: -1px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--success); border: 2px solid var(--surface);
}
.dot-on.off { background: var(--border-2); }

/* ==========================================================================
   聊天气泡（私聊 / 区域聊天共用）
   ========================================================================== */
.chat-list {
  padding: 14px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 54vh;
  max-height: 62vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.chat-list.place-chat { min-height: 40vh; max-height: 48vh; }
/* 消息少的时候从底部往上堆（和微信/QQ 一样），多的时候正常滚动 */
.chat-list::before { content: ""; flex: 1 0 auto; margin-bottom: -14px; }

/* 时间分隔条已取消，时间改到头像下面 */

.bubble-row { display: flex; gap: 9px; align-items: flex-start; }
.bubble-row.mine { flex-direction: row-reverse; }
.bubble-col { display: flex; flex-direction: column; max-width: 72%; min-width: 0; }
.bubble-row.mine .bubble-col { align-items: flex-end; }
/* 头像 + 它下面的时间 */
.bubble-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.bubble-time {
  font-size: 9.5px;
  color: var(--text-3);
  white-space: nowrap;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.bubble {
  position: relative;
  padding: 9px 13px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(var(--shadow), .07);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.bubble-row:not(.mine) .bubble { border-top-left-radius: 5px; }
.bubble.mine {
  background: linear-gradient(180deg, rgba(var(--primary-rgb), .24), rgba(var(--primary-rgb), .16));
  border-color: rgba(var(--primary-rgb), .3);
  border-top-right-radius: 5px;
}
.bubble-text { font-size: 14.5px; line-height: 1.62; white-space: pre-wrap; }
.bubble-who { font-size: 11px; color: var(--text-3); margin: 0 4px 4px; }

/* ==========================================================================
   无日城地图
   ========================================================================== */
.map-hero { background: linear-gradient(135deg, rgba(var(--primary-rgb), .26), rgba(var(--primary-rgb), .05)); }
.map-canvas {
  position: relative;
  width: 100%;
  padding-top: 92%;
  background: radial-gradient(circle at 50% 45%, rgba(var(--primary-rgb), .1), transparent 68%);
  border-radius: var(--radius);
  overflow: hidden;
}
.map-diamond {
  position: absolute; left: 50%; top: 46%;
  width: 62%; aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1.5px dashed var(--border-2);
  border-radius: 14px;
  background: rgba(var(--primary-rgb), .05);
}
.map-area-label {
  position: absolute; font-size: 11px; color: var(--text-3);
  letter-spacing: .16em; pointer-events: none;
}
.map-area-label[data-area="中央"] { left: 50%; top: 47%; transform: translate(-50%, -50%); }
.map-area-label[data-area="北城"] { left: 50%; top: 2%; transform: translateX(-50%); }
.map-area-label[data-area="南城"] { left: 50%; top: 96%; transform: translateX(-50%); }
.map-area-label[data-area="西城"] { left: 3%; top: 46%; }
.map-area-label[data-area="东城"] { right: 3%; top: 46%; }
.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 42px; height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; cursor: pointer; padding: 0;
  box-shadow: 0 3px 10px rgba(var(--shadow), .13);
  transition: transform .15s;
}
.map-pin:active { transform: translate(-50%, -50%) scale(.9); }
.map-pin.has-people { border-color: rgba(var(--primary-rgb), .55); }
.map-pin.me {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .3), 0 4px 14px rgba(var(--primary-rgb), .35);
}
.map-pin.me::after {
  content: ""; position: absolute; inset: -7px;
  border-radius: 18px; border: 2px solid var(--primary);
  animation: pinPulse 2s ease-out infinite;
}
@keyframes pinPulse {
  0% { opacity: .8; transform: scale(.86); }
  100% { opacity: 0; transform: scale(1.18); }
}
.pin-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--primary); color: var(--on-primary);
  font-size: 10px; line-height: 17px; font-weight: 700;
}

.place-icon {
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(var(--primary-rgb), .13); font-size: 21px;
}
.place-hero {
  display: flex; gap: 14px; align-items: center;
  padding: 16px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .22), rgba(var(--primary-rgb), .05));
  border: 1px solid var(--border);
}
.place-hero-icon { font-size: 42px; flex: 0 0 auto; }
.people-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.people-row::-webkit-scrollbar { display: none; }
.people-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; max-width: 74px;
}
.people-chip.on { border-color: rgba(var(--success-rgb), .5); background: rgba(var(--success-rgb), .08); }
.people-chip .tiny { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62px; }

/* ==========================================================================
   居民区住宿
   ========================================================================== */
.room-list { display: flex; flex-direction: column; gap: 6px; }
.room-row { display: flex; align-items: stretch; gap: 8px; }
.room-floor {
  width: 34px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-3); font-weight: 600;
  border-right: 1px dashed var(--border);
}
.room-cell {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer; text-align: left;
  transition: background .14s, border-color .14s;
}
.room-cell:active { transform: scale(.98); }
.room-cell.taken { background: var(--surface-3); cursor: not-allowed; }
.room-cell.mine { border-color: var(--primary); background: rgba(var(--primary-rgb), .16); }
.room-code { font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.room-who { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.room-who.dim { color: var(--text-3); }

/* ==========================================================================
   抽奖
   ========================================================================== */
.lottery-card {
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(var(--primary-rgb), .2), rgba(var(--primary-rgb), .04));
  text-align: center;
}
.dice-stage { display: flex; justify-content: center; }
.dice { display: inline-flex; }
/* CSS 骰面：3×3 网格摆点数，跟随主题变色 */
.dice-face {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 104px; height: 104px;
  padding: 12px; gap: 2px;
  border-radius: 20px;
  background: var(--surface);
  border: 2px solid var(--primary);
  box-shadow: 0 8px 26px rgba(var(--primary-rgb), .35), inset 0 0 0 4px rgba(var(--primary-rgb), .07);
}
.dice-face.sm {
  width: 30px; height: 30px; padding: 4px; gap: 1px;
  border-radius: 8px; border-width: 1.5px; box-shadow: none;
}
.pip-cell { display: flex; align-items: center; justify-content: center; }
.pip {
  width: 76%; height: 76%;
  border-radius: 50%;
  background: var(--primary-2);
  box-shadow: inset 0 -1px 1px rgba(0,0,0,.16);
}
.dice-face.sm .pip { width: 82%; height: 82%; }
.dice.pop { animation: dicePop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes dicePop {
  0% { transform: scale(.6) rotate(-18deg); }
  60% { transform: scale(1.12) rotate(6deg); }
  100% { transform: none; }
}
.dice-mini { font-size: 22px; line-height: 1; color: var(--primary-2); flex: 0 0 auto; }
.lottery-table { display: flex; flex-direction: column; }
.lottery-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px dashed var(--border);
}
.lottery-row:last-child { border-bottom: none; }
.lottery-row.hit { background: rgba(var(--primary-rgb), .1); border-radius: var(--radius-sm); padding-left: 8px; }

/* ==========================================================================
   姻缘树
   ========================================================================== */
.marriage-hero {
  text-align: center; padding: 22px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(var(--primary-rgb), .2), rgba(var(--primary-rgb), .04));
}
.mtree { font-size: 52px; display: inline-block; animation: treeSway 5s ease-in-out infinite; }
@keyframes treeSway {
  0%, 100% { transform: rotate(-2.5deg); }
  50% { transform: rotate(2.5deg); }
}
.mtree-text {
  margin-top: 12px; font-size: 12.5px; line-height: 1.9;
  color: var(--text-2); text-align: left;
  padding: 12px; border-radius: var(--radius-sm);
  background: rgba(var(--primary-rgb), .07);
}
/* ==========================================================================
   装到桌面（PWA）
   ========================================================================== */
.install-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid rgba(var(--primary-rgb), .35);
  box-shadow: 0 10px 30px rgba(var(--shadow), .22);
  animation: installIn .35s cubic-bezier(.2, 1.1, .4, 1);
}
@keyframes installIn {
  from { transform: translateY(18px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.install-icon {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(var(--primary-rgb), .16);
  color: var(--primary-2);
}
.install-help { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 4px; }
.install-step {
  padding: 11px 13px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
}
.install-step.hi { border-color: rgba(var(--primary-rgb), .5); background: rgba(var(--primary-rgb), .09); }
.install-step.warn {
  border-color: rgba(200, 120, 60, .45);
  background: rgba(214, 140, 80, .1);
}
.install-step code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(var(--shadow), .09);
  word-break: break-all;
}
.install-step .tiny { margin-top: 4px; line-height: 1.65; color: var(--text-2); }

.marry-card { text-align: center; }
.heart-line { color: var(--danger); font-size: 19px; }

/* 全服名册：一对一行，简单的框框 */
.ledger { display: flex; flex-direction: column; gap: 8px; }
.ledger-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(var(--shadow), .05);
}
.ledger-pair {
  display: inline-flex; align-items: center; gap: 7px;
  min-width: 0; cursor: pointer;
}
.ledger-pair:active { opacity: .7; }
.ledger-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 5.5em;
}
.ledger-heart { color: var(--danger); font-size: 15px; flex: 0 0 auto; }
.ledger-time {
  margin-left: auto; flex: 0 0 auto;
  font-size: 11px; color: var(--text-3);
}


/* ==========================================================================
   抽签 / 抓阄 / 排序 / 分组 / 骰子任务
   ========================================================================== */
.draw-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.draw-card {
  padding: 13px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(var(--shadow), .06);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.draw-card:active { transform: scale(.985); box-shadow: 0 1px 8px rgba(var(--shadow), .12); }
.draw-emoji {
  font-size: 24px; flex: 0 0 auto;
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(var(--primary-rgb), .12);
}
.draw-title { font-weight: 700; font-size: 15px; line-height: 1.4; }
.draw-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.draw-meta.center { text-align: center; }
.draw-mine-ok { font-size: 12px; color: var(--primary-2); }
.draw-mine-todo { font-size: 12px; color: var(--danger); }

.draw-progress {
  height: 5px; border-radius: 3px; margin-top: 10px;
  background: rgba(var(--shadow), .09); overflow: hidden;
}
.draw-progress-bar {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, rgba(var(--primary-rgb), .75), rgba(var(--primary-rgb), 1));
  transition: width .3s ease;
}

.draw-hero {
  text-align: center; padding: 22px 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(var(--primary-rgb), .18), rgba(var(--primary-rgb), .04));
}
.draw-hero-icon { font-size: 44px; line-height: 1; }
.draw-hero-title { font-size: 19px; font-weight: 800; margin-top: 8px; }
.draw-note {
  margin-top: 12px; text-align: left; font-size: 12.5px; line-height: 1.8;
  color: var(--text-2); padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(var(--primary-rgb), .07);
}
.draw-result-big {
  font-size: 26px; font-weight: 800; color: var(--primary-2);
  margin: 6px 0 2px; letter-spacing: .02em;
}

.people { display: flex; flex-direction: column; }
.person {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px dashed var(--border);
}
.person:last-child { border-bottom: none; }
.person.me { background: rgba(var(--primary-rgb), .06); border-radius: var(--radius-sm); padding-left: 8px; padding-right: 8px; }
.person-result { flex: 0 0 auto; text-align: right; font-size: 13px; }

.seg {
  display: flex; gap: 4px; padding: 4px;
  border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border);
}
.seg-item {
  flex: 1; position: relative;
  border: none; background: none; cursor: pointer;
  padding: 8px 6px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  font-family: inherit;
}
.seg-item.active { background: var(--surface); color: var(--primary-2); box-shadow: 0 1px 4px rgba(var(--shadow), .12); }
.seg-item .tab-badge { top: 4px; right: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  font-family: inherit; transition: all .14s;
}
.chip.active {
  background: rgba(var(--primary-rgb), .16);
  border-color: rgba(var(--primary-rgb), .55);
  color: var(--primary-2);
}
.field-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin: 0 0 8px; }

.switch-row {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.switch-row input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary-2); }

.picked { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.pick-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px 4px 10px; border-radius: 999px;
  background: rgba(var(--primary-rgb), .15);
  color: var(--primary-2); font-size: 12.5px; font-weight: 600;
  cursor: pointer;
}
.pick-x { font-size: 10px; opacity: .65; }
.pick-list { max-height: 240px; overflow-y: auto; }
.pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 2px; border-bottom: 1px dashed var(--border); cursor: pointer;
}
.pick-row:last-child { border-bottom: none; }
.pick-plus { color: var(--primary-2); font-size: 16px; font-weight: 700; }

.notify-pop {
  position: fixed;
  left: 12px; right: 12px; top: 12px;
  z-index: 90;
  padding: 13px 14px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid rgba(var(--primary-rgb), .45);
  box-shadow: 0 12px 34px rgba(var(--shadow), .26);
  animation: notifyIn .32s cubic-bezier(.2, 1.1, .4, 1);
}
@keyframes notifyIn {
  from { transform: translateY(-16px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.notify-head { display: flex; align-items: flex-start; gap: 10px; }
.notify-icon {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(var(--primary-rgb), .16); font-size: 19px;
}
.notify-title { font-weight: 700; font-size: 14.5px; line-height: 1.45; }
.notify-actions { display: flex; gap: 8px; margin-top: 11px; }
.notify-actions .btn { flex: 1; }

/* ==========================================================================
   帖子投票 / 活动报名
   ========================================================================== */
.sub-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.sub-box .label { margin-top: 0; }

/* ---- 投票 ---- */
.poll-options { display: flex; flex-direction: column; gap: 8px; }
.poll-option {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  overflow: hidden;
  transition: border-color .15s;
}
.poll-option:active { transform: scale(.99); }
.poll-option.chosen { border-color: rgba(var(--primary-rgb), .65); }
.poll-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(var(--primary-rgb), .14);
  transition: width .35s ease;
  pointer-events: none;
}
.poll-option.chosen .poll-bar { background: rgba(var(--primary-rgb), .24); }
.poll-mark {
  position: relative; flex: 0 0 auto;
  width: 18px; text-align: center;
  color: var(--primary-2); font-weight: 800;
}
.poll-text { position: relative; }
.poll-count {
  position: relative; flex: 0 0 auto;
  font-size: 12px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.poll-voters { display: flex; flex-direction: column; gap: 5px; }
.poll-voter-row { display: flex; align-items: center; gap: 8px; }

/* ---- 活动报名 ---- */
.signup-list { display: flex; flex-direction: column; }
.signup-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--border);
}
.signup-row:last-child { border-bottom: none; }
.signup-row.me {
  background: rgba(var(--primary-rgb), .06);
  border-radius: var(--radius-sm);
  padding-left: 8px; padding-right: 8px;
}

/* ==========================================================================
   幸运儿抽奖
   ========================================================================== */
.lucky-card {
  background: linear-gradient(160deg, rgba(var(--primary-rgb), .2), rgba(var(--primary-rgb), .05));
  border-color: rgba(var(--primary-rgb), .4);
}
.lucky-title {
  font-size: 16px; font-weight: 800; text-align: center;
  color: var(--primary-2); margin-bottom: 14px;
}
.lucky-winners {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
}
.lucky-winner { text-align: center; width: 76px; }
.lucky-winner .avatar {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px rgba(var(--primary-rgb), .55);
  animation: luckyPop .5s cubic-bezier(.2, 1.5, .4, 1) backwards;
}
.lucky-winner:nth-child(2) .avatar { animation-delay: .09s; }
.lucky-winner:nth-child(3) .avatar { animation-delay: .18s; }
.lucky-winner:nth-child(4) .avatar { animation-delay: .27s; }
.lucky-winner:nth-child(5) .avatar { animation-delay: .36s; }
@keyframes luckyPop {
  from { transform: scale(.4); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.lucky-win {
  background: linear-gradient(160deg, rgba(var(--primary-rgb), .22), rgba(var(--primary-rgb), .06));
  border-color: rgba(var(--primary-rgb), .45);
}
.lucky-win .draw-result-big { font-size: 22px; }
