/* 留灯 LiuDeng — 深夜暖灯主题 */

:root {
  --bg: #16120e;
  --bg-panel: #1e1913;
  --bg-elev: #262018;
  --bg-input: #120e0a;
  --line: #332a1f;
  --line-soft: #2b241b;
  --text: #ede4d4;
  --text-dim: #a3947d;
  --text-faint: #6f6352;
  --accent: #e8a24e;
  --accent-soft: rgba(232, 162, 78, 0.14);
  --accent-line: rgba(232, 162, 78, 0.35);
  --danger: #c96a5a;
  --ok: #8fae7d;
  --serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

button { font-family: var(--sans); cursor: pointer; }
input, textarea, select {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent-line); }
textarea { resize: vertical; min-height: 40px; }
select { appearance: none; }

.hidden { display: none !important; }

/* ============ 左侧导航 ============ */

#sidebar {
  width: 196px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 12px 14px;
  min-height: 0;
}

.sb-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 10px 18px;
  flex-wrap: wrap;
  min-width: 0;
}
.sb-logo {
  font-family: var(--serif);
  font-size: 21px;
  white-space: nowrap;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.sb-sub { font-size: 9px; letter-spacing: 0.3em; color: var(--text-faint); }

.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-spacer { flex: 1; }
.sb-bottom { display: flex; flex-direction: column; gap: 2px; }

.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  text-align: left;
  transition: all 0.15s;
  width: 100%;
}
.sb-item:hover { background: var(--bg-elev); color: var(--text); }
.sb-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}
.sb-icon { font-size: 15px; width: 20px; text-align: center; }

.sb-userchip {
  border-top: 1px solid var(--line-soft);
  padding: 10px 12px 10px;
  margin-bottom: 8px;
}
.sb-userchip-name { font-size: 13px; font-weight: 600; }
.sb-userchip-sub { font-size: 11px; color: var(--text-faint); margin-top: 1px; }

/* ============ 登录页 ============ */

#login {
  min-height: 100vh;
  height: auto;
  overflow-y: auto;          /* 窗口矮或内容多时整页滚动 */
  display: flex;
  flex-direction: column;
  align-items: center;       /* 水平居中 */
  justify-content: flex-start; /* 垂直交给卡片 margin auto：够高时居中，超高时可完整滚动不裁切 */
  padding: 20px 0;
  background:
    radial-gradient(ellipse at 50% -30%, rgba(232,162,78,0.09), transparent 60%),
    var(--bg);
}
.login-card {
  width: min(380px, 92vw);
  max-height: none;          /* 不再内部裁切，内容完整可见 */
  overflow: visible;
  margin-top: auto;
  margin-bottom: auto;       /* 与 #login 的 flex-start 配合：居中且不被裁切 */
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: card-in 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.login-brand { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.login-card h1 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.login-tabs { display: flex; gap: 4px; background: var(--bg-input); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; }
.ltab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 7px 0;
  border-radius: 6px;
  font-size: 13.5px;
  transition: all 0.15s;
}
.ltab.active { background: var(--bg-elev); color: var(--accent); font-weight: 600; }
.login-card input { padding: 11px 13px; }
.login-hint { font-size: 12px; color: var(--danger); min-height: 16px; }
.login-note {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px 6px; text-align: center;
}
.login-note a { white-space: nowrap; cursor: pointer; }
.login-note .note-sep { flex: 0 0 auto; }
.login-card .primary-btn { padding: 11px 0; width: 100%; }

/* 登录/注册模式面板 */
.login-pane { display: flex; flex-direction: column; gap: 12px; }

/* 分段按钮（地区 / 码类型） */
.seg {
  display: flex; gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  width: 100%;
}
.seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 7px 0;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--bg-elev); color: var(--accent); font-weight: 600; }

/* 注册：手机号 + 区号 */
.reg-phone-row { display: flex; gap: 8px; align-items: stretch; }
.reg-phone-row input { flex: 1; min-width: 0; }
.phone-prefix {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  min-width: 62px;
  padding: 0 10px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  white-space: nowrap;
}
.cc-btn { cursor: pointer; font-family: inherit; color: var(--accent); border-color: var(--accent-line); }
.cc-btn:hover { background: var(--bg-elev); }
.reg-live-hint { font-size: 12px; min-height: 15px; margin-top: -6px; }

/* 注册向导（6 步） */
.wiz-progress {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.wiz-step { display: flex; flex-direction: column; gap: 12px; }
.wiz-title { font-family: var(--serif); font-size: 15.5px; font-weight: 700; color: var(--text); }
.wiz-desc { font-size: 12px; color: var(--text-faint); line-height: 1.65; margin-top: -6px; }
.wiz-desc:empty { display: none; }
.wiz-note { font-size: 12px; color: var(--text-faint); line-height: 1.6; margin-top: -6px; }
.wiz-note-link { color: var(--accent); cursor: pointer; text-decoration: underline; }
.wiz-note-link:hover { filter: brightness(1.2); }
.wiz-select { width: 100%; min-width: 0; padding: 11px 13px; font-size: 14px; }
.wiz-step .reg-agree { margin: 0; align-items: flex-start; }
.wiz-step .reg-agree input { margin-top: 2px; flex-shrink: 0; }

/* 第 6 步 · 家庭监护绑定区（家长 ID + 临时密钥） */
.wiz-family-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 11px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}
.wiz-family-head { display: flex; align-items: center; gap: 7px; }
.rg-badge { font-size: 14px; line-height: 1; }
.wiz-family-title { font-size: 13px; font-weight: 600; color: var(--accent); }
.wiz-family-box .wiz-note { margin-top: 0; }
.wiz-family-box input { padding: 9px 11px; font-size: 13px; }

/* 步骤内错误提示（kimi 填） */
.wiz-hint { font-size: 12px; color: var(--danger); min-height: 16px; line-height: 1.55; }
.wiz-hint:empty { display: none; }

/* 向导底部按钮行 */
.wiz-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.wiz-actions .ghost-btn { flex: 0 0 auto; padding: 9px 18px; }
.wiz-actions .primary-btn { flex: 1 1 auto; width: auto; padding: 11px 0; }

/* 国家区号选择器 */
#cc-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; }
.cc-card { width: min(420px, 92vw); }
.cc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 18px; }
.cc-search { padding: 9px 12px; }
.cc-list {
  flex: 1; min-height: 120px; max-height: 44vh;
  overflow-y: auto;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.cc-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.cc-item:last-child { border-bottom: none; }
.cc-item:hover { background: var(--bg-elev); }
.cc-item.active { color: var(--accent); }
.cc-code { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cc-item.active .cc-code { color: var(--accent); }
.cc-empty { padding: 16px; text-align: center; color: var(--text-faint); font-size: 13px; }
.cc-manual { display: flex; gap: 8px; }
.cc-manual input { flex: 1; min-width: 0; padding: 9px 12px; }

/* ============ 页面通用 ============ */

.page { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; }
.page-inner { max-width: 720px; margin: 0 auto; padding: 30px 32px 60px; }
.page-head { padding: 26px 32px 6px; border-bottom: 1px solid var(--line-soft); }
.page-head h2 { font-family: var(--serif); font-size: 20px; font-weight: 700; }

/* ============ 第一页：控制台 ============ */

#page-console {
  background:
    radial-gradient(ellipse at 50% -30%, rgba(232,162,78,0.07), transparent 60%),
    var(--bg);
}
.console-inner { max-width: 760px; margin: 0 auto; padding: 44px 32px 60px; }

.console-hero h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.console-hero p { color: var(--text-dim); font-size: 13.5px; margin-bottom: 34px; }

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}

.entry-bubble {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 14px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text);
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}
.entry-bubble:hover {
  border-color: var(--accent-line);
  background: var(--bg-elev);
  transform: translateY(-2px);
}
.entry-icon { font-size: 30px; }
.entry-title { font-family: var(--serif); font-size: 15.5px; font-weight: 700; }

/* 控制台 · 家庭监护入口卡（开启家庭监护后显示） */
.console-family-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.cfc-main { min-width: 0; }
.cfc-title { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.04em; }
.cfc-desc { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.cfc-btn { flex-shrink: 0; white-space: nowrap; }

/* 最近动态气泡：底部粗边 + 居中「更多」 */
.activity-bubble {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.act-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 18px 10px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.act-list { padding: 0 18px 8px; }
.act-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px solid var(--line-soft);
}
.act-item:last-child { border-bottom: none; }
.act-time { color: var(--text-faint); font-size: 12px; flex-shrink: 0; width: 44px; }
.act-emoji { flex-shrink: 0; }
.act-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-empty { padding: 10px 18px 18px; font-size: 13px; color: var(--text-faint); }

.act-more {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  border-top: 3px solid var(--bg-elev);
  padding: 10px 0 12px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  transition: color 0.15s;
}
.act-more:hover { color: var(--accent); }

/* ============ 第二页：聊天 ============ */

#page-chat { display: flex; flex-direction: column; }

#chat-list { flex: 1; min-height: 0; overflow-y: auto; }

.conv-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 32px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.14s;
}
.conv-item:hover { background: var(--bg-panel); }
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.conv-name { font-weight: 600; font-size: 15px; }
.conv-time { font-size: 11.5px; color: var(--text-faint); flex-shrink: 0; }
.conv-preview {
  font-size: 13px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.conv-empty { text-align: center; padding: 80px 20px; }
.conv-empty .empty-mark { font-size: 40px; margin-bottom: 12px; }
.conv-empty p { color: var(--text-dim); margin-bottom: 22px; }

#chat-session {
  display: grid;
  grid-template-columns: 1fr 340px;
  flex: 1;
  min-height: 0;
  transition: grid-template-columns 0.25s ease;
}
#chat-session.memory-closed { grid-template-columns: 1fr 0px; }
#chat-session.memory-closed #memory-pane { border-left: none; }

