/* 挽忆信息 · 客户端样式
   桌面：左侧固定导航 + 内容区
   手机：顶部标题栏 + 底部 Tab（中间凸起新建）
   与官网共用一套视觉：暖纸面、发丝边框、品牌蓝只给关键动作 */
:root {
  --bg: #f7f7f5;
  --surface: #fff;
  --surface-2: #fbfbf9;
  --ink: #14161b;
  --ink-2: #565b68;
  --ink-3: #8e939f;
  --line: #e7e7e2;
  --line-2: #efefeb;
  --blue: #4f6bed;
  --blue-wash: #eef1fe;
  --orange: #d4642a;
  --green: #2f8f5b;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --sh-1: 0 1px 2px rgba(16, 20, 30, .05);
  --sh-2: 0 6px 20px rgba(16, 20, 30, .07);
  --sh-3: 0 20px 60px rgba(16, 20, 30, .14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Consolas, monospace;
  --tab-h: 58px;
  --top-h: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------------- 骨架布局 ---------------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}
.rail-brand { display: flex; align-items: center; gap: 9px; padding: 2px 8px 0; }
.rail-brand img { width: 26px; height: 26px; border-radius: 7px; }
.rail-brand span { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }

.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-nav a {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 10px; border-radius: 9px;
  color: var(--ink-2); font-size: 13.5px;
  transition: background .16s ease, color .16s ease;
}
.rail-nav a svg { width: 17px; height: 17px; opacity: .78; }
.rail-nav a:hover { background: #f1f1ee; color: var(--ink); }
.rail-nav a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--sh-1); }
.rail-nav a.on svg { opacity: 1; color: var(--blue); }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.rail-account {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); text-align: left;
  transition: border-color .16s ease;
}
.rail-account:hover { border-color: #d6d6d0; }
.rail-account-text { display: flex; flex-direction: column; min-width: 0; }
/* 导航项按会员态显隐（工作台只给 VIP）：a 是 flex，不兜住 [hidden] 会盖掉 */
.rail-nav a[hidden] { display: none !important; }
.rail-name { display: flex; align-items: center; gap: 5px; min-width: 0; }
.rail-account-text b { min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-account-text i { font-style: normal; font-size: 11px; color: var(--ink-3); }
.rail-dl { font-size: 12px; color: var(--ink-3); padding: 0 10px; }
.rail-dl:hover { color: var(--ink); }

.avatar {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(140deg, #6f86f5, #4059d6); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; letter-spacing: 0; overflow: hidden;
  background-size: cover; background-position: center;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: var(--top-h); padding: 0 clamp(16px, 3.4vw, 40px);
  background: rgba(247, 247, 245, .86);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: #efefeb; }
.avatar-btn { border: none; background: none; padding: 0; display: inline-flex; }

.view { padding: clamp(18px, 2.6vw, 34px) clamp(16px, 3.4vw, 40px) 96px; max-width: 1180px; width: 100%; }

/* ---------------- 基础组件 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 500;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.btn:hover { border-color: #cfcfc9; }
.btn:active { transform: translateY(1px); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; border-color: #000; }
.btn-blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-blue:hover { background: #3f59d8; border-color: #3f59d8; }
.btn-danger { color: #b23c2a; border-color: #eddfdb; background: #fdf6f4; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #efefeb; color: var(--ink); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px;
}
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.card-head .more { font-size: 12.5px; color: var(--ink-3); }
.card-head .more:hover { color: var(--ink); }

.muted { color: var(--ink-3); font-size: 12.5px; }
.hint { color: var(--ink-3); font-size: 12.5px; line-height: 1.8; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { margin-left: auto; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 30px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; display: inline-flex; align-items: center;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11px; color: var(--ink-2);
}
.badge.blue { background: var(--blue-wash); border-color: #dfe5fd; color: #3550c8; }
.badge.green { background: #eef7f1; border-color: #dcece2; color: #2c7d51; }
.badge.orange { background: #fdf3ec; border-color: #f3e2d5; color: #b1552a; }

/* ---------------- 概览 ---------------- */
.hero-card {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 24px 24px 22px;
  background:
    radial-gradient(30rem 16rem at 92% -30%, rgba(79, 107, 237, .12), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
}
.hero-card .greet { font-size: 13px; color: var(--ink-3); }
.hero-card h2 { margin: 8px 0 0; font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; letter-spacing: -.02em; }
.hero-card h2 em { font-style: normal; color: var(--blue); }
.hero-card .sub { margin-top: 8px; color: var(--ink-2); font-size: 13px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* 电脑端 banner：文案在左、动作在右并排一行（.hero-actions-inline 去掉顶部间距，交给 flex 居中） */
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.hero-copy { min-width: 0; }
.hero-actions-inline { flex: none; flex-wrap: nowrap; margin-top: 0; }
.hero-actions-inline > .btn { height: 38px; padding: 0 18px; white-space: nowrap; }
/* 窗口拉窄时折到文案下面，左右铺开，避免按钮被挤成两行字 */
@media (max-width: 900px) {
  .hero-row { flex-direction: column; align-items: stretch; gap: 16px; }
  .hero-actions-inline { width: 100%; }
  .hero-actions-inline > .btn { flex: 1 1 0; }
}

.stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0; margin-top: 14px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden;
}
.stat { padding: 18px 18px 16px; }
.stat + .stat { border-left: 1px solid var(--line-2); }
.stat b { display: block; font-family: var(--mono); font-weight: 400; font-size: 22px; letter-spacing: -.02em; }
.stat span { display: block; margin-top: 4px; font-size: 11.5px; color: var(--ink-3); letter-spacing: .04em; }

.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.quick {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  padding: 16px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.quick:hover { border-color: #d3d3cd; transform: translateY(-2px); box-shadow: var(--sh-2); }
.quick i {
  width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-wash); color: #3b55cf;
}
.quick b { font-size: 13px; font-weight: 600; }
.quick span { font-size: 11.5px; color: var(--ink-3); }

/* ---------------- 活动列表 ---------------- */
.list-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
/* 「记录」并入「活动」后的总量概览：共 N 场 · 记录 M 条 */
.list-sum { margin: -4px 2px 12px; font-size: 12.5px; color: var(--ink-3); }
.list-sum span { margin-left: 8px; opacity: .72; }
.search {
  flex: 1 1 220px; min-width: 180px; height: 36px;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.search svg { width: 15px; height: 15px; color: var(--ink-3); }
.search input { flex: 1; border: none; outline: none; background: transparent; font-size: 13px; }

.act-list { display: flex; flex-direction: column; gap: 10px; }
.act {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px; align-items: center;
  padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.act:hover { border-color: #d3d3cd; box-shadow: var(--sh-2); transform: translateY(-1px); }
.act-ico {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #3b55cf; background: var(--blue-wash);
}
.act-ico.t-survey { color: #2c7d51; background: #eef7f1; }
.act-ico.t-checkin { color: #b1552a; background: #fdf3ec; }
.act-ico.t-draw, .act-ico.t-wheel { color: #6b4bb5; background: #f3f0fd; }
.act-main { min-width: 0; }
.act-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.act-title b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-meta { margin-top: 3px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-3); }
.act-right { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.act-right .num { font-family: var(--mono); font-size: 15px; color: var(--ink); }
.act-right .num span { font-family: var(--font); font-size: 11px; color: var(--ink-3); margin-left: 2px; }

/* ---------------- 回收站 ---------------- */
.trash-top {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 0 0 14px; flex-wrap: wrap;
}
.trash-note { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--ink-3); }
.trash-note b { color: var(--ink-2); }
/* 行内不放链接，悬停不做上浮（它不是可点进去的活动） */
.act.trash-row:hover { transform: none; box-shadow: none; border-color: var(--line); }
.trash-acts { display: flex; align-items: center; gap: 8px; }
.btn-ghost.danger { color: #c0392b; }
.btn-ghost.danger:hover { background: #fdeceb; color: #a5301f; }
/* 剩 3 天以内：时间那行标红，提醒该恢复了 */
.act.trash-row.soon .act-meta { color: #c0392b; }
@media (max-width: 640px) {
  .act.trash-row { grid-template-columns: 38px minmax(0, 1fr); row-gap: 10px; padding: 13px 14px; }
  .act.trash-row .trash-acts { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ---------------- 详情 ---------------- */
.detail-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.detail-head h2 { margin: 0; font-size: clamp(18px, 2vw, 22px); font-weight: 600; letter-spacing: -.02em; }
.detail-main { min-width: 0; flex: 1 1 320px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.detail-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-acts .btn { height: 34px; }
.detail-acts .btn.del { color: #b23c2a; }
.detail-desc {
  margin: 14px 0 0; font-size: 13px; line-height: 1.7; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 640px) {
  .detail-acts { width: 100%; }
  .detail-acts .btn { flex: 1 1 0; justify-content: center; }
}
.detail-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--ink-3); }

.kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); word-break: break-word; }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.rec { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.rec th, table.rec td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.rec th { font-weight: 500; color: var(--ink-3); font-size: 11.5px; letter-spacing: .04em; background: var(--surface-2); }
table.rec tbody tr:last-child td { border-bottom: none; }

.empty {
  padding: 40px 20px; text-align: center; color: var(--ink-3);
  border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--surface-2);
}
.empty b { display: block; color: var(--ink-2); font-weight: 600; margin-bottom: 4px; }

/* ---------------- 表单 ---------------- */
.form { display: grid; gap: 16px; max-width: 640px; }
.field { display: grid; gap: 7px; }
.field > label { font-size: 12.5px; color: var(--ink-2); }
.field .ctrl, .modal-card .ctrl {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font-size: 14px; color: var(--ink); outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea.ctrl { height: auto; min-height: 92px; padding: 11px 13px; resize: vertical; line-height: 1.7; }
.field .ctrl:focus, .modal-card .ctrl:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79, 107, 237, .12); }

/* 内容审核不通过：把出问题的输入框标红并轻轻抖一下，2.4s 后自动恢复 */
.field-bad > label { color: #c0392b; }
.field-bad .ctrl {
  border-color: #d64545;
  box-shadow: 0 0 0 3px rgba(214, 69, 69, .14);
  animation: fieldBad .28s ease 2;
}
@keyframes fieldBad {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button {
  height: 38px; padding: 0 15px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13px;
}
.seg button.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }

/* ---------------- 积分 ---------------- */
.points-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.points-main { min-width: 0; }
.points-num { font-family: var(--mono); font-size: clamp(34px, 5vw, 46px); line-height: 1; letter-spacing: -.03em; }
.points-num span { font-family: var(--font); font-size: 13px; color: var(--ink-3); margin-left: 6px; }
/* 会员态 / 连续签到 / 累计签到：一行说完，别用三行小字把卡片撑高 */
.points-meta { display: flex; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.points-meta > span { display: inline-flex; align-items: center; }
.points-meta > span + span::before { content: '·'; margin: 0 8px; color: #d8d8d2; }
.points-meta b { font-family: var(--mono); font-weight: 600; color: var(--ink-2); margin: 0 2px; }
.points-meta .pts-vip {
  font-size: 11px; font-weight: 600; color: #7a5a12; padding: 2px 6px; border-radius: 5px;
  background: linear-gradient(135deg, #f7e7bd, #e8c46a);
}
.sign-list { display: flex; flex-direction: column; }
.sign-item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.sign-item:last-child { border-bottom: none; }
.sign-item .d { width: 66px; color: var(--ink-3); font-size: 12px; font-family: var(--mono); }
.sign-item .p { margin-left: auto; font-family: var(--mono); color: var(--green); }
.sign-item .p.out { color: var(--orange); }

/* 我的排名：整张卡是一个链接，点哪儿都进榜单 */
.rk-mine {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; transition: background .16s ease, border-color .16s ease;
}
.rk-mine:hover { background: var(--surface-2); border-color: #d9d9d3; }
.rk-mine-idx { flex: none; min-width: 68px; font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.rk-mine-txt { display: flex; flex-direction: column; min-width: 0; }
.rk-mine-txt b { font-size: 13px; font-weight: 600; }
.rk-mine-txt span { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-go { margin-left: auto; font-style: normal; font-size: 15px; color: var(--ink-3); }
.rk-mine:hover .rk-go { color: var(--ink); }

/* 榜单行：名次 / 头像 / 昵称 / 积分 四列网格，手机窄屏也不挤 */
.rk-list { display: flex; flex-direction: column; }
.rk-row {
  display: grid; grid-template-columns: 22px 30px minmax(0, 1fr) auto;
  align-items: center; gap: 10px;
  padding: 9px 6px; border-radius: 10px; font-size: 13px;
}
.rk-row + .rk-row { margin-top: 2px; }
.rk-row.is-me { background: var(--blue-wash); }
.rk-badge {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  color: var(--ink-3); background: #f2f2ee;
}
.rk-badge.r1 { color: #7a5a12; background: linear-gradient(140deg, #fbeec6, #e8c46a); }
.rk-badge.r2 { color: #5b6068; background: linear-gradient(140deg, #f1f2f4, #ccd1d9); }
.rk-badge.r3 { color: #7a4a28; background: linear-gradient(140deg, #f7e2d2, #dcae8a); }
.rk-av {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #8f9bd6, #5b6bb0); color: #fff;
  font-size: 12px; font-weight: 600;
}
.rk-av.has-img { background: #efefec; }
.rk-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rk-name { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rk-row.r1 .rk-name, .rk-row.r2 .rk-name, .rk-row.r3 .rk-name { font-weight: 600; }
.rk-me {
  flex: none; font-style: normal; font-size: 10px; line-height: 1;
  padding: 2px 4px; border-radius: 4px; background: var(--blue); color: #fff;
}
.rk-pts { font-family: var(--mono); font-size: 13.5px; font-weight: 600; }
.rk-pts i { font-style: normal; font-size: 10.5px; font-weight: 400; color: var(--ink-3); margin-left: 2px; }
/* 自己不在前 5 时补在末尾的一行：虚线隔开，说明这是「我」而不是第 6 名 */
.rk-row-out { margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); border-radius: 0 0 10px 10px; }

/* 排行榜页头：名次 + 积分并列，是一屏里最想看到的两件事 */
.rk-hero { padding: 18px 20px; }
.rk-hero-me { display: flex; align-items: flex-end; gap: 16px; }
.rk-hero-lb { display: block; font-size: 11.5px; letter-spacing: .06em; color: var(--ink-3); }
.rk-hero-idx { display: block; margin-top: 5px; font-size: clamp(20px, 3vw, 26px); font-weight: 600; letter-spacing: -.02em; }
.rk-hero-pts { margin-left: auto; text-align: right; }
.rk-hero-pts b { font-family: var(--mono); font-size: clamp(24px, 3.4vw, 30px); line-height: 1; }
.rk-hero-pts span { display: block; margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.rk-hero-note { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }

/* 积分页底部的两个去处：明细 / 权益 */
.pts-links { padding: 6px; }
.pts-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; }
.pts-link:hover { background: var(--surface-2); }
.pts-link + .pts-link { border-top: 1px solid var(--line-2); border-radius: 0 0 12px 12px; }
.pts-link-ic {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-wash); color: var(--blue); font-size: 15px; font-weight: 600;
}
.pts-link > div { display: flex; flex-direction: column; min-width: 0; }
.pts-link b { font-size: 13.5px; font-weight: 600; }
.pts-link > div span { font-size: 11.5px; color: var(--ink-3); }
.pts-link > i { margin-left: auto; font-style: normal; color: var(--ink-3); }

/* 积分明细页：顶部三个数字 + 按日期分组 */
.pts-stat { display: flex; }
.pts-stat > div { flex: 1 1 0; min-width: 0; text-align: center; }
.pts-stat > div + div { border-left: 1px solid var(--line-2); }
.pts-stat b { display: block; font-family: var(--mono); font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.pts-stat b.in { color: var(--green); }
.pts-stat b.out { color: var(--orange); }
.pts-stat span { display: block; margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.pl-group + .pl-group { margin-top: 4px; }
.pl-day { padding: 14px 2px 2px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.pl-tag {
  flex: none; width: 18px; height: 18px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; background: #eaf6ef; color: var(--green);
}
.pl-tag.out { background: #fbeee7; color: var(--orange); }
.pl-desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .rk-mine { padding: 13px 14px; gap: 10px; }
  .rk-mine-idx { min-width: 56px; font-size: 14px; }
  .rk-row { grid-template-columns: 20px 28px minmax(0, 1fr) auto; gap: 8px; padding: 8px 4px; }
  .rk-av { width: 28px; height: 28px; font-size: 11px; }
  .rk-hero-pts b { font-size: 24px; }
  .pts-stat b { font-size: 18px; }
}

/* ---------------- 我的 ---------------- */
.me-card { display: flex; align-items: center; gap: 16px; }
.me-card .avatar { width: 56px; height: 56px; font-size: 20px; }
.me-card h2 { margin: 0; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 昵称后的 VIP 小标：金色胶囊，仅会员有效期内显示 */
.vip-badge {
  flex: none; display: inline-flex; align-items: center;
  font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .4px; line-height: 1;
  padding: 2px 5px; border-radius: 5px; color: #7a5a12;
  background: linear-gradient(135deg, #f7e7bd, #e8c46a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 1px 2px rgba(122, 90, 18, .12);
}
.vip-badge[hidden] { display: none !important; }
.me-card h2 .vip-badge { font-size: 10.5px; padding: 3px 6px; border-radius: 6px; }

/* 顶部卡：资料 → 积分条（唯一入口）→ 操作行，自上而下一条线 */
.me-top .me-card { padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.me-stats {
  display: flex; align-items: stretch;
  margin-top: 16px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
}
.me-stat { flex: 1 1 0; min-width: 0; padding: 13px 16px; }
.me-stat + .me-stat { border-left: 1px solid var(--line-2); }
.me-stat b {
  display: block; font-family: var(--mono); font-weight: 400;
  font-size: 20px; line-height: 1.3; letter-spacing: -.02em;
}
.me-stat span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--ink-3); letter-spacing: .04em; }
/* 右格「设置」是入口，不是数据：字号收一档、带箭头，hover 有反馈 */
.me-stat-go { display: block; text-decoration: none; color: var(--ink); transition: background .16s ease; }
.me-stat-go:hover { background: var(--surface-2); }
.me-stat-go b { display: flex; align-items: center; gap: 2px; font-family: inherit; font-size: 15px; font-weight: 600; }
.me-stat-go b i { font-style: normal; color: var(--ink-3); font-size: 14px; transform: translateY(-1px); }

/* 我的：入口网格（我的消息 / 意见反馈 / 应用介绍 / 退出登录），两列均分 */
.me-acts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
}
.me-act {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 12px 14px; border: none; background: none;
  font-size: 13px; color: var(--ink-2); text-align: left;
}
.me-act::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line-2); }
.me-act:nth-child(odd)::before { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 1px; background: var(--line-2); }
.me-act:hover { background: var(--surface-2); }
.me-act b { font-weight: 400; }
.me-act i { font-style: normal; color: var(--ink-3); font-size: 12px; }
.me-act.danger { color: var(--orange); }
.me-act-r { display: inline-flex; align-items: center; gap: 6px; }
.me-act .me-unread {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--orange); color: #fff; font-size: 11px; line-height: 1;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .me-top .me-card { gap: 12px; }
  .me-stat { padding: 12px 14px; }
}

/* ---------------- 骨架 / 空 / 弹层 ---------------- */
.skeleton-wrap { display: grid; gap: 14px; }
.sk { border-radius: var(--r-md); background: linear-gradient(90deg, #efefeb 25%, #f6f6f3 37%, #efefeb 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; }
.sk-title { height: 22px; width: 180px; }
.sk-card { height: 120px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.modal {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-start; justify-content: center;
  padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.modal-mask { position: absolute; inset: 0; background: rgba(10, 12, 17, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-card {
  position: relative; width: 100%; max-width: 388px; background: var(--surface);
  border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--sh-3);
  padding: 28px 26px 22px; margin: auto 0;   /* 空间够时居中，不够时可滚动、顶到上面不被裁 */
}
.modal-card h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.modal-sub { margin: 6px 0 18px; color: var(--ink-3); font-size: 12.5px; line-height: 1.7; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border: none; background: none; color: var(--ink-3); font-size: 14px; }
.qr-box { position: relative; width: 208px; height: 208px; margin: 0 auto; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.qr-box img { width: 208px; height: 208px; display: block; }
.qr-skeleton { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--surface-2); }
.qr-skeleton span { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #dedede; border-top-color: var(--ink-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.qr-mask { position: absolute; inset: 0; background: rgba(255, 255, 255, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.qr-mask p { margin: 0; font-size: 13px; color: var(--ink-2); }
.login-status { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 16px; font-size: 12.5px; color: var(--ink-2); }
.login-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.login-status.on .dot { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.login-steps { margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line-2); list-style: none; display: grid; gap: 7px; }
.login-steps li { display: flex; gap: 9px; font-size: 12px; color: var(--ink-3); }
.login-steps i { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em; padding-top: 1px; }
/* 手机端：存图后去微信「扫一扫 → 相册」识别 */
.login-save { width: 100%; margin-top: 14px; }
.login-save[disabled] { opacity: .5; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 26px); transform: translateX(-50%) translateY(10px);
  z-index: 120; max-width: min(90vw, 420px);
  padding: 11px 18px 11px 31px; border-radius: 999px;
  background: rgba(20, 22, 27, .94); color: #fff; font-size: 13px; line-height: 1.5;
  box-shadow: 0 8px 24px rgba(10, 12, 17, .22);
  opacity: 0; transition: opacity .2s ease, transform .2s ease; pointer-events: none;
}
/* 左侧状态点：成功绿 / 失败红 / 其余中性灰，省得每条提示都要塞「成功」「失败」两个字 */
.toast::before {
  content: ''; position: absolute; left: 15px; top: 50%; width: 6px; height: 6px;
  border-radius: 50%; background: rgba(255, 255, 255, .5); transform: translateY(-50%);
}
.toast.ok::before { background: #64d69a; }
.toast.err::before { background: #ff8272; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 站内新消息提醒 ----------------
   不依赖系统通知权限（http 纯 IP 拿不到），有新消息就浮一张卡：
   图标 + 「新消息 · N 条」+ 首条标题与正文，点开直达消息页，右上角可关。
   桌面贴右上角（避开顶栏），手机贴顶部通栏。 */
.msg-alert {
  position: fixed; top: 18px; right: 18px; z-index: 125;
  width: 344px; display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 12px 14px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 46px rgba(16, 20, 30, .16), 0 2px 6px rgba(16, 20, 30, .05);
  cursor: pointer; opacity: 0; transform: translateY(-10px) scale(.985);
  transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .3, 1),
              border-color .18s ease;
}
.msg-alert:hover { border-color: #dcdcd5; }
.msg-alert.on { opacity: 1; transform: none; }
.msg-alert-ic {
  flex: none; width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-wash); color: var(--blue);
}
.msg-alert-ic svg { width: 19px; height: 19px; stroke-width: 1.6; }
.msg-alert-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.msg-alert-hd { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-3); }
.msg-alert-hd b { font-size: 12px; font-weight: 600; color: var(--blue); letter-spacing: .01em; }
.msg-alert-hd time { margin-left: auto; }
.msg-alert-n {
  font-style: normal; font-size: 10.5px; line-height: 16px; padding: 0 6px;
  border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
}
.msg-alert-tt {
  font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg-alert-bd {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.msg-alert-x {
  flex: none; width: 24px; height: 24px; margin: -2px -2px 0 0;
  border: none; background: none; border-radius: 8px;
  color: var(--ink-3); font-size: 12px; line-height: 1;
}
.msg-alert-x:hover { background: var(--surface-2); color: var(--ink-2); }

@media (max-width: 780px) {
  .msg-alert { top: 10px; left: 10px; right: 10px; width: auto; }
}

/* ---------------- 应用内确认框 ----------------
   替掉浏览器原生 confirm：同一个遮罩、同一张卡、同一套按钮，
   在桌面壳里也不会突然冒出 Windows 系统弹窗。 */
.ask-mask {
  position: fixed; inset: 0; z-index: 140;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(12, 14, 20, .42);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .18s ease;
}
.ask-mask.on { opacity: 1; }
.ask-card {
  width: 100%; max-width: 332px; padding: 22px 22px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--sh-3);
  transform: translateY(8px) scale(.97);
  transition: transform .2s cubic-bezier(.2, .8, .3, 1);
}
.ask-mask.on .ask-card { transform: none; }
.ask-card h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.ask-card p { margin: 8px 0 0; font-size: 13px; line-height: 1.7; color: var(--ink-2); word-break: break-word; }
.ask-ops { display: flex; gap: 8px; margin-top: 20px; }
.ask-btn {
  flex: 1; height: 42px; border-radius: 12px; font-size: 13.5px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  transition: filter .15s ease;
}
.ask-btn:hover { filter: brightness(.975); }
.ask-btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 500; }
.ask-btn.danger { background: #c03a32; border-color: #c03a32; color: #fff; font-weight: 500; }
.ask-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------------- 桌面壳：新版本提示条 ----------------
   只在「安装包已经下好、就差重启」时出现，浮在顶部，不挡内容也不改布局。
   手机/浏览器没有 Electron 壳，这个元素根本不会被创建。 */
.upd-bar {
  position: fixed; top: 14px; left: 50%; z-index: 130;
  transform: translateX(-50%) translateY(-10px);
  display: flex; align-items: center; gap: 10px;
  max-width: min(92vw, 580px); padding: 9px 10px 9px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--sh-3);
  animation: updIn .22s ease forwards;
}
@keyframes updIn { to { transform: translateX(-50%) translateY(0); } }
.upd-icon {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
  background: var(--blue); box-shadow: 0 0 0 4px var(--blue-wash);
}
.upd-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.upd-text b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.upd-text i {
  font-style: normal; font-size: 12px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.upd-bar .btn { flex: 0 0 auto; }
@media (max-width: 720px) {
  .upd-bar { top: 10px; border-radius: var(--r-lg); padding: 8px 8px 8px 12px; }
  .upd-text i { display: none; }
}

/* ---------------- 底部 Tab ---------------- */
.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-top: 1px solid var(--line);
  transition: transform .2s ease, opacity .2s ease;
}
/* 键盘弹出时整条收下去：安卓 WebView 用 adjustResize，视口被压短后
   position:fixed bottom:0 的导航会被顶到键盘正上方，看着像"跟着键盘跑" */
body.kb-open .tabbar { transform: translateY(calc(100% + 8px)); opacity: 0; pointer-events: none; }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); font-size: 10.5px;
}
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on svg { color: var(--blue); }
.tabbar a.tab-fab { flex: none; width: 66px; }
.tabbar a.tab-fab svg {
  width: 42px; height: 42px; padding: 10px; border-radius: 50%;
  background: var(--ink); color: #fff; margin-top: -18px;
  box-shadow: 0 6px 18px rgba(16, 20, 30, .22);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .tabbar { display: flex; }
  .view { padding-bottom: calc(var(--tab-h) + 34px); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line-2); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .act { grid-template-columns: 40px minmax(0, 1fr); }
  .act-right { grid-column: 2; justify-content: flex-start; }
  .topbar h1 { font-size: 15px; }
  .toast { bottom: calc(var(--tab-h) + 20px); }
}
@media (max-width: 560px) {
  .hero-card { padding: 20px; }
  .card { padding: 16px; border-radius: 16px; }
  .modal-card { padding: 24px 20px 20px; max-width: 100%; }
  .qr-box, .qr-box img { width: 176px; height: 176px; }
  .kv { grid-template-columns: 76px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------- 登录页（未登录时整屏，进入应用的第一页） ---------------- */
body.is-guest .rail,
body.is-guest .topbar,
body.is-guest .tabbar { display: none !important; }
body.is-guest .shell { grid-template-columns: minmax(0, 1fr); }
body.is-guest .main { min-height: 100vh; }
body.is-guest .view {
  max-width: none; width: 100%; padding: 0;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}

/* 两步登录共用的壳：整屏时不画卡片边框，就浮在背景上，干净 */
.gate-page {
  width: 100%; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 24px;
}
.gate-card { width: 100%; max-width: 360px; text-align: center; }
.gate-body { display: flex; flex-direction: column; align-items: center; }
.gate-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 第一步：图标 + 名称 + 主按钮 + 勾选 */
.gate-logo { width: 76px; height: 76px; border-radius: 22px; box-shadow: 0 10px 30px rgba(16, 20, 30, .1); }
.gate-name { margin: 20px 0 0; font-size: 21px; font-weight: 600; letter-spacing: .01em; color: var(--ink); }
.gate-btn { width: 100%; height: 48px; margin-top: 42px; font-size: 15px; border-radius: 12px; }
.gate-btn[disabled] { opacity: .42; box-shadow: none; cursor: not-allowed; }
.gate-body > .qr-terms { margin-top: 16px; }

/* 第二步：只有码框 + 提醒 + 保存（手机） */
.gate-body-qr { padding-top: 4px; }
.gate-body-qr .qr-box { margin: 0 auto; background: #fff; border: 1px solid var(--line); }
.gate-body-qr .qr-box.lg { width: 200px; height: 200px; }
.gate-body-qr .qr-box.lg img { width: 200px; height: 200px; }
.gate-body-qr .qr-bar { width: 200px; }
.gate-save { width: 100%; max-width: 300px; height: 44px; margin: 20px auto 0; }
.gate-back {
  margin: 14px auto 0; padding: 6px 12px; border: 0; background: none;
  font-size: 12.5px; color: var(--ink-3); cursor: pointer;
}
.gate-back:active { color: var(--ink-2); }

@media (max-width: 560px) {
  .gate-page { padding: 84px 24px 40px; align-items: flex-start; }
  .gate-logo { width: 68px; height: 68px; border-radius: 20px; }
  .gate-name { font-size: 19px; margin-top: 16px; }
  .gate-btn { margin-top: 36px; }
  .gate-body-qr .qr-box.lg, .gate-body-qr .qr-box.lg img { width: 190px; height: 190px; }
  .gate-body-qr .qr-bar { width: 190px; }
}

/* 参与入口：活动小程序码 */
.code-box { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-top: 14px; }
.code-img {
  width: 176px; height: 176px; flex: 0 0 auto; border-radius: var(--r-md);
  border: 1px solid var(--line); background: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.code-img img { width: 100%; height: 100%; display: block; object-fit: contain; }
.code-fail {
  display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center;
  padding: 12px; text-align: center; font-size: 12px; color: var(--ink-3); line-height: 1.6;
}
.code-tip { flex: 1 1 240px; min-width: 220px; }
.code-tip b { display: block; font-size: 14px; margin-bottom: 6px; }
.code-tip p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.code-tip p.muted { color: var(--ink-3); font-size: 12px; }
@media (max-width: 560px) {
  .code-box { gap: 12px; }
  .code-img { width: 150px; height: 150px; margin: 0 auto; }
  .code-tip { flex: 1 1 100%; min-width: 0; }
}

/* ================= 概览 · 日历 ================= */
.cal-card { margin-top: 14px; }
.cal-head { margin-bottom: 12px; align-items: center; }
.cal-sub { margin-left: 8px; font-size: 11.5px; font-weight: 400; color: var(--ink-3); }
.cal-nav { display: flex; align-items: center; gap: 2px; }
.cal-month { font-size: 12.5px; font-weight: 600; min-width: 86px; text-align: center; font-variant-numeric: tabular-nums; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 22px; align-items: start; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 11px; color: var(--ink-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day {
  position: relative; aspect-ratio: 1 / 1; min-height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 10px; background: transparent;
  font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.cal-day.blank { pointer-events: none; }
.cal-day:hover { background: var(--surface-2); border-color: var(--line); }
.cal-day.has { color: var(--ink); font-weight: 600; background: var(--blue-wash); }
.cal-day.today { border-color: var(--line); }
.cal-day.sel { background: var(--ink); color: #fff; border-color: var(--ink); }
.cal-day.sel .dot { background: #fff; color: var(--ink); }
.cal-day .dot {
  position: absolute; top: 3px; right: 3px; min-width: 13px; height: 13px; padding: 0 3px;
  border-radius: 999px; background: var(--blue); color: #fff;
  font-size: 9px; line-height: 13px; text-align: center; font-weight: 600;
}
.cal-side { min-width: 0; }
.cal-side-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.cal-side-head b { font-size: 13px; }
.cal-side-head .muted { font-size: 12px; color: var(--ink-3); }
.cal-hint { padding: 18px; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-3); font-size: 12.5px; line-height: 1.8; }
.act-list.compact .act { padding: 9px 0; }
.act-list.compact .act:first-child { padding-top: 0; }
.empty.sm { padding: 22px 16px; font-size: 12.5px; }

/* ================= 工作台 ================= */
.wb-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.wb-top h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.02em; }
.wb-top p { margin: 0; font-size: 12.5px; }
.wb-top-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.wb-chips { margin-bottom: 12px; }
.file-list { display: flex; flex-direction: column; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.file-row:last-child { border-bottom: none; }
.file-ico {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: #eef7f1; color: #2c7d51; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .02em;
}
.file-main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-main b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 11.5px; color: var(--ink-3); }
.file-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-select {
  height: 30px; padding: 0 24px 0 9px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); font-size: 12px; color: var(--ink-2); outline: none;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 13px) 13px, calc(100% - 9px) 13px;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
}
.tpl-list { display: flex; flex-direction: column; }
.tpl-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.tpl-fields { padding: 4px 0 14px; border-bottom: 1px solid var(--line-2); }
.tpl-card { margin-top: 14px; }
.map-table { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-top: 10px; }
.map-head, .map-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 10px; align-items: center; padding: 8px 12px; }
.map-head { background: var(--surface-2); font-size: 11.5px; color: var(--ink-3); }
.map-row { border-top: 1px solid var(--line-2); font-size: 12.5px; }
.map-row .mini-select { width: 100%; }
.check { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }

/* ================= 表格编辑器 ================= */
.file-head { padding-bottom: 14px; }
.file-head-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-name { max-width: 340px; height: 38px; font-size: 15px; font-weight: 600; }
.file-dirty { font-size: 11.5px; color: var(--orange); }
.xl-card { padding-left: 0; padding-right: 0; }
.xl-tabs { display: flex; gap: 2px; padding: 0 16px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.xl-tabs::-webkit-scrollbar { display: none; }
.xl-tab {
  flex: none; padding: 9px 12px; border: none; background: none;
  border-bottom: 2px solid transparent; color: var(--ink-3); font-size: 12.5px;
}
.xl-tab.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.xl-tab.add { color: var(--ink-3); }
.xl-tab.del { margin-left: auto; color: var(--ink-3); }
.xl-toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 16px; flex-wrap: wrap; }
.xl-wrap { overflow: auto; max-height: 62vh; border-top: 1px solid var(--line-2); }
table.xl { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 12.5px; }
table.xl th, table.xl td {
  min-width: 118px; max-width: 280px; padding: 7px 10px;
  border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  text-align: left; vertical-align: top; outline: none; word-break: break-word;
}
table.xl th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-weight: 600; color: var(--ink-2); }
table.xl td { background: var(--surface); }
table.xl th:focus, table.xl td:focus { box-shadow: inset 0 0 0 2px var(--blue); background: #fbfcff; }
table.xl .rn { min-width: 44px; width: 44px; text-align: center; color: var(--ink-3); background: var(--surface-2); font-family: var(--mono); font-size: 11px; }
table.xl .col-end { min-width: 40px; width: 40px; border-right: none; text-align: center; }
table.xl .xl-empty { color: var(--ink-3); text-align: center; padding: 28px 10px; }
.row-del { width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-3); line-height: 1; }
.row-del:hover { border-color: #e8c8c2; color: #b4462f; }

/* 分析 */
.an-card { margin-top: 14px; }
.an-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.an-kpi { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; background: var(--surface-2); }
.an-kpi b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.an-kpi span { font-size: 11.5px; color: var(--ink-3); }
.an-list { display: grid; gap: 10px; }
.an-col { border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 13px; }
.an-col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.an-col-head b { font-size: 12.5px; }
.an-col-head .muted { font-size: 11px; color: var(--ink-3); }
.an-bar { position: relative; height: 18px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); overflow: hidden; }
.an-bar i { position: absolute; inset: 0 auto 0 0; background: var(--blue-wash); border-right: 1px solid #dfe5fd; }
.an-bar span { position: relative; display: block; font-size: 10.5px; line-height: 16px; padding: 0 8px; color: var(--ink-2); }
.an-meta { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }

/* ================= 隐私 / 规范 ================= */
/* 我的页：隐私说明 / 应用使用规范——卡片下方的蓝色文字链接，点了开条款弹层（docModal） */
.me-docs {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin-top: 10px; padding: 2px 2px;
}
.me-docs a {
  font-size: 12.5px; color: var(--blue); text-decoration: none;
  border-bottom: 1px solid rgba(79, 107, 237, .35);
}
.me-docs a:hover { border-bottom-color: var(--blue); }

/* ---------------- 设置 ---------------- */
/* 一行一项：名称+说明在左，系统状态徽标与开关在右。行间用细分割线，不做卡片套卡片 */
.set-list { display: block; }
.set-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line-2);
}
.set-row:first-child { border-top: none; padding-top: 2px; }
.set-main { min-width: 0; flex: 1 1 auto; }
.set-main b { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.set-main span { display: block; margin-top: 3px; font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.set-badge {
  flex: none; font-style: normal; font-size: 11.5px; line-height: 1;
  padding: 5px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line-2);
  white-space: nowrap;
}
.set-badge.ok { background: #eaf7ee; border-color: #cdebd6; color: #23803f; }
.set-badge.warn { background: #fdf0e8; border-color: #f5d8c5; color: #b8590f; }
.set-badge.off { background: var(--surface-2); border-color: var(--line-2); color: var(--ink-3); }
.set-note { margin: 12px 0 0; font-size: 11.5px; line-height: 1.75; color: var(--ink-3); }

/* 开关：自绘，别用 checkbox——尺寸和配色在所有壳里一致 */
.switch {
  flex: none; position: relative; width: 44px; height: 26px; padding: 0;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--line);
  cursor: pointer; transition: background .16s ease, border-color .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.switch i {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(20, 24, 40, .18);
  transition: left .16s ease;
}
.switch[aria-checked="true"] { background: var(--blue); border-color: var(--blue); }
.switch[aria-checked="true"] i { left: 20px; }
.switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media (max-width: 900px) {
  .cal-layout { grid-template-columns: 1fr; gap: 14px; }
  .cal-grid { gap: 3px; }
  .cal-day { min-height: 34px; font-size: 12px; }
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-head, .map-row { grid-template-columns: minmax(0, 1fr) 140px; }
  .tabbar a { font-size: 9.5px; }
  .tabbar a.tab-fab { width: 54px; }
}
@media (max-width: 560px) {
  .cal-side-head { margin-top: 2px; }
  .cal-sub { display: none; }
  .cal-nav .btn { white-space: nowrap; flex: none; padding: 0 10px; }
  .cal-month { min-width: 0; }
  .file-acts { width: 100%; }
  .file-name { max-width: 100%; }
  .doc-body { padding-left: 12px; }
}

/* ================= 视图转场 / 动态登录码 ================= */
/* 进层从右轻推、返回从左轻收、切 Tab 只淡入：让人分得清「进」和「退」 */
.view.v-enter { animation: viewIn .2s cubic-bezier(.22, .61, .36, 1); }
.view.v-back { animation: viewBack .2s cubic-bezier(.22, .61, .36, 1); }
.view.v-tab { animation: viewFade .14s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translate3d(14px, 0, 0); } }
@keyframes viewBack { from { opacity: 0; transform: translate3d(-14px, 0, 0); } }
@keyframes viewFade { from { opacity: 0; } }

/* 二维码有效期进度条：只留一条 3px 细线，看得出「码会自己换新的」但不抢视线 */
.qr-bar {
  width: 208px; height: 3px; margin: 12px auto 0; border-radius: 999px;
  background: var(--line-2); overflow: hidden; transition: opacity .2s ease;
}
.qr-bar i {
  display: block; height: 100%; width: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), #7d92f2);
  transition: width 1s linear;
}
.qr-bar.off { opacity: 0; }
.qr-box img.swap { animation: qrSwap .34s ease; }
@keyframes qrSwap { from { opacity: .3; transform: scale(.983); } }

/* ================= 登录码安全提醒 ================= */
/* 贴在码下面，就是一句提醒，不加边框不加底色 */
.qr-warn {
  display: flex; align-items: flex-start; justify-content: center; gap: 6px;
  margin: 18px auto 0; max-width: 300px;
  color: #96703f; font-size: 12.5px; line-height: 1.6; text-align: left;
}
.qr-warn svg {
  width: 14px; height: 14px; flex: none; margin-top: 2px;
  fill: none; stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ================= 登录前必须勾选同意 ================= */
/* 勾选行：第一步贴在主按钮下方；点文字切换勾选，点书名号只看条款 */
.qr-terms {
  display: flex; align-items: flex-start; gap: 8px;
  width: 100%; max-width: 344px; margin: 12px auto 0;
  padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  text-align: left; font-size: 12px; line-height: 1.65; color: var(--ink-2);
  transition: border-color .18s ease, background .18s ease;
}
.qr-terms.on { background: #fff; border-color: #dfe3f6; }
.qr-terms.shake { animation: termsShake .3s ease; }
@keyframes termsShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  70% { transform: translateX(4px); }
}
.qr-terms input {
  flex: none; width: 15px; height: 15px; margin: 2px 0 0;
  accent-color: var(--blue); cursor: pointer;
}
.qr-terms-text { cursor: pointer; -webkit-user-select: none; user-select: none; }
.qr-terms-text a {
  color: var(--blue); text-decoration: none;
  border-bottom: 1px solid rgba(79, 107, 237, .35);
}
.qr-terms-text a:hover { border-bottom-color: var(--blue); }

/* 条款弹层：内容长，卡片自己撑高度并内部滚动 */
.modal.doc-modal { z-index: 100; }
.doc-modal .doc-card {
  display: flex; flex-direction: column;
  width: 100%; max-width: 520px; max-height: calc(100dvh - 40px);
  padding: 24px 24px 16px;
}
.doc-modal .doc-card h2 { font-size: 17px; padding-right: 28px; }
.terms-body {
  margin: 10px -4px 0; padding: 0 4px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  font-size: 12.5px; line-height: 1.85; color: var(--ink-2);
}
.terms-body h3 { margin: 14px 0 4px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.terms-body h3:first-child { margin-top: 2px; }
.terms-body p { margin: 0; }
.terms-body .doc-lead { margin: 0 0 8px; color: var(--ink-3); }
.terms-body ul { margin: 4px 0 0; padding-left: 16px; }
.terms-body li { margin: 2px 0; }
.terms-body b { color: var(--ink); font-weight: 600; }
.doc-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-2);
}
.doc-foot .btn { height: 36px; }

/* 登录弹层：顶上留出关闭按钮的位置，两步内容自己撑高度 */
#loginModal .modal-card.login-modal {
  max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 22px 22px 24px;
}
#loginModal .gate-card { max-width: 320px; margin: 0 auto; }
#loginModal .gate-logo { width: 62px; height: 62px; border-radius: 18px; }
#loginModal .gate-name { font-size: 19px; margin-top: 14px; }
#loginModal .gate-btn { margin-top: 26px; height: 44px; }
#loginModal .gate-body-qr .qr-box.lg,
#loginModal .gate-body-qr .qr-box.lg img { width: 188px; height: 188px; }
#loginModal .gate-body-qr .qr-bar { width: 188px; }
@media (max-width: 560px) {
  .doc-modal .doc-card { padding: 22px 18px 14px; border-radius: 18px; }
  .terms-body { font-size: 12px; }
  .qr-terms { font-size: 11.5px; padding: 9px 11px; }
}

/* ================= 手机端：不提供工作台 ================= */
/* 手机上不出现「工作台」入口（底部导航 / 侧栏都藏），路由层另有兜底：
   直接进 #/workbench、#/file 会被换成概览 */
body.is-phone [data-nav="workbench"] { display: none !important; }

/* 抽奖 / 转盘：徽标用紫色，与签到（橙）、问卷（蓝）区分 */
.badge.purple { background: #f3f0fd; border-color: #e4ddfa; color: #6b4bb5; }

/* ================= 新建活动：两列栅格 + 奖品格 ================= */
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-row > .field:only-child { grid-column: 1 / -1; }
.seg.seg-4 { gap: 6px; }
.seg.seg-4 button { flex: 1 1 0; min-width: 0; padding: 0 10px; }
#basicFields, #luckyFields { display: grid; gap: 16px; }
#basicFields[hidden], #luckyFields[hidden] { display: none; }
.slice-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.slice-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px 7px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 12.5px; color: var(--ink-2);
}
.slice-chip i {
  width: 17px; height: 17px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f3f0fd; color: #6b4bb5; font-style: normal; font-size: 10.5px;
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; gap: 16px; }
  .seg.seg-4 button { height: 36px; font-size: 12.5px; }
}

/* ================= 我的消息 ================= */
.msg-tools { display: flex; gap: 6px; }
.msg-list { display: grid; }
.msg-loading { padding: 30px 0; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.msg-item {
  position: relative; padding: 14px 14px 13px; border-top: 1px solid var(--line-2);
  cursor: pointer; transition: background .15s ease;
}
.msg-item:first-child { border-top: none; }
.msg-item:hover { background: var(--surface-2); }
.msg-top { display: flex; align-items: center; gap: 7px; }
.msg-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); flex: none; }
.msg-item.unread .msg-dot { background: var(--orange); }
.msg-tag {
  flex: none; padding: 1px 6px; border-radius: 5px;
  background: var(--blue-wash); color: #4056c6; font-size: 10.5px; line-height: 1.6;
}
.msg-top b {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg-item.unread .msg-top b { font-weight: 600; }
.msg-top time { flex: none; color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.msg-body {
  margin: 6px 0 0 13px; color: var(--ink-2); font-size: 12.5px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.msg-item.open .msg-body { display: block; overflow: visible; }
.msg-ops { display: none; justify-content: flex-end; margin: 8px 0 0 13px; }
.msg-item.open .msg-ops { display: flex; }
.msg-del { border: none; background: none; padding: 2px 4px; color: var(--ink-3); font-size: 11.5px; }
.msg-del:hover { color: var(--orange); }
.msg-foot { display: flex; justify-content: center; padding-top: 12px; }

/* 未读：左侧一道蓝线 + 极淡底色，比单独一个橙点更"一眼扫得到" */
.msg-item.unread {
  background: linear-gradient(90deg, rgba(79, 107, 237, .05), rgba(79, 107, 237, 0) 58%);
}
.msg-item.unread::before {
  content: ''; position: absolute; left: 0; top: 13px; bottom: 13px;
  width: 2px; border-radius: 2px; background: var(--blue);
}
.msg-item.unread .msg-dot { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.card-head h2 .msg-unread-n {
  margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  font-style: normal; font-size: 10.5px; font-weight: 500; letter-spacing: 0;
  color: #4056c6; background: var(--blue-wash); vertical-align: 1px;
}

/* ================= 意见反馈 ================= */
.fb-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.fb-input {
  display: block; width: 100%; min-height: 132px; resize: vertical;
  padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface);
  font: inherit; font-size: 13px; line-height: 1.8; color: var(--ink);
}
.fb-input:focus { outline: none; border-color: #c9d3f8; box-shadow: 0 0 0 3px var(--blue-wash); }
.fb-meta { display: flex; align-items: flex-start; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.fb-meta .muted { font-size: 11.5px; line-height: 1.65; }
.fb-count { flex: none; color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fb-submit { display: flex; justify-content: flex-end; margin-top: 14px; }
.fb-submit .btn { min-width: 128px; }

/* 反馈截图：缩略图行 + 添加按钮，微信式的方块网格 */
.fb-pics { margin-top: 10px; }
.fb-pic-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-pic {
  position: relative; width: 72px; height: 72px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.fb-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-pic-del {
  position: absolute; top: 0; right: 0; width: 20px; height: 20px;
  border: none; border-radius: 0 0 0 8px; padding: 0;
  background: rgba(20, 24, 40, .62); color: #fff;
  font-size: 11px; line-height: 20px; text-align: center; cursor: pointer;
}
.fb-pic-add {
  margin-top: 8px; padding: 7px 12px;
  border: 1px dashed var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 12.5px; cursor: pointer;
}
.fb-pic-add:hover { border-color: #c9d3f8; color: var(--ink); }
.fb-pic-add:disabled { opacity: .55; cursor: default; }
@media (max-width: 560px) {
  .fb-meta { flex-direction: column; gap: 4px; }
  .fb-submit .btn { width: 100%; }
}

/* ================= 首页扫一扫 ================= */
.btn-scan { display: inline-flex; align-items: center; gap: 6px; }
.btn-scan svg {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}

.scan-modal {
  position: fixed; inset: 0; z-index: 110;
  display: flex; flex-direction: column;
  background: #0a0c11; color: #fff;
}
.scan-modal[hidden] { display: none; }
.scan-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top));
}
.scan-head b { font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.scan-close {
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 15px; line-height: 1;
}
.scan-close:hover { background: rgba(255, 255, 255, .2); }

.scan-stage {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.scan-stage video { width: 100%; height: 100%; object-fit: cover; background: #000; }
/* 取景框：方形边框 + 四块遮罩拼出中间的洞（比 100vmax 的 box-shadow 省合成，首帧不卡） */
:root { --scan-box: min(64vw, 290px); --scan-half: min(32vw, 145px); }
.scan-frame {
  position: absolute; width: var(--scan-box); height: var(--scan-box);
  border: 2px solid rgba(255, 255, 255, .9); border-radius: 18px;
  animation: scanPulse 2.2s ease-in-out infinite;
}
.scan-mask { position: absolute; inset: 0; pointer-events: none; }
.scan-mask i { position: absolute; background: rgba(6, 8, 12, .5); }
.scan-mask i:nth-child(1) { top: 0; left: 0; right: 0; bottom: calc(50% + var(--scan-half)); }
.scan-mask i:nth-child(2) { top: calc(50% + var(--scan-half)); left: 0; right: 0; bottom: 0; }
.scan-mask i:nth-child(3) { top: calc(50% - var(--scan-half)); left: 0; right: calc(50% + var(--scan-half)); bottom: calc(50% - var(--scan-half)); }
.scan-mask i:nth-child(4) { top: calc(50% - var(--scan-half)); left: calc(50% + var(--scan-half)); right: 0; bottom: calc(50% - var(--scan-half)); }
@keyframes scanPulse {
  0%, 100% { border-color: rgba(255, 255, 255, .9); }
  50% { border-color: rgba(122, 148, 255, .95); }
}
.scan-tip { margin: 16px 0 0; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .92); }

/* 摄像头不可用时的说明面板 / 识别中遮罩：都叠在取景区上 */
.scan-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 0 30px; text-align: center;
}
.scan-fallback svg {
  width: 46px; height: 46px; flex: none;
  fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 1.3;
  stroke-linecap: round; stroke-linejoin: round;
}
.scan-fb-title { margin: 0; font-size: 14.5px; font-weight: 600; color: rgba(255, 255, 255, .95); }
.scan-fb-sub { margin: 0; max-width: 300px; font-size: 12.5px; line-height: 1.8; color: rgba(255, 255, 255, .6); }

.scan-busy {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(6, 8, 12, .74); font-size: 13px; color: rgba(255, 255, 255, .9);
}
.scan-fallback[hidden], .scan-busy[hidden] { display: none; }
.spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .26); border-top-color: #fff;
  animation: wySpin .8s linear infinite;
}
@keyframes wySpin { to { transform: rotate(360deg); } }

/* 兜底入口：从相册选图，放在取景区下方常驻 */
.scan-actions {
  display: grid; grid-template-columns: 1fr; gap: 10px;
  padding: 16px 16px max(18px, env(safe-area-inset-bottom)); margin-top: auto;
}
.scan-actions .btn { height: 42px; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); color: #fff; }
.scan-actions .btn:hover { background: rgba(255, 255, 255, .2); }

/* ================= 创建活动：口令开关 / 群二维码 ================= */
.sw-row { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.sw-row .sw { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); cursor: pointer; }

.qr-up-empty { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qr-up-prev { display: flex; align-items: center; gap: 12px; }
.qr-up-prev img {
  width: 76px; height: 76px; flex: none; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
}
.qr-up-info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.qr-up-info .muted { font-size: 12px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 位置签到：名称+定位按钮一行，经纬度一行，范围开关在上、半径在下 */
.loc-box {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--surface-2);
}
.loc-box .ctrl { background: var(--surface); }
.loc-row { display: flex; align-items: center; gap: 10px; }
.loc-row .ctrl { flex: 1 1 auto; min-width: 0; }
.loc-row .btn { flex: none; white-space: nowrap; }
.loc-radius { display: flex; align-items: center; gap: 8px; padding-left: 24px; }
.loc-radius .ctrl { width: 120px; flex: none; }
.loc-unit { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.loc-box .hint { margin: 0; }
@media (max-width: 560px) {
  .loc-row { flex-wrap: wrap; }
  .loc-row .btn { width: 100%; justify-content: center; }
  .loc-radius { padding-left: 0; }
}

/* 头像跟随小程序：有头像图时盖住首字母 */
.avatar.has-img { padding: 0; overflow: hidden; }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }

/* ================= 导出动作面板（分享到微信 / 保存） ================= */
.sheet-modal { position: fixed; inset: 0; z-index: 105; display: flex; align-items: flex-end; justify-content: center; }
.sheet-modal[hidden] { display: none; }
.sheet-mask { position: absolute; inset: 0; background: rgba(10, 12, 17, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet-card {
  position: relative; width: 100%; max-width: 460px;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface); border-radius: 20px 20px 0 0;
  animation: sheetUp .2s cubic-bezier(.22, .61, .36, 1);
}
@media (min-width: 640px) { .sheet-card { border-radius: 20px; margin-bottom: 28px; } }
@keyframes sheetUp { from { transform: translateY(18px); opacity: .55; } }
.sheet-grip { width: 38px; height: 4px; border-radius: 999px; background: var(--line); margin: 4px auto 14px; }
.sheet-title { margin: 0; font-size: 14px; font-weight: 600; text-align: center; }
.sheet-name { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); text-align: center; word-break: break-all; }
.sheet-acts { display: grid; gap: 8px; margin-top: 16px; }
.sheet-acts .btn { width: 100%; height: 42px; }
.sheet-hint { margin: 12px 0 0; font-size: 11px; line-height: 1.65; color: var(--ink-3); text-align: center; }
/* 桌面壳：这个按钮是可拖的（原生拖拽到微信窗口），光标要说明能抓 */
#exportShareBtn[draggable="true"] { cursor: grab; }
#exportShareBtn[draggable="true"]:active { cursor: grabbing; }

/* ---- 时间选择：原生 datetime-local 按浏览器语言渲染（英文环境会出现 12/31/2026 PM），
        外层文字镜像恒定显示「YYYY-MM-DD HH:mm」，透明原生控件负责弹出选择器 ---- */
.dt { position: relative; }
.dt .dt-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; z-index: 2;
}
.dt .dt-text {
  display: flex; align-items: center; min-height: 42px; padding: 0 36px 0 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font-family: var(--mono); font-size: 13.5px; color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.dt:not(.has) .dt-text::before { content: '如 2026-12-31 23:59'; color: var(--ink-3); }
.dt.has .dt-text { border-color: var(--ink-3); }
.dt .dt-clear {
  display: none; position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  z-index: 3; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-3); font-size: 14px; line-height: 20px; cursor: pointer;
}
.dt .dt-clear:hover { background: var(--line); color: var(--ink); }
.dt.has .dt-clear { display: block; }

/* ================= 签到码设置弹层 ================= */
/* 三段式：有效时间 → 签到范围 → 参与二维码；序号徽标 + 状态 pill + 舒适留白 */
.cm-card { max-width: 476px; max-height: calc(100dvh - 40px); overflow-y: auto; padding: 26px 24px 20px; }
.cm-card .modal-sub { margin-bottom: 6px; }
.cm-sec {
  display: grid; gap: 12px; margin-top: 12px; padding: 16px;
  border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface-2);
}
/* 段头：序号圆徽 + 标题 + 右侧状态 pill */
.cm-head { display: flex; align-items: center; gap: 9px; }
.cm-num {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  background: var(--line-2); font-variant-numeric: tabular-nums;
}
.cm-head b { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.cm-state {
  margin-left: auto; max-width: 55%; font-size: 11.5px; line-height: 1.4;
  color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right;
  padding: 3px 9px; border-radius: 999px; background: var(--line-2);
}
.cm-state.warn { color: #b23c2a; background: #fbeae6; }
/* 段标题旁的「选填」小标签：签到范围是可选项，别让人以为是卡点 */
.cm-opt {
  flex: none; font-size: 10.5px; line-height: 1.5; color: var(--ink-3);
  padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2);
}
.cm-state.ok { color: #1f7a46; background: #e4f3ea; }

/* 输入行：输入框 + 右侧单位说明 */
.cm-in { display: flex; align-items: center; gap: 10px; }
.cm-in .ctrl { flex: 1 1 auto; min-width: 0; }
.cm-in-unit { flex: none; font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* 开关行：滑块式开关（input 透明覆盖保证可点/可编程 click） */
.cm-switch { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; width: fit-content; }
.cm-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cm-switch-ui {
  position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px;
  background: var(--line-2); transition: background .18s ease;
}
.cm-switch-ui::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 20, 30, .25);
  transition: transform .18s ease;
}
.cm-switch input:checked + .cm-switch-ui { background: var(--blue); }
.cm-switch input:checked + .cm-switch-ui::after { transform: translateX(16px); }
.cm-switch input:focus-visible + .cm-switch-ui { box-shadow: 0 0 0 3px rgba(79, 107, 237, .25); }
.cm-switch-text { font-size: 13px; color: var(--ink-2); }

.cm-loc { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 2px; }
.cm-loc-text {
  min-width: 0; font-size: 12.5px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cm-loc .btn { flex: none; white-space: nowrap; }
/* 手动经纬度（http 访问时没有 geolocation 的兜底） */
.cm-coord {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center;
}
.cm-coord[hidden] { display: none; }
.cm-coord .ctrl { min-width: 0; background: var(--surface); }
.cm-coord .btn { white-space: nowrap; }
.cm-coord-tip {
  margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--ink-3);
}
.cm-coord-tip[hidden] { display: none; }
.cm-sec .hint { margin: 0; }

/* 签到范围地图：弹层里只读预览，选点在独立弹层做（否则地图会吃掉弹层的滚动手势） */
.cm-map { display: grid; gap: 8px; }
.cm-map[hidden] { display: none; }
.cm-map-canvas {
  height: 136px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line-2); background: #eef1f6;
}
.cm-map-canvas .amap-logo,
.cm-map-canvas .amap-copyright { opacity: .72; }
.cm-map-bar { display: flex; align-items: center; gap: 10px; }
.cm-map-hint {
  flex: 1 1 auto; min-width: 0; font-size: 11.5px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cm-map-bar .btn { flex: none; white-space: nowrap; }
.cm-map-fail {
  display: flex; align-items: center; justify-content: center;
  height: 100%; padding: 0 14px; text-align: center;
  font-size: 12px; line-height: 1.6; color: var(--ink-3);
}

/* 地图选点弹层：准星固定在容器中心，取 map.getCenter() 即用户选的点 */
.mm-card { max-width: 560px; width: 100%; padding: 22px 22px 18px; }
/* 地址搜索：桌面端没有自动定位，主要靠搜地名或直接拖地图 */
.mm-search { position: relative; margin: 10px 0 0; }
.mm-search .ctrl { width: 100%; }
.mm-sug {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh-2); max-height: 216px; overflow: auto;
}
.mm-sug[hidden] { display: none; }
.mm-sug button {
  display: block; width: 100%; text-align: left; padding: 9px 12px;
  background: none; border: 0; border-top: 1px solid var(--line-2);
  font-size: 13px; line-height: 1.5; color: var(--ink);
}
.mm-sug button:first-child { border-top: 0; }
.mm-sug button:hover, .mm-sug button:focus-visible { background: var(--blue-wash); outline: none; }
.mm-sug button span { display: block; font-size: 11.5px; color: var(--ink-3); }
.mm-sug .mm-sug-empty { padding: 10px 12px; font-size: 12px; color: var(--ink-3); }
.mm-canvas { position: relative; margin-top: 10px; }
.mm-map {
  height: min(52vh, 400px); border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line-2); background: #eef1f6;
}
.mm-cross { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.mm-cross i {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--blue); border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(16, 20, 30, .18), 0 6px 14px rgba(16, 20, 30, .3);
}
.mm-load {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12.5px; color: var(--ink-3);
  background: #eef1f6; border-radius: 14px;
}
.mm-load[hidden] { display: none; }
.mm-addr {
  margin: 10px 0 0; min-height: 18px;
  font-size: 12.5px; line-height: 1.6; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.mm-acts { margin-top: 14px; }
.mm-acts .btn { flex: 1 1 0; justify-content: center; }

/* 参与二维码 */
.cm-qr {
  flex: none; width: 168px; height: 168px; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
/* 二维码是图形不是图标：必须抵消全局 svg 图标规则的 fill/stroke，否则码点被描边糊成黑块 */
.cm-qr svg { display: block; width: 100%; height: 100%; fill: none; stroke: none; }
.cm-qr-fail {
  display: flex; align-items: center; justify-content: center;
  height: 100%; padding: 0 10px; text-align: center;
  font-size: 12px; color: #b23c2a; line-height: 1.6;
}
/* 单张码：居中放大，下面一行扫法说明 */
.cm-code-one { display: grid; gap: 10px; justify-items: center; }
.cm-code-one .cm-qr {
  width: 100%; max-width: 208px; height: auto; aspect-ratio: 1 / 1;
  padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
  box-shadow: 0 1px 6px rgba(16, 20, 30, .06);
}
.cm-qr img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cm-qr-wait {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 12px; color: var(--ink-3);
}
/* 未设置时长 / 范围时二维码位置的占位：不出码，先设置 */
.cm-qr-lock {
  display: flex; align-items: center; justify-content: center;
  height: 100%; padding: 0 8px; text-align: center;
  font-size: 12px; line-height: 1.5; color: var(--ink-3);
  background: repeating-linear-gradient(45deg, #fafbfd, #fafbfd 6px, #f2f4f9 6px, #f2f4f9 12px);
  border-radius: 9px;
}
.cm-lock-tip {
  margin: 0; padding: 9px 12px; border-radius: 10px;
  font-size: 12px; line-height: 1.6; color: #8a5a14; background: #fdf6e7;
}
.cm-spec {
  margin: 0; font-size: 12px; color: var(--ink-2); text-align: center;
  padding: 7px 12px; border-radius: 10px; background: var(--line-2);
  font-variant-numeric: tabular-nums;
}
.cm-code-cap { display: grid; gap: 2px; text-align: center; }
.cm-code-cap b { font-size: 12.5px; font-weight: 600; }
.cm-code-cap span { font-size: 11.5px; color: var(--ink-3); }
.cm-qr-acts { display: flex; gap: 10px; justify-content: center; }
.cm-qr-acts .btn { white-space: nowrap; flex: 1 1 0; justify-content: center; max-width: 190px; }
/* 底部动作：主按钮占主位，关闭弱化 */
.cm-acts { margin-top: 16px; }
.cm-acts .btn-primary { flex: 1 1 auto; }
.cm-acts .btn-ghost { flex: none; }
@media (max-width: 560px) {
  .cm-card { padding: 22px 16px 16px; }
  .cm-sec { padding: 14px; gap: 11px; }
  .cm-loc { flex-wrap: wrap; }
  .cm-loc .btn { width: 100%; justify-content: center; }
  .cm-coord { grid-template-columns: 1fr 1fr; }
  .cm-coord .btn { grid-column: 1 / -1; width: 100%; justify-content: center; }
  .cm-map-canvas { height: 124px; }
  .mm-card { padding: 18px 16px 14px; max-height: calc(100dvh - 24px); }
  .mm-map { height: 46vh; }
  .cm-qr { width: 100%; height: auto; aspect-ratio: 1 / 1; max-width: 240px; margin: 0 auto; }
  .cm-qr-acts .btn { max-width: none; }
  .cm-acts { flex-wrap: wrap; }
  .cm-acts .btn { flex: 1 1 0 !important; justify-content: center; }
}

/* ================= 数字活动（8 位数字身份） ================= */
.btn-digital { display: inline-flex; align-items: center; gap: 6px; }
.btn-digital svg {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}

/* 手机端 banner：两个动作等宽一排（数字活动 / 扫一扫） */
.hero-actions-2 { flex-wrap: nowrap; gap: 10px; margin-top: 16px; }
.hero-actions-2 > .btn {
  flex: 1 1 0; min-width: 0; white-space: nowrap;
  padding: 0 6px; height: 42px; font-size: 14px; gap: 6px;
}
.hero-actions-2 .btn-scan svg,
.hero-actions-2 .btn-digital svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 359px) {
  .hero-actions-2 > .btn { font-size: 13px; gap: 4px; }
}

/* 输码弹层：输入框是唯一主角，居中大号，其余留白 */
.dm-card { max-width: 400px; }
.dm-field { margin-top: 24px; }
.dm-input {
  display: block; width: 100%; height: 64px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2);
  font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: .22em;
  text-align: center; color: var(--ink); outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.dm-input::placeholder { color: #d2d5dd; letter-spacing: .22em; }
.dm-input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px var(--blue-wash); }
.dm-err { margin: 12px 2px 0; color: #b23c2a; font-size: 12.5px; line-height: 1.6; text-align: center; }
.dm-acts { margin-top: 22px; }
.dm-acts .btn-primary { width: 100%; height: 46px; font-size: 15px; }

/* 详情页数字身份行 */
.digital-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 12px; padding: 9px 12px;
  border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2);
}
.digital-label { font-size: 12px; color: var(--ink-3); }
.digital-code { font-size: 16px; letter-spacing: .12em; color: var(--ink); }
.digital-row .btn { height: 26px; padding: 0 10px; font-size: 12px; }

/* 参与页 */
.join-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.join-head .detail-meta { margin-top: 10px; }
.join-banner {
  padding: 12px 14px; border-radius: 10px; font-size: 13px;
  background: #fdf3ec; border: 1px solid #f3e2d5; color: #b1552a;
}
.join-note {
  margin-bottom: 14px; padding: 10px 12px; border-radius: 10px;
  background: var(--blue-wash); border: 1px solid #dfe5fd; color: #3550c8; font-size: 12.5px;
}
.join-form { display: grid; gap: 16px; }
.j-field label { font-size: 13px; color: var(--ink-2); }
.j-field .req { color: #c0392b; font-style: normal; }
.choices { display: grid; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 13px; text-align: left; font-size: 13.5px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  transition: border-color .16s, background .16s;
}
.choice:hover { border-color: #cfcfc9; }
.choice-mark {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid #c9ccd4; background: #fff; position: relative;
}
.choice.on { border-color: var(--blue); background: var(--blue-wash); }
.choice.on .choice-mark { border-color: var(--blue); background: var(--blue); }
.choice.on .choice-mark::after {
  content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #fff;
}
.choice span { min-width: 0; word-break: break-word; }
.join-submit { width: 100%; height: 44px; margin-top: 20px; font-size: 15px; }
.join-loc-hint { margin: 10px 0 0; }
.join-lock h2 { margin: 0 0 6px; font-size: 17px; }
.join-done { text-align: center; padding: 34px 22px; }
.join-done-mark {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #eef7f1; color: #2c7d51; font-size: 26px; font-weight: 600;
}
.join-done h2 { margin: 0 0 8px; font-size: 19px; }
.join-done .row { justify-content: center; }

/* 扫一扫面板：不安全上下文的一键切换按钮 */
#scanGoSecure { margin-top: 14px; width: 100%; justify-content: center; }

/* 离线提示：断网时顶部一枚小胶囊，说明看到的是缓存 */
.net-pill {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(var(--top-h) + 8px); z-index: 60;
  padding: 5px 12px; border-radius: 999px;
  background: #2b2f38; color: #fff; font-size: 12px; line-height: 1.5;
  box-shadow: var(--sh-2); pointer-events: none; white-space: nowrap;
}
.net-pill[hidden] { display: none; }
@media (min-width: 900px) { .net-pill { top: 12px; } }

/* 热更新链路演练：此注释用于产生新版本号 */

/* ================= 小信助手（悬浮球 + 对话面板） =================
   位置由 JS 算（贴左/贴右 + 纵向像素），所以这里只管外观，不写死 left/bottom。
   层级：球 94 / 面板 96，低于 modal(100+) 与 toast(120)，弹层打开时天然被盖住。 */
.xx-root { position: static; }
.xx-ball {
  position: fixed; z-index: 94; width: 56px; height: 56px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 2px solid #fff; background: var(--surface);
  box-shadow: 0 8px 24px rgba(16, 20, 30, .18), 0 1px 2px rgba(16, 20, 30, .12);
  touch-action: none; user-select: none; -webkit-user-select: none;
  transition: opacity .18s ease, transform .18s ease;
  animation: xx-bob 3.4s ease-in-out infinite;
}
.xx-ball img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; pointer-events: none; }
/* 未登录时整颗球收起：display:flex 会压掉 [hidden]，必须显式兜住 */
.xx-ball[hidden] { display: none !important; }
.xx-ball:active { transform: scale(.94); }
.xx-ball--dragging { animation: none; transition: none; box-shadow: 0 14px 34px rgba(16, 20, 30, .26); }
.xx-ball--open { opacity: 0; transform: scale(.86); pointer-events: none; }
/* 小圆点：有未读提示时用（首屏欢迎只要点一次就知道，所以默认不显示） */
.xx-ball-dot { position: absolute; top: 2px; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); border: 2px solid #fff; display: none; }
@keyframes xx-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .xx-ball { animation: none; } }

.xx-panel {
  position: fixed; z-index: 96; right: 20px; bottom: 24px;
  width: 360px; height: 540px; max-height: calc(100vh - 48px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  animation: xx-up .18s ease;
}
@keyframes xx-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- 语音输入：麦克风按钮 + 录音条 ---- */
.xx-mic {
  flex: none; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink-2);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.xx-mic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.xx-mic:hover { border-color: var(--blue); color: var(--blue); }
.xx-mic--off { opacity: .5; }
.xx-mic--busy { opacity: .55; pointer-events: none; }
.xx-mic--rec { background: #e5484d; border-color: #e5484d; color: #fff; animation: xx-mic-pulse 1.3s ease-out infinite; }
.xx-mic--rec svg { stroke-width: 1.9; }
@keyframes xx-mic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .42); }
  70% { box-shadow: 0 0 0 9px rgba(229, 72, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
}
.xx-rec {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-top: 1px solid var(--line-2); background: #fff7f7; font-size: 12px; color: var(--ink-2);
}
.xx-rec[hidden] { display: none !important; }
.xx-rec-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; animation: xx-rec-blink 1s steps(1, end) infinite; }
@keyframes xx-rec-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: .18; } }
.xx-rec b { font-variant-numeric: tabular-nums; color: #c0363b; font-weight: 600; }
.xx-rec-hint { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); }
.xx-rec-x { flex: none; border: 0; background: transparent; color: var(--ink-3); font-size: 12px; padding: 3px 7px; border-radius: 7px; }
.xx-rec-x:hover { background: rgba(0, 0, 0, .05); color: var(--ink); }
/* hidden 属性必须压住上面的 display:flex，否则 UA 的 [hidden]{display:none} 会被类选择器盖掉 */
.xx-panel[hidden] { display: none !important; }

.xx-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 11px; border-bottom: 1px solid var(--line-2); }
.xx-head-ava { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.xx-head-text { flex: 1; min-width: 0; }
.xx-head-text b { display: block; font-size: 13.5px; font-weight: 600; }
.xx-head-text span { display: block; font-size: 11px; color: var(--ink-3); }
.xx-icon { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); }
.xx-icon:hover { background: var(--surface-2); color: var(--ink); }
.xx-icon svg { width: 16px; height: 16px; }

.xx-log { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px 6px; background: var(--surface-2); -webkit-overflow-scrolling: touch; }
.xx-msg { max-width: 86%; margin-bottom: 10px; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.7; word-break: break-word; }
.xx-msg--b { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); border-top-left-radius: 4px; }
.xx-msg--u { margin-left: auto; background: var(--blue); color: #fff; border-top-right-radius: 4px; }
.xx-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.xx-act { border: 1px solid var(--line); background: var(--surface); color: var(--blue); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.xx-act:hover { border-color: var(--blue); background: var(--blue-wash); }

.xx-typing { display: inline-flex; gap: 4px; align-items: center; }
.xx-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); animation: xx-dot 1s infinite; }
.xx-typing i:nth-child(2) { animation-delay: .15s; }
.xx-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes xx-dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.xx-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 2px; border-top: 1px solid var(--line-2); scrollbar-width: none; }
.xx-chips::-webkit-scrollbar { display: none; }
.xx-chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 5px 11px; font-size: 12px; white-space: nowrap; }
.xx-chip:hover { border-color: var(--blue); color: var(--blue); }

.xx-foot { display: flex; gap: 8px; align-items: center; padding: 8px 12px 12px; }
.xx-input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 13px; color: var(--ink); }
.xx-input:focus { outline: none; border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px rgba(79, 107, 237, .1); }
.xx-send { flex: none; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--ink); color: #fff; }
.xx-send svg { width: 17px; height: 17px; }
.xx-send:hover { background: var(--blue); }

/* 手机：做成底部弹层（tabbar 之上），球默认抬到 tabbar 以上由 JS 兜住 */
@media (max-width: 900px) {
  .xx-panel {
    left: 10px; right: 10px; width: auto;
    bottom: calc(var(--tab-h) + 10px + env(safe-area-inset-bottom));
    height: min(70vh, 520px); max-height: calc(100vh - 140px);
    border-radius: 16px;
  }
  .xx-msg { max-width: 92%; }
  /* 键盘弹出时导航整体收起，球也跟着让开，免得压在输入框上 */
  body.kb-open .xx-ball { opacity: 0; pointer-events: none; }
}

/* ---- VIP 会员：权益页 / 工作台门 / 我的页标记 ---- */
.vip-hero {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
}
.vip-hero.is-on {
  border-color: #e7d7b4;
  background: linear-gradient(135deg, #fffaf0 0%, #fff 62%);
}
.vip-hero-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.vip-crown {
  flex: none; width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #7a5a12;
  background: linear-gradient(135deg, #f6e2b0, #e8c46a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.vip-hero h2 { font-size: 16px; margin: 0 0 3px; }
.vip-hero p { margin: 0; font-size: 12.5px; }
.vip-hero-pts { text-align: right; }
.vip-hero-pts b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.vip-hero-pts span { font-size: 11.5px; color: var(--ink-3); }

.vip-plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.vip-plan {
  position: relative; text-align: left; padding: 14px 12px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  display: flex; flex-direction: column; gap: 3px; cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.vip-plan:hover { border-color: #e8c46a; box-shadow: var(--sh-2); transform: translateY(-1px); }
.vip-plan:active { transform: none; }
.vip-plan b { font-size: 16px; font-weight: 650; }
.vip-plan-tag { font-size: 11px; color: #96702a; }
.vip-plan-cost { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.vip-plan.is-short { opacity: .55; }
.vip-plan.is-short:hover { border-color: var(--line); box-shadow: none; transform: none; }

.perk-list { display: flex; flex-direction: column; }
.perk-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 0; border-top: 1px solid var(--line-2);
}
.perk-item:first-child { border-top: 0; padding-top: 4px; }
.perk-idx {
  flex: none; width: 20px; height: 20px; border-radius: 6px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--line-2);
}
.perk-text { flex: 1; min-width: 0; }
.perk-text b { display: block; font-size: 13.5px; font-weight: 600; }
.perk-text span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; line-height: 1.55; }
.perk-flag {
  flex: none; font-size: 11px; padding: 2px 7px; border-radius: 999px;
  color: var(--green); background: #eef7f1; margin-top: 2px;
}
.perk-flag.lock { color: #96702a; background: #fdf6e7; }

.vip-gate { text-align: left; }
.vip-gate-tag {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .3px;
  color: #7a5a12; background: linear-gradient(135deg, #f6e2b0, #e8c46a);
  padding: 3px 9px; border-radius: 999px; margin-bottom: 10px;
}
.vip-gate h2 { font-size: 17px; margin: 0 0 6px; }
.vip-gate p.muted { margin: 0 0 14px; font-size: 13px; line-height: 1.7; }
.vip-gate-list { border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; margin-bottom: 16px; }
.vip-gate-row { padding: 10px 13px; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.vip-gate-row:first-child { border-top: 0; }
.vip-gate-row b { display: block; font-size: 13px; }
.vip-gate-row span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.vip-gate-acts { display: flex; gap: 10px; flex-wrap: wrap; }

.me-vip {
  font-style: normal; font-size: 11.5px; padding: 2px 7px; border-radius: 999px;
  color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--line-2);
}
.me-vip.on { color: #7a5a12; background: #fdf6e7; border-color: #eddfbd; }

.xx-ball--vip::after {
  content: ''; position: absolute; right: 2px; top: 2px; width: 9px; height: 9px;
  border-radius: 50%; background: linear-gradient(135deg, #f6e2b0, #e8c46a);
  box-shadow: 0 0 0 2px #fff;
}
.xx-panel.xx-locked { height: auto; }
.xx-lock { padding: 22px 18px 18px; text-align: left; }
.xx-lock[hidden] { display: none !important; }
.xx-lock-tag {
  display: inline-block; font-size: 10.5px; font-weight: 600; color: #7a5a12;
  background: linear-gradient(135deg, #f6e2b0, #e8c46a);
  padding: 2px 8px; border-radius: 999px; margin-bottom: 9px;
}
.xx-lock b { display: block; font-size: 14.5px; margin-bottom: 6px; }
.xx-lock p { margin: 0 0 14px; font-size: 12.5px; line-height: 1.75; color: var(--ink-2); }
.xx-lock-btn {
  width: 100%; height: 38px; border: 0; border-radius: 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #c79a3c, #a97c22);
}
.xx-lock-btn:hover { filter: brightness(1.04); }

@media (max-width: 720px) {
  .vip-plans { grid-template-columns: repeat(2, 1fr); }
  .vip-hero-pts { text-align: left; }
}

/* ---- 登录页：账号密码通道（账号=用户码，密码只在小程序里设置） ---- */
.gate-alt {
  width: 100%; height: 44px; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink-2);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.gate-alt:hover { border-color: var(--blue); color: var(--blue); }
.gate-alt[disabled] { opacity: .42; cursor: not-allowed; }

.gate-body-pass { align-items: stretch; text-align: left; }
.pass-row {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 14px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pass-row:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79, 107, 237, .12); }
.pass-row-label { flex: none; width: 52px; font-size: 13px; color: var(--ink-3); }
/* 用户码固定前缀：看起来像输入框的一部分，用户只需输后面几位 */
.pass-pre {
  flex: none; margin-right: -4px;
  font-size: 15px; font-weight: 600; letter-spacing: 1px; color: var(--ink);
  user-select: none;
}
.pass-in {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent;
  font-size: 15px; color: var(--ink); outline: none;
}
.pass-in::placeholder { color: var(--ink-3); opacity: .8; }
#passAcct { letter-spacing: 1px; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.pass-eye {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; margin-right: -6px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-3);
  cursor: pointer; transition: color .15s ease, background .15s ease;
}
.pass-eye:hover { color: var(--blue); background: rgba(79, 107, 237, .08); }
.pass-eye svg { display: block; }
.pass-err {
  margin: 2px 0 0; padding: 8px 12px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.6; color: #b23c2a; background: #fbeae6;
}
.pass-err[hidden] { display: none !important; }
.gate-body-pass .gate-btn { margin-top: 14px; height: 46px; }
.gate-body-pass .gate-back { margin-top: 12px; }

/* ======================================================================
   挽忆表格（工作台 · 表格中心）
   一套「能填、能分析、能分享」的轻表格：
   表格中心 → 场景卡；编辑器 → 视图/工具条/表格；分享页 → 独立版式。
   ====================================================================== */
body.sh-wide .view { max-width: 1480px; }
/* 分享页不属于应用内部：收起侧栏与底部导航，只留标题栏 */
body.sh-share-mode .shell { grid-template-columns: minmax(0, 1fr); }
body.sh-share-mode .rail, body.sh-share-mode .tabbar { display: none !important; }
body.sh-share-mode .view { max-width: 980px; padding-bottom: 40px; }
body.sh-share-mode .topbar-actions #loginBtn { display: none; }

/* ---------------- 表格中心 ---------------- */
.sh-hero { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.sh-hero-t { min-width: 0; flex: 1; }
.sh-hero h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.02em; }
.sh-hero p { margin: 0; font-size: 13px; }
.sh-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.sh-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--sh-1); }
.sh-stat b { display: block; font-family: var(--mono); font-size: 22px; line-height: 1.2; letter-spacing: -.02em; }
.sh-stat span { font-size: 12px; color: var(--ink-3); }

.sh-scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 10px; margin-top: 4px; }
.sh-scene {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 10px;
  padding: 12px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); transition: border-color .16s ease, transform .12s ease, box-shadow .16s ease;
}
.sh-scene:hover { border-color: #d3d3cc; box-shadow: var(--sh-2); transform: translateY(-1px); }
.sh-scene-ico { grid-row: 1 / 3; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; }
.sh-scene b { font-size: 13.5px; font-weight: 600; align-self: end; }
.sh-scene span:last-of-type { grid-column: 2; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.sh-scene-n { grid-column: 2; font-size: 11px; color: var(--ink-3); font-style: normal; margin-top: 3px; }

.sh-search { margin-left: auto; min-width: 180px; }
.sh-search .ctrl { height: 32px; font-size: 13px; }
.sh-search-sm { min-width: 150px; max-width: 240px; }

.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px; margin-top: 4px; }
.sh-card {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  padding: 12px; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .12s ease;
}
.sh-card:hover { border-color: #d3d3cc; box-shadow: var(--sh-2); transform: translateY(-1px); }
.sh-card-top { display: flex; align-items: flex-start; gap: 10px; }
.sh-card-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; flex: 0 0 auto; }
.sh-card-t { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sh-card-t b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-card-t span { font-size: 11.5px; color: var(--ink-3); }
.sh-share-dot { font-size: 10.5px; font-style: normal; color: var(--green); background: #eaf5ee; border-radius: 999px; padding: 2px 7px; flex: 0 0 auto; }
.sh-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line-2); }
.sh-tag { font-size: 11px; color: var(--ink-2); background: #f2f2ee; border-radius: 6px; padding: 2px 7px; }
.sh-card-foot .muted { margin-left: auto; font-size: 11px; }
.sh-card-sk { height: 92px; background: linear-gradient(90deg, #f3f3ef, #fafaf8, #f3f3ef); background-size: 200% 100%; animation: shsk 1.2s linear infinite; }
@keyframes shsk { from { background-position: 200% 0; } to { background-position: -40% 0; } }
.sh-card-sh { padding: 20px; }
.sk-line { height: 12px; border-radius: 6px; background: #f0f0ec; margin-bottom: 10px; }
.sk-line.w40 { width: 40%; } .sk-line.w70 { width: 70%; } .sk-line.w90 { width: 90%; }

/* ---------------- 弹层（新建 / 列设置 / 分享） ---------------- */
.sh-mask {
  position: fixed; inset: 0; z-index: 90; background: rgba(20, 22, 27, .34);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: shfade .16s ease;
}
@keyframes shfade { from { opacity: 0; } to { opacity: 1; } }
.sh-modal {
  width: min(520px, 100%); max-height: min(86vh, 780px); overflow: auto;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  padding: 18px 20px 16px; animation: shop .18s cubic-bezier(.2, .8, .3, 1);
}
@keyframes shop { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.sh-modal-wide { width: min(760px, 100%); }
.sh-modal-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.sh-modal-head > div { min-width: 0; display: flex; flex-direction: column; }
.sh-modal-head b { font-size: 15px; }
.sh-modal-head span.muted { font-size: 12px; }
.sh-modal-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; flex: 0 0 auto; }
.sh-x { margin-left: auto; width: 30px; height: 30px; border: 0; background: none; font-size: 19px; color: var(--ink-3); line-height: 1; border-radius: 8px; flex: 0 0 auto; }
.sh-x:hover { background: #f3f3ef; color: var(--ink); }
.sh-lab { display: block; font-size: 12px; color: var(--ink-2); margin: 12px 0 6px; font-weight: 500; }
.sh-lab:first-of-type { margin-top: 0; }
.sh-note { font-style: normal; color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.sh-fillopt { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.sh-modal-acts { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.sh-modal-acts .spacer { flex: 1; }

/* ---------------- 编辑器 ---------------- */
.sh-head { padding: 14px 16px 12px; margin-bottom: 12px; }
.sh-head-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sh-head-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; }
.sh-name {
  flex: 1; min-width: 160px; border: 1px solid transparent; background: transparent;
  font-size: 16px; font-weight: 600; letter-spacing: -.01em; padding: 5px 8px; border-radius: 8px;
  font-family: inherit; color: var(--ink);
}
.sh-name:hover { background: #f6f6f2; }
.sh-name:focus { outline: none; border-color: var(--line); background: var(--surface); }
.sh-save { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.sh-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 9px; padding-left: 2px; font-size: 11.5px; color: var(--ink-3); }
.sh-conflict { color: var(--orange); }
.sh-more-wrap { position: relative; }
.sh-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 168px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh-2);
  padding: 5px; display: flex; flex-direction: column;
}
.sh-menu button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; font-size: 13px; }
.sh-menu button:hover { background: #f4f4f0; }
.sh-menu button.danger { color: #b23c2a; }

.sh-main { padding: 0; overflow: hidden; }
.sh-views { display: flex; align-items: center; gap: 4px; padding: 10px 12px 0; flex-wrap: wrap; }
.sh-vtab {
  border: 0; background: none; padding: 7px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-3);
  transition: background .14s ease, color .14s ease;
}
.sh-vtab:hover { background: #f4f4f0; color: var(--ink-2); }
.sh-vtab.on { background: var(--ink); color: #fff; font-weight: 500; }
.sh-views .spacer { flex: 1; }

.sh-tools { display: flex; align-items: center; gap: 4px; padding: 10px 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); }
.sh-tool {
  border: 1px solid transparent; background: none; padding: 6px 10px; border-radius: 8px;
  font-size: 12.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px;
}
.sh-tool:hover { background: #f4f4f0; }
.sh-tool.on { background: var(--blue-wash); color: var(--blue); }
.sh-tool[disabled] { opacity: .38; cursor: default; }
.sh-tool.on i { font-style: normal; font-size: 10.5px; background: var(--blue); color: #fff; border-radius: 999px; padding: 1px 6px; }
.sh-tool-primary { margin-left: 2px; background: var(--ink); color: #fff; border-color: var(--ink); }
.sh-tool-primary:hover { background: #000; }
.sh-tool-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.sh-tools .spacer { flex: 1; }

.sh-pop { padding: 10px 12px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.sh-pop-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sh-pop-row .mini-select, .sh-pop-row .ctrl { height: 34px; }
.sh-filter-val { flex: 1; min-width: 120px; }
.sh-pop-acts { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.sh-pop-acts .muted { margin-right: auto; font-size: 12px; }

/* 表格本体：表头吸顶、行号吸左，横向滚动不丢参照 */
.sh-body { padding: 0; }
.sh-gwrap { overflow: auto; max-height: min(66vh, 720px); border-bottom: 1px solid var(--line-2); }
.sh-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
/* 更「像表格」：实线网格 + 表头加重，一眼就是一张表 */
.sh-table th, .sh-table td { border-bottom: 1px solid #e4e4db; border-right: 1px solid #e4e4db; padding: 0; vertical-align: middle; }
.sh-table thead th {
  position: sticky; top: 0; z-index: 3; background: #f1f1eb;
  height: 38px; text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px;
  border-bottom: 2px solid #d9d9cd;
}
.sh-th[data-act] { padding: 0 9px !important; cursor: pointer; user-select: none; }
.sh-th[data-act]:hover { background: #eaeae2; }
.sh-th.sorted, .sh-th.sorted .sh-th-n { color: var(--blue); }
.sh-th-i { display: inline-block; font-size: 10px; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; margin-right: 5px; line-height: 15px; }
.sh-th-n { font-weight: 600; }
.sh-th-n em { color: var(--orange); font-style: normal; margin-left: 2px; }
.sh-th-sort { margin-left: 4px; font-size: 11px; color: var(--blue); }
.sh-th-add, .sh-td-act { width: 44px; border-right: 0 !important; background: transparent; }
.sh-rn {
  width: 44px; text-align: center; color: var(--ink-3); font-family: var(--mono); font-size: 11.5px;
  background: #f1f1eb; position: sticky; left: 0; z-index: 2;
}
.sh-table thead .sh-rn { z-index: 4; }
.sh-td { padding: 0 !important; background: var(--surface); }
.sh-table tbody tr:hover .sh-td { background: #f8f8f3; }
.sh-cell { padding: 9px 10px; min-height: 38px; line-height: 1.45; outline: none; word-break: break-word; }
.sh-cell:hover { background: transparent; }
.sh-cell:focus { background: var(--blue-wash); box-shadow: inset 0 0 0 2px rgba(79, 107, 237, .28); border-radius: 4px; }
.sh-cell.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sh-cell.long { white-space: pre-wrap; }
.sh-cell-sel, .sh-cell-date {
  width: 100%; height: 38px; border: 0; background: transparent; padding: 0 8px;
  font: inherit; font-size: 12.5px; color: var(--ink); outline: none; appearance: none;
}
.sh-cell-sel:focus, .sh-cell-date:focus { background: var(--blue-wash); }
.sh-check { display: flex; align-items: center; justify-content: center; height: 38px; cursor: pointer; }
.sh-check input { width: 16px; height: 16px; accent-color: var(--blue); }
.sh-rating { display: inline-flex; gap: 1px; padding: 0 8px; }
.sh-star { font-style: normal; font-size: 15px; color: #dcdcd4; cursor: pointer; line-height: 38px; }
.sh-star.on { color: #e0a63a; }
.sh-rowdel { width: 26px; height: 26px; border: 0; background: none; color: #c9c9c2; font-size: 15px; border-radius: 6px; }
.sh-rowdel:hover { background: #fdeeea; color: #b23c2a; }
.sh-table tbody tr:hover .sh-rn { background: #eaeae2; }
.sh-empty { padding: 26px 16px !important; color: var(--ink-3); font-size: 12.5px; text-align: center; }
/* 表尾内置「＋ 添加一行」 */
.sh-addtr { cursor: pointer; }
.sh-addtr .sh-rn { color: var(--ink-3); font-weight: 600; }
.sh-addcell { padding: 8px 12px !important; color: var(--ink-3); font-size: 12.5px; background: #fbfbf8; }
.sh-addtr:hover .sh-addcell { color: var(--blue); background: var(--blue-wash); }
.sh-addtr:hover .sh-rn { color: var(--blue); }

/* 新建弹层的迷你表格预览 */
.sh-pv-wrap { max-height: 200px; overflow: auto; border: 1px solid #d9d9cd; border-radius: 8px; background: var(--surface); }
.sh-pv-table { font-size: 12px; }
.sh-pv-table .sh-rn { width: 34px; font-size: 10.5px; }
.sh-pv-cell { min-height: 30px; padding: 6px 9px; }
.sh-pv-dash { display: block; width: 46%; height: 7px; border-radius: 4px; background: #e7e7de; }
.sh-foot { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 11.5px; color: var(--ink-2); }
.sh-foot .muted { margin-left: auto; color: var(--ink-3); }

/* 卡片视图 */
.sh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; padding: 12px; }
.sh-rcard { border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 12px; background: var(--surface); cursor: pointer; transition: border-color .14s ease, box-shadow .14s ease; }
.sh-rcard:hover { border-color: #d3d3cc; box-shadow: var(--sh-1); }
.sh-rcard-t { display: flex; align-items: baseline; gap: 8px; }
.sh-rcard-t b { font-size: 13.5px; }
.sh-rcard-t em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--ink-3); }
.sh-rcard-b { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; }
.sh-rcard-b span { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-rcard-b span i { font-style: normal; color: var(--ink-3); margin-right: 5px; }
.sh-pill { display: inline-block; width: fit-content; background: var(--blue-wash); color: var(--blue); border-radius: 999px; padding: 1px 9px; font-size: 11.5px; }

/* 看板视图 */
.sh-board { display: flex; gap: 10px; overflow-x: auto; padding: 12px; align-items: flex-start; }
.sh-bcol { flex: 0 0 216px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 9px; }
.sh-bcol-h { display: flex; align-items: center; gap: 6px; padding: 2px 4px 8px; font-size: 12.5px; }
.sh-bcol-h b { font-weight: 600; }
.sh-bcol-h span { margin-left: auto; font-size: 11px; color: var(--ink-3); background: var(--surface); border-radius: 999px; padding: 1px 7px; }
.sh-bcol-b { display: flex; flex-direction: column; gap: 6px; }
.sh-bcard { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.sh-bcard:hover { border-color: #d3d3cc; box-shadow: var(--sh-1); }
.sh-bcard b { display: block; font-size: 12.5px; font-weight: 500; }
.sh-bcard span { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-bempty { font-size: 11.5px; color: var(--ink-3); text-align: center; padding: 12px 0; }

/* 分析视图 */
.sh-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line-2); border-bottom: 1px solid var(--line-2); }
.sh-kpi { background: var(--surface); padding: 12px 14px; }
.sh-kpi b { display: block; font-family: var(--mono); font-size: 20px; letter-spacing: -.02em; }
.sh-kpi span { font-size: 11.5px; color: var(--ink-3); }
.sh-sumrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 12px 12px 0; }
.sh-sumitem { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; background: var(--surface-2); }
.sh-sumitem span { display: block; font-size: 11.5px; color: var(--ink-3); }
.sh-sumitem b { font-family: var(--mono); font-size: 19px; letter-spacing: -.02em; }
.sh-sumitem i { font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-left: 8px; }
.sh-statslist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; padding: 12px; }
.sh-st { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; background: var(--surface); }
.sh-st-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sh-st-h b { font-size: 13px; }
.sh-st-type { font-size: 10.5px; color: var(--ink-2); background: #f2f2ee; border-radius: 5px; padding: 1px 6px; }
.sh-st-h .muted { margin-left: auto; font-size: 11px; }
.sh-bar { height: 5px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin: 9px 0 10px; }
.sh-bar i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.sh-st-nums { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--ink-3); margin-bottom: 8px; }
.sh-st-nums b { color: var(--ink); font-family: var(--mono); }
.sh-dist { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-2); margin-top: 5px; }
.sh-dist span { width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-dist i { flex: 1; height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.sh-dist i b { display: block; height: 100%; background: #9aa6f2; }
.sh-dist em { font-style: normal; font-family: var(--mono); color: var(--ink-3); width: 26px; text-align: right; }

/* 列设置 */
.sh-cols { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow: auto; }
.sh-colrow { display: grid; grid-template-columns: minmax(90px, 1.6fr) 92px 74px 48px 48px 58px; gap: 6px; align-items: center; }
.sh-colhead { font-size: 11.5px; color: var(--ink-3); padding: 0 2px; }
.sh-colrow .ctrl { height: 32px; font-size: 12.5px; }
.sh-colrow .sh-w { text-align: center; }
.sh-cb { display: grid; place-items: center; }
.sh-cb input { width: 15px; height: 15px; accent-color: var(--blue); }
.sh-colacts { display: flex; gap: 2px; }
.sh-colacts button { width: 25px; height: 25px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; font-size: 12px; color: var(--ink-2); }
.sh-colacts button:hover { background: #f4f4f0; }
.sh-colopts { padding: 0 0 2px 0; }
.sh-colopts .ctrl { height: 30px; font-size: 12px; }

/* 分享面板 */
.sh-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sh-mode { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 10px; }
.sh-mode b { display: block; font-size: 12.5px; }
.sh-mode span { font-size: 11px; color: var(--ink-3); line-height: 1.5; }
.sh-mode.on { border-color: var(--blue); background: var(--blue-wash); }
.sh-mode.on b { color: var(--blue); }
.sh-explife { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.sh-linkrow { display: flex; gap: 6px; margin-top: 12px; }
.sh-linkrow .ctrl { flex: 1; height: 34px; font-size: 12px; font-family: var(--mono); }
.sh-qr { display: grid; place-items: center; margin: 12px 0 4px; }
.sh-qr svg { width: 148px; height: 148px; border-radius: 8px; background: #fff; }
.sh-sharemeta { font-size: 11.5px; color: var(--ink-3); }

/* 行详情 / 表单 */
.sh-form { display: flex; flex-direction: column; gap: 10px; }
.sh-field { display: flex; flex-direction: column; }
.sh-form .ctrl { font-size: 13px; }
.sh-form textarea.ctrl { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.6; }
.sh-req { color: var(--orange); font-style: normal; margin-left: 2px; }

/* 分享页 */
.sh-share-page { display: flex; flex-direction: column; gap: 12px; }
.sh-share-head { display: flex; align-items: center; gap: 12px; }
.sh-share-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.sh-share-head .muted { font-size: 12px; }
.sh-share-err { display: flex; flex-direction: column; gap: 6px; padding: 26px 22px; }
.sh-share-err b { font-size: 15px; }
.sh-form-card { padding: 18px 18px 20px; }
.sh-submit { width: 100%; margin-top: 14px; height: 42px; }
.sh-done { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 10px; text-align: center; }
.sh-done b { font-size: 16px; }
.sh-done span { font-size: 12.5px; color: var(--ink-3); }
.sh-foot-note { text-align: center; font-size: 11.5px; color: var(--ink-3); margin: 0; }
.sh-share-table { overflow: hidden; }
.sh-share-table .sh-gwrap { max-height: none; }
.sh-cobar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--blue-wash); color: #33407e; border: 1px solid #dbe1fb;
  border-radius: var(--r-md); padding: 9px 12px; font-size: 12.5px;
}
.sh-cobar button { margin-left: auto; border: 1px solid #c4cef7; background: #fff; border-radius: 7px; padding: 4px 10px; font-size: 12px; }

/* 工作台入口卡 */
.wb-sheets-entry { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; transition: border-color .16s ease, box-shadow .16s ease; }
.wb-sheets-entry:hover { border-color: #d3d3cc; box-shadow: var(--sh-2); }
.wb-se-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-wash); color: var(--blue); font-size: 16px; font-weight: 600; flex: 0 0 auto; }
.wb-se-t { min-width: 0; display: flex; flex-direction: column; }
.wb-se-t b { font-size: 13.5px; }
.wb-se-t span { font-size: 12px; line-height: 1.5; }
.wb-se-go { margin-left: auto; font-size: 12.5px; color: var(--blue); white-space: nowrap; }

/* 手机：分享页要能填，编辑器只做只读兜底 */
@media (max-width: 720px) {
  .sh-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .sh-stat { padding: 10px; }
  .sh-stat b { font-size: 18px; }
  .sh-scenes { grid-template-columns: 1fr; }
  .sh-grid { grid-template-columns: 1fr; }
  .sh-modes { grid-template-columns: 1fr; }
  .sh-modal { padding: 16px; max-height: 90vh; }
  .sh-head-row { gap: 6px; }
  .sh-name { font-size: 15px; min-width: 120px; }
  .sh-head-row .btn { padding: 0 10px; font-size: 12px; }
  .sh-views { padding: 8px 8px 0; }
  .sh-vtab { padding: 6px 9px; font-size: 12.5px; }
  .sh-search-sm { min-width: 110px; }
  .sh-tools { padding: 8px; }
  .sh-tool { padding: 6px 8px; font-size: 12px; }
  .sh-gwrap { max-height: 60vh; }
  .sh-statslist { grid-template-columns: 1fr; }
  .sh-colrow { grid-template-columns: minmax(70px, 1.4fr) 76px 58px 38px 38px 52px; }
  .sh-board { padding: 10px 8px; gap: 8px; }
  .sh-bcol { flex-basis: 78%; }
  .sh-cards { grid-template-columns: 1fr; padding: 10px; }
  .sh-share-table .sh-table { font-size: 12px; }
  .body-share .sh-share-page { gap: 10px; }
  .sh-foot-note { padding-bottom: 10px; }
}