#chat-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(232,162,78,0.05), transparent 55%),
    var(--bg);
}

#chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(22, 18, 14, 0.85);
  backdrop-filter: blur(8px);
}
#chat-head-info { display: flex; align-items: center; gap: 11px; min-width: 0; }
#chat-name { font-family: var(--serif); font-size: 16.5px; font-weight: 700; }
#chat-sub { font-size: 11.5px; color: var(--text-faint); }
#chat-head-actions { display: flex; gap: 8px; }

#messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 0 10px;
  position: relative;
}

.msg-row { display: flex; margin: 0 0 16px; padding: 0 20px; gap: 10px; }
.msg-row.user { flex-direction: row-reverse; }
/* 宽度上限放在「内容列」上，相对整行计算；不要在气泡上用百分比（会相对自适应父元素形成循环，导致极窄） */
.msg-row > div:not(.avatar) {
  min-width: 0;
  max-width: 66%;
}
.msg-bubble {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 4px 14px 14px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14.5px;
  line-height: 1.75;
}
.msg-row.user .msg-bubble {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  border-radius: 14px 4px 14px 14px;
}
.msg-meta { margin-top: 5px; font-size: 10.5px; color: var(--text-faint); display: flex; gap: 8px; align-items: center; }
.proactive-tag {
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: 20px;
  padding: 0 7px;
  font-size: 10px;
}
.greeting-tag { color: var(--text-faint); }

.typing .msg-bubble::after {
  content: "…";
  animation: blink 1s steps(2) infinite;
  color: var(--accent);
}
@keyframes blink { 50% { opacity: 0.3; } }

#jump-bottom {
  position: absolute;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  border-radius: 22px;
  padding: 7px 18px;
  font-size: 12.5px;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  animation: toast-in 0.2s ease;
}
#jump-bottom:hover { background: var(--accent-soft); }

#composer {
  padding: 12px 20px 18px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
#composer textarea {
  flex: 1;
  max-height: 140px;
  border-radius: var(--radius);
  padding: 12px 15px;
  white-space: pre;        /* 不自动换行 */
  overflow-x: auto;        /* 超长横向滚动 */
  overflow-y: hidden;
  word-break: normal;
  overflow-wrap: normal;
}
#send-btn { padding: 10px 24px; }

/* ============ 记忆抽屉 ============ */

#memory-pane {
  background: var(--bg-panel);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
#memory-pane.collapsed { display: none; }

.mp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px 12px;
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 700;
  border-bottom: 1px solid var(--line-soft);
}
.mp-h {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.mp-hint { font-size: 10px; color: var(--text-faint); font-weight: 400; letter-spacing: 0; }

#memory-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 30px; }
.mp-section { padding: 14px 20px 6px; border-bottom: 1px solid var(--line-soft); }

.mem-item {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.65;
}
.mem-item .mi-src { font-size: 10px; color: var(--text-faint); margin-top: 4px; }

.mem-add { display: flex; gap: 8px; margin-top: 4px; }
.mem-add input { flex: 1; font-size: 13px; }
.mem-raw { margin-top: 12px; }
.mem-raw summary { font-size: 12px; color: var(--text-faint); cursor: pointer; user-select: none; }
.mem-raw textarea { margin-top: 8px; font-size: 12.5px; line-height: 1.7; }
.mem-raw .mini-btn { margin-top: 8px; }

.note-item { margin-bottom: 12px; }
.note-name { font-size: 11px; color: var(--text-faint); margin-bottom: 4px; }
.note-body {
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
  line-height: 1.65;
}
.empty-note { font-size: 12px; color: var(--text-faint); padding: 4px 0; }

/* ============ 第三/四页：设置与账户 ============ */

.set-section {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 18px;
}
.set-h {
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
}
.set-row + .set-row { border-top: 1px solid var(--line-soft); }
.set-label { font-size: 14px; }
.set-desc { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.set-desc.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; word-break: break-all; }
.uid-pill {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.set-select { width: auto; min-width: 200px; }
.set-input { width: auto; min-width: 220px; text-align: right; }
.set-foot { margin-top: 22px; display: flex; justify-content: flex-end; }

/* ============ 家庭监护页 ============ */
.family-head { padding: 12px 20px; }
.family-pill { margin-left: 8px; font-size: 11px; vertical-align: middle; }
.family-card .set-h { display: flex; align-items: center; }
.family-card .set-input { min-width: 150px; max-width: 200px; }
.family-foot { align-items: center; gap: 12px; margin-top: 14px; }
.family-result { flex: 1; font-size: 12px; color: var(--text-faint); line-height: 1.5; }
.family-save-btn { padding: 8px 18px; font-size: 13px; flex-shrink: 0; }
.family-empty { padding: 44px 20px; }
.family-empty .set-desc { max-width: 470px; margin: 0 auto; line-height: 1.75; }
.family-note { margin-top: 12px; line-height: 1.75; }
.family-tools { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; }
.family-tools .mini-btn { padding: 8px 14px; }

/* ============ 管理页 ============ */

.page-inner.wide { max-width: 980px; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
}
.stat-num { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.admin-table th {
  text-align: left;
  color: var(--text-faint);
  font-weight: 600;
  font-size: 12px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  white-space: nowrap;
}
.admin-table tr:hover td { background: var(--bg-elev); }
.admin-table .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-btn {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  transition: all 0.13s;
}
.row-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.row-btn.danger:hover { color: var(--danger); border-color: rgba(201,106,90,0.5); }
.role-select {
  width: auto;
  padding: 4px 8px;
  font-size: 12.5px;
  background: var(--bg-input);
}
.wx-select {
  width: auto;
  min-width: 180px;
  max-width: 300px;
  padding: 4px 8px;
  font-size: 12.5px;
  background: var(--bg-input);
}

.code-badge { font-size: 11px; padding: 2px 9px; border-radius: 20px; border: 1px solid var(--line); color: var(--text-dim); }
.code-badge.used { color: var(--text-faint); }
.code-badge.unused { color: var(--ok); border-color: rgba(143,174,125,0.4); }
.code-badge.invite { color: var(--accent); border-color: var(--accent-line); }
.code-badge.recharge { color: var(--text-dim); }
.code-mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

.status-pill {
  font-size: 11.5px;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  flex-shrink: 0;
}
.status-pill.ok { color: var(--ok); border-color: rgba(143,174,125,0.4); }
.status-pill.err { color: var(--danger); border-color: rgba(201,106,90,0.4); }
.status-pill.muted { color: var(--text-faint); }

.fact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 13.5px;
}
.fact-del {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 15px;
  padding: 0 4px;
}
.fact-del:hover { color: var(--danger); }

/* ============ 弹窗 ============ */

#modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(10, 8, 5, 0.72);
  backdrop-filter: blur(3px);
}
.modal-card {
  position: relative;
  width: min(720px, 94vw);
  max-height: 86vh;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: card-in 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  border-bottom: 1px solid var(--line-soft);
}
#modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 24px; }

/* 隐私提示同意弹窗 */
.consent-body { text-align: center; padding: 6px 4px 2px; }
.consent-icon { font-size: 34px; margin-bottom: 14px; }
.consent-text {
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 22px;
  padding: 0 10px;
}
.consent-actions { display: flex; gap: 12px; justify-content: center; }

/* 微信接入二维码弹窗 */
.qr-box { display: flex; flex-direction: column; align-items: center; padding: 6px 0 2px; }
.qr-box img {
  width: 260px;
  height: 260px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}
.consent-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 34px;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  transition: filter 0.15s, transform 0.1s;
}
.consent-btn:hover { filter: brightness(1.1); }
.consent-btn:active { transform: translateY(1px); }
.consent-btn.agree { background: #5f8f4e; }   /* 绿底 */
.consent-btn.reject { background: #b85545; }  /* 红底 */

/* 弹窗内的朋友网格 */
.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.modal-tile {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.modal-tile:hover { border-color: var(--accent-line); }
.modal-tile .tile-name { font-size: 15px; }
.modal-tile.new {
  border-style: dashed;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  color: var(--text-faint);
  background: transparent;
  font-size: 13px;
}
.modal-tile.new:hover { color: var(--accent); border-color: var(--accent-line); }

/* 周消息柱状图 */
.week-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
  height: 170px;
  padding: 10px 6px 0;
}
.week-col { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: 1; height: 100%; justify-content: flex-end; }
.week-bar {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(to top, rgba(232,162,78,0.55), var(--accent));
  border-radius: 5px 5px 2px 2px;
  min-height: 3px;
  transition: height 0.4s ease;
}
.week-num { font-size: 11px; color: var(--text-dim); }
.week-day { font-size: 11px; color: var(--text-faint); }
.week-total { text-align: center; font-size: 13px; color: var(--text-dim); padding: 12px 0 2px; }

/* 回应速度列表 */
.speed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.speed-row:last-child { border-bottom: none; }
.speed-name { width: 110px; font-size: 13.5px; flex-shrink: 0; }
.speed-track { flex: 1; height: 10px; background: var(--bg-input); border-radius: 6px; overflow: hidden; }
.speed-fill { height: 100%; background: linear-gradient(to right, rgba(232,162,78,0.55), var(--accent)); border-radius: 6px; transition: width 0.4s ease; }
.speed-val { width: 60px; text-align: right; font-size: 12px; color: var(--text-dim); flex-shrink: 0; }
.speed-empty { font-size: 13px; color: var(--text-faint); padding: 10px 0; }

/* ============ 通用按钮 ============ */

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  transition: all 0.15s;
}
.ghost-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.ghost-btn.round { padding: 6px 10px; font-size: 15px; }

.primary-btn {
  background: var(--accent);
  border: none;
  color: #1c1308;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 14px;
  transition: filter 0.15s, transform 0.1s;
}
.primary-btn:hover { filter: brightness(1.08); }
.primary-btn:active { transform: translateY(1px); }
.primary-btn:disabled { opacity: 0.45; cursor: default; }

.mini-btn {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12.5px;
}
.mini-btn:hover { border-color: var(--accent-line); }
.mini-btn.ghost { background: transparent; color: var(--text-dim); }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 18px;
  padding: 2px 8px;
  border-radius: 6px;
}
.icon-btn:hover { color: var(--text); background: var(--bg-elev); }

.danger-btn {
  background: transparent;
  border: 1px solid rgba(201, 106, 90, 0.5);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  transition: all 0.15s;
}
.danger-btn:hover { background: rgba(201, 106, 90, 0.12); }

/* ============ 头像 ============ */

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: radial-gradient(circle at 35% 30%, #33291d, #1d1812);
  border: 1px solid var(--line);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 32px; }
.avatar.sm { width: 30px; height: 30px; font-size: 16px; }

.empty-mark { font-size: 40px; margin-bottom: 14px; opacity: 0.9; }

/* ============ 开关 / 预设 ============ */

.switch { cursor: pointer; position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 22px;
  transition: 0.18s;
  cursor: pointer;
}
.slider::before {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  background: var(--text-faint);
  border-radius: 50%;
  transition: 0.18s;
}
.switch input:checked + .slider { background: var(--accent-soft); border-color: var(--accent-line); }
.switch input:checked + .slider::before { background: var(--accent); transform: translateX(18px); }
.switch.disabled { opacity: 0.45; }
.switch.disabled .slider { cursor: not-allowed; }

.preset-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.preset-label { font-size: 12px; color: var(--text-faint); width: 34px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.preset {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12.5px;
  transition: all 0.13s;
}
.preset:hover { border-color: var(--accent-line); }
.preset.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ============ 向导（沿用） ============ */

#wizard { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
#wizard.hidden { display: none; }
.wizard-overlay {
  position: absolute; inset: 0;
  background: rgba(10, 8, 5, 0.72);
  backdrop-filter: blur(3px);
}
.wizard-card {
  position: relative;
  width: min(880px, 94vw);
  max-height: 92vh;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: card-in 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.wizard-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 12px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
}

.wizard-tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--line-soft); }
.wtab {
  background: transparent; border: none;
  color: var(--text-faint);
  font-size: 14px;
  padding: 9px 4px 11px;
  margin-right: 18px;
  position: relative;
}
.wtab.active { color: var(--accent); font-weight: 600; }
.wtab.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px;
}

.wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 26px;
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 22px;
}
.tab { grid-column: 1; min-width: 0; }
.tab.hidden { display: none; }

.wizard-preview { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
.pv-label { font-size: 11px; color: var(--text-faint); margin-bottom: 8px; letter-spacing: 0.1em; }
.pv-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  position: sticky; top: 0;
}
.pv-avatar { margin: 0 auto 12px; }
.pv-name { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.pv-meta { font-size: 11.5px; color: var(--text-faint); margin-bottom: 10px; }
.pv-quote { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; }
.pv-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.pv-tag {
  font-size: 10.5px;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 20px;
  padding: 1px 8px;
}

.field-row { margin-bottom: 14px; }
.field-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field-row label em { color: var(--danger); font-style: normal; margin-left: 2px; }
.field-hint { display: block; font-size: 11px; color: var(--text-faint); margin-top: 4px; }

.avatar-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.avatar-edit { display: flex; align-items: center; gap: 12px; }
.avatar-ops { display: flex; flex-direction: column; gap: 6px; }
#emoji-picker { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.emoji-opt {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}
.emoji-opt:hover { border-color: var(--accent-line); }
.emoji-opt.sel { border-color: var(--accent); background: var(--accent-soft); }

.adv { margin: 6px 0 14px; }
.adv summary {
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.adv-tag {
  font-size: 10.5px;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  padding: 0 7px;
  border-radius: 20px;
}
.adv textarea { margin-top: 10px; }

.perm-section { margin-bottom: 20px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.perm-section:last-child { border-bottom: none; }

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
}
.switch-row > span:first-child { flex: 1; }
.soon-tag {
  font-size: 10.5px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 8px;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-top: 10px; }
.time-range { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); }
.time-range input { width: auto; padding: 6px 8px; font-size: 13px; }
.trigger-row { display: flex; gap: 18px; padding: 8px 0 4px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.check input { width: auto; accent-color: var(--accent); }

.wizard-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft);
}

/* ============ toast ============ */

#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--accent-line);
  color: var(--text);
  padding: 10px 22px;
  border-radius: 22px;
  font-size: 13.5px;
  z-index: 99;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  animation: toast-in 0.25s ease;
}
#toast.hidden { display: none; }
#toast.err { border-color: rgba(201,106,90,0.5); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #4d3f2a; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #65542f; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
  .entry-grid { grid-template-columns: 1fr; }
  .wizard-body { grid-template-columns: 1fr; }
  .wizard-preview { grid-column: 1; grid-row: auto; display: none; }
  #chat-session { grid-template-columns: 1fr; }
}


/* 管理控制台：服务状态条 + 审计日志 */
.adc-status-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.adc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  background: var(--bg-panel);
}
.adc-chip.ok { color: var(--ok); border-color: rgba(143,174,125,0.4); }
.adc-chip.bad { color: var(--danger); border-color: rgba(201,106,90,0.5); }
.adc-loading { font-size: 12px; color: var(--text-faint); }
.act-ip { display: inline-block; margin-left: 8px; font-size: 11px; color: var(--text-faint); font-family: ui-monospace, Menlo, monospace; }


/* 管理日志：筛选按钮 + 导出 */
.audit-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.audit-fbtn {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 16px;
  padding: 3px 12px;
  font-size: 12px;
  transition: all 0.13s;
}
.audit-fbtn:hover { color: var(--accent); border-color: var(--accent-line); }
.audit-fbtn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.audit-fbtn.export { margin-left: auto; color: var(--ok); border-color: rgba(143,174,125,0.4); }


/* 注册：同意条例勾选 */
.reg-agree { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); margin: 10px 0 4px; cursor: pointer; }
.reg-agree input { width: 15px; height: 15px; accent-color: var(--accent); }
.reg-agree a, .login-note a { color: var(--accent); cursor: pointer; text-decoration: underline; }
.reg-agree a:hover, .login-note a:hover { filter: brightness(1.2); }

/* 使用条例弹窗内容 */
.terms-wrap { text-align: left; }
.terms-wrap h2 { font-family: var(--serif); font-size: 20px; margin-bottom: 4px; color: var(--accent); }
.terms-meta { font-size: 11.5px; color: var(--text-faint); margin-bottom: 14px; }
.terms-box { background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.8; }
.terms-wrap h3 { font-size: 14px; color: var(--accent); margin: 14px 0 6px; font-family: var(--serif); }
.terms-wrap p { font-size: 12.8px; line-height: 1.85; color: var(--text); margin: 4px 0; }
.terms-wrap b { color: var(--accent-soft, #f2c48d); }
.terms-end { text-align: center; color: var(--text-faint); margin-top: 18px; font-style: italic; }
.terms-loading { text-align: center; color: var(--text-faint); padding: 20px; }

/* ============ 首次登录引导 ============ */
#onboard {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: radial-gradient(120% 90% at 50% 0%, #241a12 0%, var(--bg) 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px;
}
.ob-pane { width: 100%; max-width: 560px; animation: obFade 0.45s ease both; }
.ob-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }

.ob-lamp-wrap { position: relative; margin: 8px 0 10px; }
.ob-lamp { font-size: 54px; animation: obLampIn 0.8s cubic-bezier(.2,.8,.2,1) both; }
.ob-glow {
  position: absolute; inset: -28px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,162,78,0.35), transparent 68%);
  animation: obGlow 3.4s ease-in-out infinite;
}
.ob-brand { font-family: var(--serif); font-size: 40px; letter-spacing: 6px; color: var(--accent); margin: 4px 0 2px; }
.ob-brand-sub { font-size: 11px; letter-spacing: 5px; color: var(--text-faint); }
.ob-slogan { color: var(--text-dim); font-size: 13.5px; margin: 12px 0 22px; }

.ob-copy {
  text-align: left; width: 100%;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
  color: var(--text); font-size: 13.5px; line-height: 2.0;
}
.ob-copy .ob-co-title { color: var(--text-faint); font-size: 12px; margin-bottom: 10px; }
.ob-copy ul { list-style: none; padding: 0; margin: 0; }
.ob-copy li { position: relative; padding-left: 18px; }
.ob-copy li::before { content: '·'; position: absolute; left: 6px; color: var(--accent); font-weight: 700; }
.ob-copy li + li { margin-top: 2px; }

.ob-title { font-family: var(--serif); font-size: 26px; color: var(--text); margin: 6px 0 6px; }
.ob-desc { color: var(--text-faint); font-size: 12.5px; margin-bottom: 18px; }
.ob-form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.ob-form input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--line);
  color: var(--text); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px;
}
.ob-form input:focus { border-color: var(--accent-line); outline: none; }
.ob-gender { display: flex; gap: 8px; }
.ob-gender button {
  flex: 1; background: var(--bg-elev); border: 1px solid var(--line); color: var(--text-dim);
  border-radius: var(--radius-sm); padding: 10px 0; font-size: 13.5px; transition: all .15s;
}
.ob-gender button.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

.ob-actions {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; margin-top: 22px; gap: 12px;
}
.ob-skip {
  background: none; border: none; color: var(--text-faint);
  font-size: 13px; padding: 10px 4px; cursor: pointer; transition: color .15s;
}
.ob-skip:hover { color: var(--text-dim); }
.ob-next { padding: 11px 30px; }

/* 引导动画：手机演示 */
.ob-stage { display: flex; justify-content: center; margin: 4px 0 14px; }
.ob-phone {
  position: relative; width: 246px; height: 420px;
  background: #0f0c09; border: 2px solid var(--line);
  border-radius: 30px; padding: 12px 10px 16px;
  box-shadow: 0 22px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(232,162,78,0.08);
  overflow: hidden;
}
.ob-notch { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 62px; height: 5px; border-radius: 3px; background: #2a211a; }
.ob-home-bar { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); width: 74px; height: 4px; border-radius: 3px; background: #2a211a; }
.ob-screen { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }

.ob-anim { animation: obPop .42s cubic-bezier(.2,.9,.3,1.2) both; }
.ob-screen .ob-row { display: flex; align-items: flex-end; gap: 6px; }
.ob-screen .ob-row.me { flex-direction: row-reverse; }
.ob-screen .ob-ava { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-line); display: flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.ob-screen .ob-bub {
  max-width: 76%; background: var(--bg-elev); border: 1px solid var(--line-soft);
  color: var(--text); font-size: 12px; line-height: 1.6; padding: 7px 10px;
  border-radius: 4px 12px 12px 12px;
}
.ob-screen .ob-row.me .ob-bub { background: var(--accent-soft); border-color: var(--accent-line); border-radius: 12px 4px 12px 12px; }
.ob-screen .ob-card {
  background: var(--bg-elev); border: 1px solid var(--accent-line);
  border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px;
}
.ob-screen .ob-card .ob-ava { width: 30px; height: 30px; font-size: 16px; }
.ob-screen .ob-card-name { font-size: 12.5px; color: var(--text); }
.ob-screen .ob-card-sub { font-size: 10.5px; color: var(--text-faint); }
.ob-screen .ob-chip {
  align-self: center; font-size: 10.5px; color: var(--accent);
  background: rgba(232,162,78,0.10); border: 1px solid var(--accent-line);
  border-radius: 20px; padding: 4px 10px;
}
.ob-screen .ob-typing { display: flex; gap: 3px; align-items: center; }
.ob-screen .ob-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); display: block; animation: obTyping 1.1s infinite; }
.ob-screen .ob-typing i:nth-child(2) { animation-delay: .18s; }
.ob-screen .ob-typing i:nth-child(3) { animation-delay: .36s; }
.ob-screen .ob-tag { font-size: 9.5px; color: var(--text-faint); text-align: center; letter-spacing: 1px; margin-top: 2px; }
.ob-screen .ob-btnline {
  margin: 2px auto 0; font-size: 11px; color: #16120e; background: var(--accent);
  border-radius: 8px; padding: 7px 16px; font-weight: 600;
}

.ob-step-text { color: var(--text-dim); font-size: 13px; line-height: 1.9; min-height: 44px; padding: 0 8px; }
.ob-dots { display: flex; gap: 7px; justify-content: center; margin: 14px 0 2px; }
.ob-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: block; transition: all .25s; }
.ob-dots i.on { background: var(--accent); width: 18px; border-radius: 5px; }

@keyframes obFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes obLampIn { from { opacity: 0; transform: scale(.6) translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes obGlow { 0%,100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes obPop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes obTyping { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

/* 公司名展示 */
.vendor-line { font-size: 11.5px; color: var(--text-faint); letter-spacing: 1px; margin-top: 6px; }
.sb-vendor { display: block; font-size: 10px; color: var(--text-faint); letter-spacing: 2px; margin-top: 3px; white-space: nowrap; }

.note-sep { margin: 0 6px; color: var(--text-faint); }
.note-admin-only #login-terms-link, .note-admin-only .note-sep { display: none; }

/* ============ 引导升级：Apple 宣传页质感 ============ */
#onboard { background: radial-gradient(120% 90% at 50% 0%, #2b1e12 0%, var(--bg) 60%); }

/* 渐变品牌字 */
.ob-brand {
  background: linear-gradient(100deg, #ffd9a0 0%, var(--accent) 45%, #b06a2e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: obTracking 1.4s cubic-bezier(.22,1,.36,1) both;
}
@keyframes obTracking { from { letter-spacing: 0.55em; opacity: 0; filter: blur(6px); } to { letter-spacing: 0.18em; opacity: 1; filter: blur(0); } }
.ob-brand-sub { animation: obBlurIn 1.2s .3s cubic-bezier(.22,1,.36,1) both; }
.ob-slogan { animation: obBlurIn 1.1s .45s cubic-bezier(.22,1,.36,1) both; }
@keyframes obBlurIn { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }

/* 灯：双层光晕脉冲 */
.ob-lamp { font-size: 88px; filter: drop-shadow(0 0 34px rgba(232,162,78,.55)); }
.ob-lamp-wrap::before, .ob-lamp-wrap::after {
  content: ''; position: absolute; left: 50%; top: 50%; border-radius: 50%;
  border: 1px solid rgba(232,162,78,.35); transform: translate(-50%,-50%);
  animation: obRing 3.2s ease-out infinite;
}
.ob-lamp-wrap::before { width: 130px; height: 130px; }
.ob-lamp-wrap::after { width: 190px; height: 190px; animation-delay: 1.1s; }
@keyframes obRing { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.55); } 30% { opacity: .9; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.25); } }

/* 介绍页清单：交错弹簧入场 */
.ob-copy li { animation: obSpring .7s cubic-bezier(.34,1.56,.64,1) both; }
.ob-copy li:nth-child(1) { animation-delay: .55s; }
.ob-copy li:nth-child(2) { animation-delay: .70s; }
.ob-copy li:nth-child(3) { animation-delay: .85s; }
.ob-copy li:nth-child(4) { animation-delay: 1.00s; }
.ob-copy li:nth-child(5) { animation-delay: 1.15s; }
.ob-next { animation: obBlurIn .8s 1.25s cubic-bezier(.22,1,.36,1) both; }

/* 引导屏：极光背景 + 浮动手机 */
.ob-stage { position: relative; }
.ob-aurora { position: absolute; inset: -30px -40px; pointer-events: none; overflow: hidden; border-radius: 40px; }
.ob-aurora::before, .ob-aurora::after {
  content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  filter: blur(70px); opacity: .5;
}
.ob-aurora::before { background: radial-gradient(circle, rgba(232,162,78,.75), transparent 65%); top: -40px; left: -50px; animation: obDrift 11s ease-in-out infinite alternate; }
.ob-aurora::after { background: radial-gradient(circle, rgba(176,106,46,.65), transparent 65%); bottom: -50px; right: -60px; animation: obDrift 14s ease-in-out infinite alternate-reverse; }
@keyframes obDrift { from { transform: translate(0,0) scale(1); } to { transform: translate(46px,34px) scale(1.18); } }

.ob-phone {
  animation: obFloat 6.5s ease-in-out infinite;
  position: relative; z-index: 1;
}
@keyframes obFloat {
  0%,100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-14px) rotate(1.2deg); }
}
.ob-phone::after {
  content: ''; position: absolute; left: 12%; right: 12%; bottom: -26px; height: 26px;
  background: radial-gradient(ellipse at center, rgba(232,162,78,.4), transparent 70%);
  filter: blur(6px); z-index: -1;
  animation: obShadow 6.5s ease-in-out infinite;
}
@keyframes obShadow { 0%,100% { opacity: .7; transform: scaleX(1); } 50% { opacity: .4; transform: scaleX(.86); } }

/* 弹簧气泡（替代原 obPop） */
.ob-anim { animation: obSpring .62s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes obSpring {
  from { opacity: 0; transform: translateY(24px) scale(.88); filter: blur(7px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* 步骤大标题 + 渐变进度条 */
.ob-step-title {
  font-family: var(--serif); font-size: 25px; margin: 2px 0 8px;
  background: linear-gradient(100deg, #ffd9a0, var(--accent) 60%, #b06a2e);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: obBlurIn .7s cubic-bezier(.22,1,.36,1) both;
}
.ob-step-text { animation: obBlurIn .7s .12s cubic-bezier(.22,1,.36,1) both; }
.ob-progress {
  width: 150px; height: 3px; border-radius: 2px; overflow: hidden;
  background: var(--line); margin: 16px auto 4px;
}
.ob-progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #f2b96b, var(--accent));
  transition: width .6s cubic-bezier(.22,1,.36,1);
}
.ob-step-count { font-size: 11px; color: var(--text-faint); letter-spacing: 2px; margin-top: 6px; }

/* 码表状态分区小按钮 */
.seg-sm .seg-btn { padding: 4px 12px; font-size: 12px; }
.seg-sm .seg-btn b { color: var(--accent); font-weight: 600; margin-left: 2px; }

/* 码管理：入口卡片 + 空位 */
.code-entry-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.code-entry {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; text-align: left; transition: all .18s;
}
.code-entry:hover { border-color: var(--accent-line); background: var(--bg-elev); transform: translateY(-2px); }
.code-entry-icon { font-size: 20px; }
.code-entry-title { font-family: var(--serif); font-size: 15px; color: var(--text); }
.code-entry-sub { font-size: 11.5px; color: var(--text-faint); }
.code-slot-empty td { color: var(--text-faint); font-size: 12px; text-align: center; letter-spacing: 2px; font-style: italic; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* 可点击统计卡 */
.stat-card.clickable { cursor: pointer; transition: all .16s; font-family: inherit; }
.stat-card.clickable:hover { border-color: var(--accent-line); transform: translateY(-2px); background: var(--bg-elev); }

/* ============ 邀请码 / 充值码 管理页 ============ */
.page-head-sub { font-size: 12px; color: var(--text-faint); }
.set-h-note { font-family: var(--sans); font-size: 11.5px; font-weight: 400; color: var(--text-faint); letter-spacing: 0; margin-left: 6px; }

/* 生成区表单 */
.gen-grid { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-start; }
.gen-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.genw-sm { width: 112px; }
.genw-md { width: 200px; }
.genw-lg { width: 258px; }
.gen-label { font-size: 12px; color: var(--text-faint); }
.gen-field .seg { width: auto; }
.gen-field .seg-btn { padding: 5px 8px; font-size: 12px; white-space: nowrap; }
.gen-custom { margin-top: 2px; font-size: 13px; }
.gen-select { width: 100%; font-size: 13px; padding: 8px 10px; }
.gen-submit { margin-left: auto; justify-content: flex-end; padding-top: 22px; }
.gen-submit .primary-btn { white-space: nowrap; padding: 9px 22px; }

/* 生成结果面板 */
.code-result {
  margin-top: 16px; padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
}
.cr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cr-title { font-size: 13px; color: var(--ok); }
.cr-title.err { color: var(--danger); }
.cr-actions { margin-left: auto; display: flex; gap: 6px; }
.cr-warn { margin-top: 8px; font-size: 12px; color: var(--danger); }
.cr-hint { margin-top: 8px; font-size: 12px; color: var(--text-faint); }
.code-out {
  margin-top: 10px; padding: 10px 12px;
  max-height: 190px; overflow: auto;
  background: var(--bg-input);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12.5px; line-height: 1.85;
  color: var(--text);
  white-space: pre;
}

/* 工具栏 */
.code-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.code-toolbar .code-search { flex: 1 1 190px; min-width: 150px; font-size: 13px; padding: 7px 12px; }
.code-toolbar .seg { width: auto; flex: 0 0 auto; }
.code-toolbar .seg-btn { white-space: nowrap; }
.code-toolbar .mini-btn { flex: 0 0 auto; }

/* 按规格折叠的分组 */
.code-groups { display: flex; flex-direction: column; gap: 8px; }
.code-empty { padding: 16px 0; font-size: 12.5px; color: var(--text-faint); text-align: center; letter-spacing: 1px; }
.code-group { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elev); overflow: hidden; }
.code-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; }
.cg-spec { font-family: var(--serif); font-size: 13.5px; color: var(--text); }
.cg-meta { font-size: 12px; color: var(--text-faint); }
.cg-meta b { font-weight: 600; color: var(--text-dim); }
.cg-meta b.ok { color: var(--ok); }
.cg-meta b.exp-warn { color: var(--danger); }
.cg-actions { margin-left: auto; display: flex; gap: 6px; }
.code-group-body { border-top: 1px solid var(--line-soft); background: var(--bg-panel); padding: 0 12px 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.code-subtable { min-width: 560px; }   /* 窄屏横向滚动，保证时间/有效期/操作列可达 */
.code-subtable th { padding-top: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.code-subtable td { padding: 8px 10px; }
.row-btn:disabled { opacity: 0.4; cursor: default; }
.row-btn:disabled:hover { color: var(--text-dim); border-color: var(--line); }
.exp-warn { color: var(--danger); }

/* 码徽章扩展：VIP 金色 / 普通灰色 / 面值 / 已过期 */
.code-badge.vip { color: #f0c674; border-color: rgba(240, 198, 116, 0.45); background: rgba(240, 198, 116, 0.08); }
.code-badge.normal { color: var(--text-dim); }
.code-badge.face { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.code-badge.expired { color: var(--danger); border-color: rgba(201, 106, 90, 0.45); }

/* ==========================================================================
   移动端适配（断点：≤768px，与 app.js 的 matchMedia('(max-width: 768px)') 对齐）
   · 下面三条是「新增移动端元素」的桌面默认态，只作用于本次新增的节点；
   · 其余全部规则都包在 @media (max-width: 768px) 内，
     因此桌面端（>768px）的渲染结果与本文件改动前完全一致。
   ========================================================================== */

/* 新增元素：桌面端不显示 / 不占位 */
#mobile-bar { display: none; }
#chat-back { display: none; }
#sb-backdrop { display: none; }

@media (max-width: 768px) {

  :root {
    /* 顶栏总高度（52px + 刘海安全区），页面内容据此留出上边距 */
    --mb-h: calc(52px + env(safe-area-inset-top, 0px));
    --safe-b: env(safe-area-inset-bottom, 0px);
  }

  /* 移动端用动态视口高度，避免地址栏遮挡底部输入框 */
  html, body { height: 100%; }
  #app { height: 100vh; height: 100dvh; max-width: 100vw; overflow: hidden; }
  #login { height: 100vh; height: 100dvh; }
  .page { max-width: 100vw; -webkit-overflow-scrolling: touch; }

  /* ---------------------------------------------------------------- 顶栏 */
  #mobile-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--mb-h);
    padding: env(safe-area-inset-top, 0px) 12px 0;
    background: rgba(30, 25, 19, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 40;
  }
  #sb-toggle {
    flex: none;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 17px;
    line-height: 1;
    padding: 0;
  }
  #sb-toggle:active { color: var(--accent); border-color: var(--accent-line); background: var(--bg-elev); }
  .mb-title {
    flex: 1;
    min-width: 0;
    font-family: var(--serif);
    font-size: 16.5px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mb-brand {
    flex: none;
    font-family: var(--serif);
    font-size: 13px;
    letter-spacing: 0.18em;
    color: var(--accent);
  }

  /* ------------------------------------------------------ 侧栏：抽屉模式 */
  #sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 55;
    width: 78vw;
    max-width: 300px;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 12px calc(14px + var(--safe-b));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: none;
    will-change: transform;
  }
  #sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 0 0 44px rgba(0, 0, 0, 0.62);
  }
  #sidebar .sb-brand { padding-bottom: 14px; }
  #sidebar .sb-item { min-height: 44px; font-size: 15px; }

  #sb-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 54;
    background: rgba(8, 6, 4, 0.62);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: mb-fade 0.2s ease;
  }
  @keyframes mb-fade { from { opacity: 0; } to { opacity: 1; } }

  /* ---------------------------------------------------------------- 控制台 */
  #page-console { padding-top: var(--mb-h); }
  .console-inner { padding: 18px 16px calc(40px + var(--safe-b)); max-width: 100%; }
  .console-hero h1 { font-size: 22px; line-height: 1.35; }
  .console-hero p { font-size: 13px; margin-bottom: 22px; }
  .entry-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
  }
  .entry-bubble { padding: 20px 10px 18px; border-radius: 12px; }
  .entry-icon { font-size: 26px; }
  .entry-title { font-size: 14px; }
  .act-title { padding: 12px 14px 8px; font-size: 14.5px; }
  .act-list { padding: 0 14px 8px; }
  .act-item { font-size: 13px; gap: 8px; }
  .act-time { width: 40px; font-size: 11px; }
  .activity-bubble { border-radius: 12px; }

  /* 通用页面：顶部让开顶栏 */
  .page-inner { max-width: 100%; padding: calc(var(--mb-h) + 14px) 16px calc(44px + var(--safe-b)); }
  .page-inner.wide { max-width: 100%; }
  .page-head { padding: 14px 16px 8px; flex-wrap: wrap; gap: 6px; }
  .page-head h2 { font-size: 18px; }
  .page-head-sub { flex-basis: 100%; }

  /* ------------------------------------------------------------------ 聊天 */
  #page-chat { padding-top: var(--mb-h); overflow: hidden; }
  #chat-list { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  #chat-list .page-head { padding: 14px 16px 8px; }
  .conv-item { padding: 12px 16px; gap: 11px; min-height: 56px; }
  .conv-name { font-size: 15px; }
  .conv-empty { padding: 54px 20px; }

  /* 契约：无 .show-pane → 全屏会话列表；有 .show-pane → 全屏会话面板 */
  #page-chat.show-pane #chat-list { display: none; }
  #page-chat:not(.show-pane) #chat-pane { display: none; }
  #page-chat.show-pane #chat-session {
    display: grid;              /* 面板显隐最终仍由 JS 的 .hidden 决定，CSS 只保证铺满 */
    grid-template-columns: 1fr;
    position: relative;
  }
  #chat-session { grid-template-columns: 1fr; position: relative; }
  #chat-session.memory-closed { grid-template-columns: 1fr; }
  #chat-pane { height: 100%; }

  #chat-head { padding: 9px 12px; }
  #chat-head-info { gap: 8px; }
  #back-btn { display: none; }               /* 移动端改用 #chat-back */
  #chat-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    font-size: 17px;
    line-height: 1;
  }
  #chat-head-actions { gap: 6px; }
  #chat-head-actions .ghost-btn { min-height: 40px; padding: 8px 12px; }
  #chat-avatar { width: 32px; height: 32px; }
  #chat-name { font-size: 15.5px; }
  #chat-sub { font-size: 11px; }

  #messages { padding: 14px 0 8px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .msg-row { padding: 0 14px; margin-bottom: 12px; gap: 8px; }
  .msg-row > div:not(.avatar) { max-width: 80%; }
  .msg-bubble { font-size: 14px; line-height: 1.7; padding: 9px 13px; }

  /* 输入区固定在面板底部（含底部安全区），不被刘海/手势力条遮挡 */
  #composer {
    flex: none;
    position: sticky;
    bottom: 0;
    z-index: 6;
    gap: 8px;
    padding: 8px 12px calc(8px + var(--safe-b));
    background: var(--bg);
    border-top: 1px solid var(--line-soft);
  }
  #composer textarea {
    padding: 10px 12px;
    min-height: 44px;
    max-height: 110px;
    font-size: 15px;
    border-radius: 12px;
  }
  #send-btn { flex: none; min-height: 44px; min-width: 68px; padding: 0 16px; }
  #jump-bottom { bottom: calc(80px + var(--safe-b)); padding: 9px 16px; min-height: 40px; }

  /* 记忆抽屉：移动端整屏铺满（不改结构，用绝对定位覆盖会话） */
  #memory-pane { border-left: none; }
  #chat-session:not(.memory-closed) #memory-pane {
    position: absolute;
    inset: 0;
    z-index: 8;
  }
  #chat-session.memory-closed #memory-pane { display: none; }
  .mp-head { padding: 12px 16px 10px; }
  .mp-section { padding: 12px 16px 6px; }
  #memory-body { padding-bottom: calc(24px + var(--safe-b)); }

  /* --------------------------------------------------------- 设置 / 账户 */
  .set-section { padding: 14px 14px; border-radius: 12px; margin-top: 14px; }
  .set-row {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 0;
  }
  .set-row > * { width: 100%; }
  .set-row .switch { align-self: flex-start; flex: none; width: 40px; }
  .set-label { font-size: 14.5px; }
  .set-desc { font-size: 12.5px; }
  .set-select, .set-input { width: 100%; min-width: 0; text-align: left; }
  /* 开关：视觉轨道保持 22px，触控区域抬到 40px 高 */
  .switch { width: 40px; height: 40px; }
  .switch .slider { inset: auto 0; top: 50%; transform: translateY(-50%); height: 22px; }
  .switch-row { font-size: 13.5px; }
  .grid2 { grid-template-columns: 1fr; }
  .avatar-row { grid-template-columns: 1fr; }
  .trigger-row { gap: 10px 14px; }
  .time-range { flex-wrap: wrap; }
  .time-range input { width: auto; }

  /* ------------------------------------------------------ 注册向导（窄屏） */
  .wiz-select { min-height: 44px; font-size: 15px; }
  .wiz-title { font-size: 16px; }
  .wiz-actions { margin-top: 6px; }
  .wiz-actions .ghost-btn, .wiz-actions .primary-btn { min-height: 44px; font-size: 15px; }
  .wiz-family-box input { min-height: 44px; font-size: 14px; }

  /* ------------------------------------------------------ 控制台/家庭监护 */
  .console-family-card { flex-direction: column; align-items: stretch; }
  .cfc-btn { width: 100%; min-height: 44px; }
  .family-tools { flex-direction: column; align-items: stretch; }
  .family-tools .primary-btn, .family-tools .mini-btn { width: 100%; min-height: 44px; }

  /* -------------------------------------------------------------- 管理表格 */
  .admin-stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
  .stat-card { padding: 14px 10px; border-radius: 12px; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 11.5px; }
  .admin-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .admin-table { min-width: 620px; font-size: 12.5px; }
  .admin-table th { padding: 8px; font-size: 11.5px; }
  .admin-table td { padding: 8px; }
  .row-actions { flex-wrap: wrap; }
  .code-toolbar { gap: 6px; }
  .code-toolbar .code-search { flex: 1 1 100%; min-width: 0; }
  .code-entry-row { grid-template-columns: 1fr; }
  .code-out { max-height: 160px; }
  .code-group-head { padding: 10px; }
  .cg-actions { margin-left: 0; flex-basis: 100%; }

  /* ------------------------------------------------------ 通用弹窗 / 向导 */
  #modal, #cc-modal, #wizard { align-items: flex-end; }
  #modal .modal-card, #cc-modal .modal-card, #wizard .wizard-card {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 14px 14px 0 0;
    margin: 0;
  }
  #modal .modal-head, .wizard-head { padding: 14px 16px 10px; font-size: 16px; }
  #modal-body { padding: 16px 16px calc(20px + var(--safe-b)); }
  .cc-card { width: 100%; }
  .cc-body { padding: 14px 16px calc(18px + var(--safe-b)); }
  .cc-item { min-height: 44px; font-size: 13.5px; }
  .wizard-tabs { padding: 0 16px; }
  .wtab { margin-right: 14px; font-size: 13.5px; }
  .wizard-body { padding: 16px 16px 20px; gap: 16px; }
  .wizard-foot { padding: 12px 16px calc(12px + var(--safe-b)); gap: 8px; }
  .modal-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .qr-box img { width: min(240px, 74vw); height: auto; aspect-ratio: 1 / 1; }
  .consent-btn { padding: 12px 22px; }

  /* ------------------------------------------------------------- 引导浮层 */
  #onboard {
    align-items: flex-start;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(22px + var(--safe-b));
  }
  .ob-pane { max-width: 100%; }
  .ob-lamp { font-size: 42px; }
  .ob-lamp-wrap { margin: 4px 0 8px; }
  .ob-brand { font-size: 30px; letter-spacing: 4px; }
  .ob-brand-sub { font-size: 10px; letter-spacing: 4px; }
  .ob-slogan { font-size: 13px; margin: 10px 0 16px; }
  .ob-copy { padding: 14px 16px; font-size: 13px; line-height: 1.9; border-radius: 12px; }
  .ob-title { font-size: 21px; }
  .ob-step-title { font-size: 20px; }
  .ob-step-text { font-size: 12.5px; line-height: 1.8; min-height: 40px; }
  .ob-desc { font-size: 12.5px; margin-bottom: 14px; }
  .ob-stage { margin: 2px 0 10px; }
  .ob-phone { width: 188px; height: 326px; padding: 10px 8px 14px; border-radius: 24px; }
  .ob-screen .ob-bub { font-size: 11px; padding: 6px 9px; }
  .ob-screen .ob-card { padding: 10px; }
  .ob-actions { margin-top: 16px; gap: 10px; }
  .ob-skip { padding: 10px 2px; }
  .ob-next { padding: 11px 22px; }
  .ob-progress { margin-top: 12px; }

  /* --------------------------------------------------------------- 登录页 */
  #login { padding: 16px 14px calc(16px + var(--safe-b)); }
  #login .login-card {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 24px 18px 22px;
    border-radius: 16px;
    gap: 10px;
  }
  .login-card h1 { font-size: 19px; }
  .login-tabs .ltab { padding: 9px 0; }
  .login-card input { padding: 12px 13px; font-size: 15px; }
  .login-card .primary-btn { min-height: 44px; }
  .reg-agree { font-size: 12.5px; align-items: flex-start; }
  .reg-agree input { margin-top: 2px; }

  /* ------------------------------------------------ 触控与横向溢出兜底 */
  #sb-toggle, .sb-item, .ghost-btn, .mini-btn, .primary-btn, .danger-btn, .row-btn,
  .icon-btn, .ltab, .seg-btn, .consent-btn, .audit-fbtn, .wtab, .act-more,
  .code-entry, .modal-tile, .cc-item, .emoji-opt, .ob-gender button, .ob-skip,
  .ob-next, .preset, .fact-del, .cc-btn { min-height: 40px; }

  img, video, canvas { max-width: 100%; }
  #toast { max-width: calc(100vw - 28px); bottom: calc(20px + var(--safe-b)); font-size: 13px; }
  .code-out, .terms-box, .mem-raw textarea, #mem-raw, .set-desc.mono { max-width: 100%; word-break: break-word; }
  .terms-wrap h2 { font-size: 18px; }
  .terms-wrap p { font-size: 12.5px; }
}


/* 矮窗口（笔记本/缩放屏）压缩登录卡，保证条例链接等底部元素可见可点 */
@media (max-height: 760px) {
  .login-card { padding: 22px 24px 20px; gap: 9px; }
  .login-card h1 { font-size: 21px; margin: 2px 0 4px; }
  .login-brand { padding-bottom: 8px; }
  .login-tabs { margin-bottom: 2px; }
  .login-note { font-size: 11.5px; }
}
@media (max-height: 640px) {
  .login-card { padding: 16px 20px 14px; gap: 7px; }
  .login-card h1 { font-size: 19px; }
  .login-card input { padding: 9px 12px; }
}

/* 法律文档链接（条例/隐私政策）不折行，保证可点区域完整、观感整洁 */
.reg-agree a, .login-note a, #page-settings .set-desc a { white-space: nowrap; cursor: pointer; }
.reg-agree a:hover, .login-note a:hover, #page-settings .set-desc a:hover { text-decoration: underline; }

/* 已作废码：灰红徽章 + 置灰行 */
.code-badge.revoked { background: rgba(196,92,92,0.14); color: #d99; border: 1px solid rgba(196,92,92,0.3); text-decoration: line-through; }

/* ===== 公开法律页面（无需登录，独立访问） ===== */
.legal-page { margin: 0; min-height: 100vh; background: var(--bg, #16120e); color: var(--text, #ece4d8); }
.legal-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: rgba(22,18,14,0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line, #2a241d);
}
.legal-brand { font-family: var(--serif, serif); font-size: 15px; color: var(--text); }
.legal-back {
  background: none; border: 1px solid var(--line, #2a241d); color: var(--text-dim, #a89c8b);
  padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.legal-back:hover { border-color: var(--accent-line, #e8a24e); color: var(--accent, #e8a24e); }
.legal-main { max-width: 780px; margin: 0 auto; padding: 28px 22px 80px; }

/* 登录页底部公开法律链接 */
.login-legal-footer {
  display: flex; justify-content: center; gap: 18px;
  margin-top: 14px; font-size: 12px;
}
.login-legal-footer a { color: var(--text-faint, #7d7262); text-decoration: none; cursor: pointer; }
.login-legal-footer a:hover { color: var(--accent, #e8a24e); text-decoration: underline; }

/* 登录卡快捷链接（忘记密码 / 没有账户） */
.login-quick-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: -2px;
  font-size: 12px;
}
.login-quick-links a { color: var(--text-faint); text-decoration: none; cursor: pointer; transition: color 0.15s; }
.login-quick-links a:hover { color: var(--accent); text-decoration: underline; }


/* 移动端：向导底部按钮吸附，第 6 步内容高时按钮始终可达 */
@media (max-width: 768px) {
  .wiz-actions { position: sticky; bottom: 0; background: var(--bg-panel); padding-top: 10px; z-index: 5; }
}

/* ==========================================================================
   长庚个人中心（center.html）+ 留灯侧两处入口（claude）
   ========================================================================== */

/* 个人中心页：覆盖全局 overflow:hidden，整页可滚；原生控件暗色适配 */
body.cg-page { overflow: auto; min-height: 100vh; color-scheme: dark; }

/* ---------- 未登录三视图：居中卡片 ---------- */
.cg-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 14px 48px;
  background:
    radial-gradient(ellipse at 50% -30%, rgba(232,162,78,0.09), transparent 60%),
    var(--bg);
}
.cg-card {
  width: min(430px, 100%);
  margin-top: auto;
  margin-bottom: auto;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: card-in 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.cg-brand { display: flex; align-items: baseline; gap: 8px; }
.cg-h1 { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.cg-card input { padding: 11px 13px; }
.cg-card .primary-btn { padding: 11px 0; width: 100%; }

.cg-screen { display: flex; flex-direction: column; gap: 12px; }

/* 登录/找回第二屏：返回按钮 + 当前账号 chip */
.cg-back-row { display: flex; align-items: center; gap: 10px; }
.cg-back {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.cg-back:hover { color: var(--accent); }
.cg-account-chip {
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 3px 12px;
  border-radius: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.cg-account-chip:empty { display: none; }

.cg-hint { font-size: 12px; color: var(--danger); min-height: 16px; line-height: 1.55; }
.cg-hint:empty { display: none; }

/* 验证码输入行：输入框 + 发码按钮 + 倒计时文字 */
.cg-code-row { display: flex; gap: 8px; align-items: center; }
.cg-code-row input { flex: 1; min-width: 0; }
.cg-code-btn { flex: 0 0 auto; white-space: nowrap; min-height: 40px; padding: 8px 14px; }
.cg-code-btn:disabled { opacity: 0.5; cursor: default; }
.cg-code-note { font-size: 12px; color: var(--text-faint); min-height: 16px; }
.cg-code-note:empty { display: none; }

/* 密码强度条：三档 弱红 / 中黄 / 强绿（类名由 kimi 按强度切换） */
.cg-pw-strength {
  height: 6px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  overflow: hidden;
}
.cg-pw-strength i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  transition: width 0.25s ease, background 0.25s ease;
}
.cg-pw-strength.weak i   { width: 33%;  background: var(--danger); }
.cg-pw-strength.mid i    { width: 66%;  background: var(--accent); }
.cg-pw-strength.strong i { width: 100%; background: var(--ok); }
.cg-pw-note { font-size: 12px; color: var(--text-faint); min-height: 15px; }
.cg-pw-note:empty { display: none; }

/* 注册表单：性别 / 生日 / 地区 字段行 */
.cg-field-row { display: flex; gap: 10px; }
.cg-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cg-field-label { font-size: 12px; color: var(--text-faint); }
.cg-field .seg { width: 100%; }

/* ---------- 已登录：左导航 + 右侧内容 ---------- */
.cg-shell { display: flex; height: 100vh; overflow: hidden; }
.cg-side {
  width: 200px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 12px 14px;
  min-height: 0;
}
.cg-side .sb-item { white-space: nowrap; }
.cg-main { flex: 1; min-width: 0; overflow-y: auto; }
.cg-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 32px;
  background: rgba(22, 18, 14, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.cg-topbar-title { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.cg-topbar-sub { font-size: 12px; color: var(--text-faint); margin-top: 1px; }
.cg-content { max-width: 760px; margin: 0 auto; padding: 22px 32px 64px; }
.cg-panel-h { font-family: var(--serif); font-size: 20px; font-weight: 700; }

/* 概览：大头卡 + 三张统计卡 */
.cg-overview-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-top: 18px;
}
.cg-hero-info { min-width: 0; }
.cg-hero-name { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.cg-hero-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.cg-hero-sub.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.cg-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}

/* 个人信息：头像预览 + emoji 选择 */
.cg-avatar-box { display: flex; align-items: center; gap: 12px; }
.cg-emoji-input { width: 90px; min-width: 0; text-align: center; }
.cg-emoji-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 0 4px; }

/* 登录卡「用长庚账号登录」快捷入口（留灯 index.html） */
.login-quick-links a.cg-quick { color: var(--accent); }
.login-quick-links a.cg-quick:hover { text-decoration: underline; }

/* 账户页「你的资料」个人中心入口（留灯 index.html） */
.cg-entry-link {
  flex-shrink: 0;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}
.cg-entry-link:hover { filter: brightness(1.15); }

/* ---------- 移动端 ≤768px：单列适配 ---------- */
@media (max-width: 768px) {
  /* 未登录卡片 */
  .cg-view { padding: 16px 12px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .cg-card { padding: 24px 18px 22px; border-radius: 16px; gap: 10px; }
  .cg-card input, .cg-card select { font-size: 15px; }
  .cg-card .primary-btn { min-height: 44px; }
  .cg-field-row { flex-direction: column; }
  .cg-code-btn { min-height: 44px; }

  /* 已登录：导航横排置顶，内容单列滚动 */
  .cg-shell { flex-direction: column; height: 100vh; height: 100dvh; }
  .cg-side {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .cg-side .sb-brand,
  .cg-side .sb-spacer,
  .cg-side .sb-userchip { display: none; }
  .cg-side .sb-nav { flex-direction: row; flex: none; }
  .cg-side .sb-item { padding: 8px 12px; }
  .cg-main { flex: 1; min-height: 0; }
  .cg-topbar { padding: 12px 16px; }
  .cg-topbar-title { font-size: 16px; }
  .cg-content { padding: 16px 14px calc(48px + env(safe-area-inset-bottom, 0px)); }
  .cg-overview-hero { padding: 18px 16px; }
  .cg-stat-grid { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
  .cg-stat-grid .stat-num { font-size: 20px; word-break: break-all; }
  .cg-avatar-box { justify-content: space-between; }
}



/* ===== 长庚绑定确认弹窗（Google/Meta 式） ===== */
.bind-dialog { display: flex; flex-direction: column; gap: 14px; }
.bind-lead { font-size: 13px; color: var(--text-dim); line-height: 1.7; }
.bind-accounts { display: flex; flex-direction: column; gap: 6px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.bind-acct { display: flex; align-items: center; gap: 10px; }
.bind-badge { flex: 0 0 auto; font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); }
.bind-badge.cg { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.bind-badge.ld { color: var(--text-dim); }
.bind-acct-main { min-width: 0; }
.bind-name { font-family: var(--serif); font-size: 14px; color: var(--text); }
.bind-sub { font-size: 11.5px; color: var(--text-faint); }
.bind-link { text-align: center; color: var(--text-faint); font-size: 14px; line-height: 1; }
.bind-benefits { display: flex; flex-direction: column; gap: 6px; }
.bind-benefit { font-size: 12.5px; color: var(--text-dim); }
.bind-benefit b { color: var(--ok); margin-right: 6px; }
.bind-note { font-size: 11.5px; color: var(--text-faint); line-height: 1.6; }
.bind-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 2px; }
.bind-actions .primary-btn { min-width: 110px; }


/* ===== 长庚 · 授权确认页（OAuth 式） ===== */
.cg-card-authz { max-width: 420px; }
.cg-authz-app { display: flex; align-items: center; gap: 12px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.cg-authz-icon { font-size: 26px; }
.cg-authz-name { font-family: var(--serif); font-size: 15px; color: var(--text); }
.cg-authz-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.cg-authz-scopes { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.cg-authz-scope { font-size: 12.5px; color: var(--text-dim); display: flex; gap: 8px; align-items: flex-start; }
.cg-authz-scope b { flex: 0 0 auto; }
.cg-authz-scope.yes b { color: var(--ok); }
.cg-authz-scope.no { color: var(--text-faint); }
.cg-authz-scope.no b { color: var(--text-faint); }
.cg-authz-account { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-soft); padding-top: 12px; font-size: 12.5px; color: var(--text-faint); }
.cg-authz-account b { color: var(--text); font-weight: 500; }
.cg-authz-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.cg-authz-actions .primary-btn { min-width: 120px; }
.cg-authz-foot { font-size: 11.5px; color: var(--text-faint); text-align: center; margin-top: 12px; }


/* ===== 长庚账号管理：临时密码展示 ===== */
.cg-temp-pw { margin: 12px 0 6px; padding: 14px; border-radius: 12px; background: var(--bg-elev); border: 1px dashed var(--accent-line); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: 2px; color: var(--accent); text-align: center; user-select: all; }


/* ===== 长庚 · 找回密码（Google/Meta 式） ===== */
.cg-who { display: flex; align-items: center; gap: 12px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.cg-who-avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 17px; }
.cg-who-main { min-width: 0; }
.cg-who-q { font-size: 11.5px; color: var(--text-faint); }
.cg-who-name { font-family: var(--serif); font-size: 15px; color: var(--text); margin-top: 2px; }
.cg-who-mail { font-size: 12px; color: var(--text-dim); margin-top: 2px; word-break: break-all; }
.cg-done { text-align: center; padding: 10px 0 18px; }
.cg-done-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; background: rgba(120,180,120,.14); color: var(--ok); font-size: 26px; display: flex; align-items: center; justify-content: center; }
.cg-done-title { font-family: var(--serif); font-size: 18px; color: var(--text); margin-bottom: 8px; }
.cg-done-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; }


/* ===== 长庚管理：重置密码选项 ===== */
.cg-reset-opt { display: flex; align-items: center; gap: 12px; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.cg-reset-opt-main { min-width: 0; }
.cg-reset-opt-title { font-size: 13.5px; color: var(--text); margin-bottom: 4px; }
.cg-reset-opt-desc { font-size: 11.5px; color: var(--text-faint); line-height: 1.6; }
.cg-reset-badge { font-size: 10.5px; color: var(--accent); border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.cg-reset-opt .primary-btn, .cg-reset-opt .mini-btn { flex: 0 0 auto; white-space: nowrap; }


/* ===== 尝试其他方式（备用验证） ===== */
.cg-alt-opt { display: flex; align-items: center; gap: 12px; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.cg-alt-opt-main { min-width: 0; }
.cg-alt-opt-title { font-size: 13.5px; color: var(--text); margin-bottom: 4px; }
.cg-alt-opt-desc { font-size: 11.5px; color: var(--text-faint); line-height: 1.6; }
.cg-alt-opt .mini-btn { flex: 0 0 auto; white-space: nowrap; }


/* ===== 长庚个人中心：Google 式首页与子页 ===== */
.cg-me-card { display: flex; align-items: center; gap: 14px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; margin-bottom: 16px; }
.cg-me-avatar { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 20px; }
.cg-me-name { font-family: var(--serif); font-size: 17px; color: var(--text); }
.cg-me-mail { font-size: 12.5px; color: var(--text-faint); margin-top: 3px; word-break: break-all; }
.cg-row-list { display: flex; flex-direction: column; gap: 8px; }
.cg-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; cursor: pointer; transition: border-color .15s, background .15s; }
.cg-row:hover { border-color: var(--accent-line); background: var(--bg-card-hover, var(--bg-elev)); }
.cg-row-ico { flex: 0 0 auto; font-size: 18px; width: 24px; text-align: center; }
.cg-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cg-row-t { font-size: 14px; color: var(--text); }
.cg-row-d { font-size: 11.5px; color: var(--text-faint); }
.cg-row-arrow { color: var(--text-faint); font-size: 18px; }
.cg-sub-head { margin-bottom: 6px; }
.cg-2fa-qr { display: flex; justify-content: center; padding: 10px 0 4px; }
.cg-2fa-qr img { width: 200px; height: 200px; border-radius: 12px; background: #fff; padding: 8px; }
.cg-secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: 2px; background: var(--bg-elev); border: 1px dashed var(--accent-line); border-radius: 10px; padding: 10px 12px; text-align: center; color: var(--accent); user-select: all; word-break: break-all; }
.cg-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.cg-code-item { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; color: var(--text); user-select: all; }
.cg-dev-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; margin-bottom: 8px; }
.cg-dev-main { flex: 1; min-width: 0; }
.cg-dev-t { font-size: 13px; color: var(--text); }
.cg-dev-d { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; word-break: break-all; }
.cg-dev-now { font-size: 11px; color: var(--ok); border: 1px solid var(--ok); border-radius: 999px; padding: 1px 7px; }


/* ===== 进页面人机验证门禁 ===== */
html.ld-gate-on body { overflow: hidden; }
#ld-gate { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; background: rgba(18,14,11,.92); backdrop-filter: blur(6px); transition: opacity .25s; }
#ld-gate.ld-gate-out { opacity: 0; }
.ld-gate-card { width: min(92vw, 400px); background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px; padding: 26px 24px; text-align: center; }
.ld-gate-brand { font-size: 12px; letter-spacing: 2px; color: var(--text-faint); margin-bottom: 12px; }
.ld-gate-title { font-family: var(--serif); font-size: 18px; color: var(--text); margin-bottom: 8px; }
.ld-gate-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; margin-bottom: 16px; }
.ld-gate-widget { display: flex; justify-content: center; min-height: 65px; }
.ld-gate-err { font-size: 12px; color: var(--danger); margin-top: 10px; min-height: 16px; line-height: 1.6; }
