/* ==========================================================================
   游漫统一身份认证系统 · 样式表
   移动优先：先写手机版，再用 min-width 逐级增强到平板与桌面
   ========================================================================== */

:root {
  /* ---------- 底色与层次 ---------- */
  --bg:           #ffffff;                       /* 页面底色 */
  --surface:      rgba(255, 255, 255, .78);      /* 玻璃卡片 */
  --surface-solid:#ffffff;
  --line:         rgba(43, 123, 228, .16);
  --line-soft:    rgba(43, 123, 228, .09);

  /* ---------- 文字 ---------- */
  --text:      #17395b;      /* 正文：深蓝灰，长时间阅读不刺眼 */
  --text-2:    #4a6b8c;
  --text-3:    #7f97b0;
  --text-deep: #1f588f;      /* 文字深蓝 */

  /* ---------- 主色 ---------- */
  --accent:      #2b7be4;
  --accent-d:    #1b62c6;
  --accent-l:    #e9f2fe;
  --accent-soft: rgba(43, 123, 228, .10);

  /* ---------- 标题渐变 ---------- */
  --title-a:    #0a3c62;
  --title-b:    #2b7be4;
  --subtitle-a: #125a8f;
  --subtitle-b: #2b7be4;

  /* ---------- 语义色 ---------- */
  --danger:    #cf3f36;
  --danger-l:  #fdf0ee;
  --ok:        #1a7a48;
  --ok-l:      #ebf7f0;
  --warn:      #94610a;
  --warn-l:    #fdf6e6;

  --radius:    12px;
  --radius-lg: 18px;
  --shadow:    0 10px 30px -16px rgba(31, 88, 143, .24);
  --shadow-lg: 0 14px 40px -16px rgba(31, 88, 143, .28);
  --glass:     0 1px 0 rgba(255, 255, 255, .9) inset, 0 10px 30px -14px rgba(31, 88, 143, .22);

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --topbar-h: 56px;
  --tabbar-h: 58px;
}

* { box-sizing: border-box; }

/* hidden 属性要压得住作者样式里的 display（例如 .brand-mark 的 grid），
   否则 JS/模板用 hidden 隐藏元素时会失效 */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* 与 .bg-tint 渐变起点同色：样式表还没到时也不会先闪一下白 */
  background: #ecf3ff;
  /* iOS 顶部/底部橡皮筋回弹时露出网页底色，而不是系统白 */
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  background: transparent;   /* 底色交给 .bg-tint，让光晕透上来 */
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   背景层：垂直渐变 + 左上蓝晕 + 底部柔光，外加三枚漂浮光球
   ========================================================================== */
.bg-tint {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background-color: #ffffff;
  background-image:
    /* 底部柔光 */
    linear-gradient(0deg, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, 0) 34%),
    /* 左上蓝晕 */
    radial-gradient(120% 70% at 4% -10%, rgba(150, 199, 255, .30) 0%, rgba(150, 199, 255, 0) 62%),
    /* 垂直渐变 */
    linear-gradient(180deg, #ecf3ff 0%, #f6faff 48%, #eff5ff 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.orb-a {
  width: 340px;
  height: 340px;
  right: -110px;
  top: 6%;
  background: radial-gradient(circle, rgba(43, 123, 228, .13) 0%, rgba(43, 123, 228, 0) 68%);
}

.orb-b {
  width: 280px;
  height: 280px;
  left: -120px;
  top: 32%;
  background: radial-gradient(circle, rgba(255, 255, 255, .60) 0%, rgba(255, 255, 255, 0) 70%);
}

.orb-c {
  width: 420px;
  height: 420px;
  right: 8%;
  bottom: -190px;
  background: radial-gradient(circle, rgba(122, 175, 255, .15) 0%, rgba(122, 175, 255, 0) 70%);
}

body.has-tabbar {
  /* 悬浮底栏本身有 10px 底部间距和阴影，内容要让得更多一点 */
  padding-bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom, 0px));
}

a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }

/* ---------- 通用工具 ---------- */
.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}
.muted  { color: var(--text-2); }
.small  { font-size: 13px; }
.tiny   { font-size: 12px; }
.mono   { font-family: var(--mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.ta-right { text-align: right; }
.strong-link { color: var(--accent); font-weight: 500; }
.link-sm { font-size: 13px; }
.text-warn { color: var(--warn); }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; border: 0; }
.stack > * + * { margin-top: 14px; }
.num { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   顶栏
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line-soft);
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 600;
  font-size: 15.5px;
  min-width: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4a95ec, #2b7be4);
  color: #fff;
  font-size: 14px;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px -2px rgba(43, 123, 228, .45), 0 1px 0 rgba(255, 255, 255, .35) inset;
}

.brand-logo {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  object-fit: contain;
  /* 外链图片加载失败时不会撑出一块空白 */
  background: transparent;
}

.brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 46vw;
}

.nav { display: none; margin-left: auto; align-items: center; gap: 4px; }

.nav-link {
  padding: 7px 11px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14px;
  white-space: nowrap;
}
.nav-link.active { color: var(--accent); background: var(--accent-l); font-weight: 500; }
.nav-exit { color: var(--text-3); }

.topbar-action {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-avatar {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
}
.topbar-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* 等级标：盖在头像下缘（绝对定位叠加，不再另起一行占位） */
.topbar-level {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  z-index: 3;
  min-width: 27px;
  height: 15px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, .92);
  background: linear-gradient(135deg, rgba(52, 138, 240, .96), rgba(28, 82, 143, .96));
  -webkit-backdrop-filter: blur(6px) saturate(150%);
  backdrop-filter: blur(6px) saturate(150%);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1;
  display: grid;
  place-items: center;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px -2px rgba(20, 60, 110, .75);
}

/* 登录/注册页：顶栏只留品牌，减少干扰 */
body.is-auth .topbar-action { display: none; }

/* ---------- 后台二级导航 ---------- */
.subnav-wrap {
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  z-index: 20;
}

.subnav {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  gap: 6px;
  padding: 9px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }

.subnav-link {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text-2);
  background: rgba(43, 123, 228, .07);
  white-space: nowrap;
}
.subnav-link.active { background: var(--accent); color: #fff; font-weight: 500; }

/* ==========================================================================
   页面骨架
   ========================================================================== */
.page {
  flex: 1 0 auto;
  padding: 16px 0 28px;
}

.foot {
  flex: none;
  border-top: 1px solid var(--line-soft);
  padding: 16px 0 18px;
  color: var(--text-3);
  font-size: 12.5px;
  background: transparent;
}
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.foot-links { display: inline-flex; gap: 14px; }
.foot a { color: var(--text-3); }

/* ---------- 底部标签栏（仅手机） ---------- */
.tabbar {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  gap: 3px;
  padding: 6px;
  /* 最大圆角：高度的一半以上，浏览器会压成完整胶囊 */
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 16px 38px -14px rgba(21, 62, 110, .38),
    0 2px 8px -4px rgba(21, 62, 110, .18);
  /* 提升为合成层，滚动时不会因为重绘而闪 */
  transform: translateZ(0);
  /* 长按切换时不要弹出系统的文字选择/复制菜单 */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  /* 长按滑动切换：touch-action 交给 JS 按手势阶段动态控制。
     底栏是 fixed 悬浮条，本身不需要滚动页面；默认 none 可保证
     pointermove / touchmove 不被浏览器的滚动手势抢走（移动端关键）。 */
  touch-action: none;
}

.tab {
  flex: 1;
  height: 48px;
  /* 与底栏同步的最大圆角 */
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: .01em;
  transition: color .16s ease, background-color .16s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  /* 由 manipulation 改为 none：长按激活后手指横向滑动不会被浏览器
     判定为页面滚动而取消 pointer，移动端「长按滑动切换」才真正可用 */
  touch-action: none;
  position: relative;
  overflow: hidden;
}
.tab svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab.active { color: var(--accent-d); }
.tab.active svg { stroke-width: 1.9; }
/* 高亮统一交给唯一的 .tabbar-indicator；tab 自身不再铺背景，
   否则长按跟随时会「多出来一个块」，与指示块重影。 */
.tab:active { background: transparent; }
.tab:active svg { transform: scale(.9); }
/* 手指经过某项时只提亮文字，不产生第二个背景块 */
.tab.is-near { color: var(--accent-d); }
.tab svg { transition: transform .18s cubic-bezier(.22, 1, .36, 1); }

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .82);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  /* 只过渡颜色与阴影，不给 transform 加过渡，避免按下时出现"缩放闪动" */
  transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, color .14s ease;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 主按钮：渐变底色，hover/active 也保持渐变，
   不做「渐变 → 纯色」的突变，这是点击时"闪一下"的主因 */
.btn-primary {
  background-color: #2b7be4;
  background-image: linear-gradient(180deg, #3d88ea 0%, #2b7be4 100%);
  color: #fff;
  border-color: #2b7be4;
  box-shadow: 0 8px 20px -10px rgba(43, 123, 228, .8), 0 1px 0 rgba(255, 255, 255, .28) inset;
}
.btn-primary:active {
  background-image: linear-gradient(180deg, #2f78d6 0%, #2367c4 100%);
  box-shadow: 0 3px 10px -8px rgba(43, 123, 228, .9), 0 1px 0 rgba(255, 255, 255, .18) inset;
}

.btn-ghost { background: rgba(255, 255, 255, .72); color: var(--text-deep); border-color: var(--line); }
.btn-ghost:active { background: rgba(43, 123, 228, .08); }

.btn-danger {
  background-color: var(--danger);
  background-image: linear-gradient(180deg, #d94b41 0%, #cf3f36 100%);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:active { background-image: linear-gradient(180deg, #c03830 0%, #ad322a 100%); }

.btn-danger-ghost { background: rgba(255, 255, 255, .72); color: var(--danger); border-color: rgba(207, 63, 54, .28); }
.btn-danger-ghost:active { background: rgba(207, 63, 54, .10); }

/* 悬停效果只在真正有指针的设备上生效。
   手机上点击会先触发 hover 再触发 active，粘滞的 hover 正是"点一下闪一下"的来源。 */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background-image: linear-gradient(180deg, #4a92ee 0%, #2f83ea 100%);
    border-color: #2f83ea;
    color: #fff;
  }
  .btn-ghost:hover { background: #fff; color: var(--accent-d); border-color: var(--accent); }
  .btn-danger:hover { background-image: linear-gradient(180deg, #e0564b 0%, #d6483e 100%); color: #fff; }
  .btn-danger-ghost:hover { background: var(--danger-l); color: var(--danger); }
}

.btn-sm { min-height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 9px; }
.btn-lg { min-height: 50px; font-size: 16px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   提示条
   ========================================================================== */
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.65;
  border: 1px solid transparent;
  word-break: break-word;
}
.alert + .alert { margin-top: 10px; }
.alert-flash { margin-bottom: 14px; }
.alert-danger  { background: rgba(253, 240, 238, .92); border-color: rgba(207, 63, 54, .22); color: #a32c23; }
.alert-success { background: rgba(235, 247, 240, .92); border-color: rgba(26, 122, 72, .22);  color: #166b3f; }
.alert-warn    { background: rgba(253, 246, 230, .94); border-color: rgba(148, 97, 10, .24);  color: #7d5208; }
.alert-info    { background: rgba(238, 244, 254, .92); border-color: rgba(43, 123, 228, .20); color: var(--text-deep); }
.alert-list { margin: 0; padding-left: 18px; }
.alert-list li + li { margin-top: 4px; }

/* ==========================================================================
   徽标
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-ok    { background: var(--ok-l);     color: var(--ok); }
.badge-warn  { background: var(--warn-l);   color: var(--warn); }
.badge-bad   { background: var(--danger-l); color: var(--danger); }
.badge-info  { background: var(--accent-l); color: var(--accent-d); }
.badge-soft  { background: rgba(43, 123, 228, .08); color: var(--text-deep); }
.badge-mono  { background: rgba(43, 123, 228, .07); color: var(--text-2); font-family: var(--mono); }
.badge-lg    { font-size: 13px; padding: 4px 10px; }

/* ==========================================================================
   卡片
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}
.card + .card, .card + .stack, .stack + .card { margin-top: 14px; }
.card-flush { padding: 0; overflow: hidden; }
.card-danger { border-color: rgba(207, 63, 54, .3); }

.card-title {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card-head .card-title { margin-bottom: 0; }
.card-head-pad { padding: 14px 16px; margin-bottom: 0; border-bottom: 1px solid var(--line-soft); }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.page-title { font-size: 21px; line-height: 1.35; }
.page-head .muted { margin: 3px 0 0; font-size: 13.5px; }
.eyebrow {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 4px;
}


/* ---------- 渐变文字：标题与小节标题 ---------- */
/* 先给不支持 background-clip: text 的浏览器一个实色兜底 */
.grad-title { color: var(--title-a); }
.card-title { color: var(--text-deep); }
.page-title { color: var(--title-a); }

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .grad-title {
    background: linear-gradient(104deg, var(--title-a) 0%, var(--title-b) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }

  .card-title {
    background: linear-gradient(96deg, var(--subtitle-a) 0%, var(--subtitle-b) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }

  .page-title {
    background: linear-gradient(104deg, var(--title-a) 0%, var(--title-b) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

/* ==========================================================================
   表单
   ========================================================================== */
.field { display: block; margin-bottom: 15px; }
.field > span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 7px;
}
.field-hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--text-3); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="time"],
input[type="month"],
input[type="week"],
input[type="datetime-local"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 16px;          /* 低于 16px 时 iOS 会自动放大页面 */
  color: var(--text);
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
/* url / 日期类输入框在各浏览器里的原生装饰一并去掉，避免"半个原生样式" */
input[type="url"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
input[type="time"], input[type="month"], input[type="week"], input[type="date"], input[type="datetime-local"] { color-scheme: light; }
textarea { min-height: 96px; resize: vertical; line-height: 1.6; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(43, 123, 228, .14);
}
input::placeholder, textarea::placeholder { color: #9db2c9; }
input:disabled { background: rgba(43, 123, 228, .05); color: var(--text-3); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237f97b0' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
  cursor: pointer;
  padding: 4px 0;
}
.checkbox input[type="checkbox"] {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

/* 验证码这一行：输入框 + 图片 */
.captcha {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 15px;
}
.captcha-input { flex: 1 1 auto; min-width: 0; }
.captcha-input > span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 7px;
}
.captcha-img {
  flex: 0 0 auto;
  position: relative;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
  -webkit-appearance: none;
  appearance: none;
}
.captcha-img img { display: block; width: 120px; height: 44px; }
.captcha-tip {
  position: absolute;
  inset: auto 0 0 0;
  font-size: 9.5px;
  line-height: 1.3;
  color: #fff;
  background: rgba(20, 23, 29, .38);
  text-align: center;
  padding: 0;
  letter-spacing: .08em;
}

/* 蜜罐字段：正常用户看不到 */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* 「输入 + 按钮」组合 */
.code-row { display: flex; gap: 10px; align-items: stretch; }
.code-row input { flex: 1 1 auto; min-width: 0; }
.code-row .btn {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 14px;
  font-size: 13.5px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
}
.code-row .btn.is-wait { color: var(--text-3); background: #f6f7fa; }

.field-pass { position: relative; }
.field-pass input { padding-right: 58px; }
.pass-toggle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
}

.form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   登录 / 注册
   ========================================================================== */
.auth-wrap {
  max-width: 430px;
  margin: 0 auto;
  padding: 4px 0 20px;
}

.auth-card {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 20px;
  padding: 24px 18px 22px;
  box-shadow: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.auth-head { text-align: center; margin-bottom: 20px; }
.auth-title {
  font-size: 22px;
  margin-bottom: 6px;
  background: linear-gradient(104deg, var(--title-a), var(--title-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.auth-sub { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }

.auth-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  font-size: 13.5px;
  color: var(--text-2);
}

.auth-card-narrow { text-align: center; }
.auth-card-narrow .icon-badge { margin: 0 auto 14px; }
.auth-card-narrow .auth-sub { white-space: pre-line; }
.auth-card-narrow .btn-row { justify-content: center; margin-top: 18px; }

.auth-tip {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .7);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.65;
}

/* 分段切换（密码登录 / 验证码登录） */
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(43, 123, 228, .08);
  border-radius: 12px;
  margin-bottom: 18px;
}
.seg {
  flex: 1;
  text-align: center;
  padding: 9px 6px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
}
.seg.on { background: #fff; color: var(--accent-d); box-shadow: 0 2px 8px -2px rgba(31, 88, 143, .18); }

/* 步骤提示 */
.steps-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-3);
}
.step-done { color: var(--ok); font-weight: 500; }
.step-hint { color: var(--accent); font-weight: 500; }

/* ==========================================================================
   首页
   ========================================================================== */
.hero {
  position: relative;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(122, 175, 255, .22) 0%, rgba(122, 175, 255, 0) 62%),
    linear-gradient(158deg, rgba(255, 255, 255, .92) 0%, rgba(243, 249, 255, .88) 58%, rgba(238, 245, 255, .9) 100%);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 22px;
  padding: 26px 20px 24px;
  margin-bottom: 14px;
  box-shadow: var(--glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  overflow: hidden;
}
.hero-title {
  font-size: 25px;
  line-height: 1.35;
  letter-spacing: -.02em;
  margin-bottom: 10px;
}
.hero-lead {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.75;
  margin: 0 0 18px;
  max-width: 34em;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions .btn { flex: 0 0 auto; }

@media (max-width: 599px) {
  .hero-actions .btn { flex: 1 1 auto; min-width: 128px; }
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(43, 123, 228, .18);
  font-size: 12.5px;
  color: var(--text-2);
}
.hero-points span { display: inline-flex; align-items: center; gap: 5px; }
.hero-points span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}
.feature {
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: var(--radius);
  padding: 15px 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
}
.feature-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-l);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 15px;
  margin-bottom: 9px;
}
.feature-icon svg,
.quick-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature h3 { font-size: 14.5px; margin-bottom: 4px; }
.feature p { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.65; }

.steps-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.steps-row li { display: flex; gap: 11px; align-items: flex-start; }
.step-num {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  background: var(--accent-l);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
}
.steps-row strong { display: block; font-size: 14px; font-weight: 600; }
.steps-row small { display: block; color: var(--text-2); font-size: 12.5px; line-height: 1.6; }

/* 已登录：欢迎卡 */
.welcome {
  background: linear-gradient(150deg, #1f588f 0%, #2b7be4 52%, #4f94ee 100%);
  color: #fff;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.welcome::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.welcome-inner { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.welcome-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .65);
  overflow: hidden;
  flex: 0 0 56px;
  background: rgba(255, 255, 255, .2);
}
.welcome-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.welcome-name { font-size: 18px; font-weight: 600; color: #fff; }
.welcome-meta { font-size: 12.5px; color: rgba(255, 255, 255, .82); margin-top: 3px; }
.welcome-title { font-size: 13px; color: rgba(255, 255, 255, .78); margin: 0 0 2px; }

.welcome-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .22);
  position: relative;
  z-index: 1;
}
.welcome-stats div { text-align: center; }
.welcome-stats strong { display: block; font-size: 16px; font-weight: 600; }
.welcome-stats span { font-size: 11.5px; color: rgba(255, 255, 255, .78); }

/* 快捷入口 */
.quick-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.quick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
}
.quick-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: #f2f5fb;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 14px;
}

/* ==========================================================================
   个人中心
   ========================================================================== */
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.avatar-lg {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .9);
  background: rgba(43, 123, 228, .07);
  box-shadow: 0 6px 16px -8px rgba(31, 88, 143, .3);
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-name { font-size: 18px; font-weight: 600; line-height: 1.3; }
.profile-id { font-size: 12.5px; color: var(--text-3); margin-top: 3px; font-family: var(--mono); }

.avatar-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px dashed #c8d3e8;
  border-radius: 10px;
  background: #fbfcff;
  color: var(--accent);
  font-size: 13.5px;
  cursor: pointer;
}
.file-btn input { display: none; }

/* 键值列表 */
.kv {
  margin: 0;
  display: grid;
  grid-template-columns: 88px 1fr;
  column-gap: 12px;
}
.kv dt {
  font-size: 13px;
  color: var(--text-3);
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.kv dd {
  margin: 0;
  padding: 9px 0;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px solid var(--line-soft);
  word-break: break-word;
  min-width: 0;
}
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }

.record-list { list-style: none; margin: 0; padding: 0; }
.record-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.record-list li:last-child { border-bottom: 0; }
.record-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 7px;
  flex: 0 0 7px;
  background: var(--ok);
}
.record-dot.bad { background: var(--danger); }
.record-main { min-width: 0; flex: 1; }
.record-main strong { font-weight: 500; font-family: var(--mono); font-size: 12.5px; }
.record-main small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }

.device-list { list-style: none; margin: 0; padding: 0; }
.device-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.device-list li:last-child { border-bottom: 0; }
.device-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-top: 7px;
  flex: 0 0 8px;
}

/* ==========================================================================
   表格（管理后台）
   ========================================================================== */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-3);
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fbfcfe;
}
.table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table th.ta-right, .table td.ta-right { text-align: right; }
.table-compact td { padding: 9px 8px; }

@media (max-width: 719px) {
  /* 只有放在滚动容器里的表格才强制最小宽度，避免撑破页面 */
  .table-scroll > .table,
  .table-scroll .table { min-width: 620px; }
}

.user-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.user-cell img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: 0 0 30px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.user-cell-text { min-width: 0; }
.user-cell-text strong { display: block; font-weight: 500; font-size: 13.5px; }
.user-cell-text small { display: block; color: var(--text-3); font-size: 12px; }

/* ==========================================================================
   管理后台组件
   ========================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
}
.stat-label { display: block; font-size: 12px; color: var(--text-3); }
.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.stat-value-sm { font-size: 17px; }
.stat-card .stat-foot { display: block; }
.stat-foot { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  margin-top: 8px;
  padding-top: 4px;
  background-image: repeating-linear-gradient(
    to top, transparent 0, transparent 29px, #eef1f6 29px, #eef1f6 30px
  );
}
.chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.chart-bar {
  width: 100%;
  background: #c9dafb;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: background .15s;
}
.chart-bar.is-zero { background: #e9eef6; }
.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
}

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: flex;
  gap: 11px;
  padding-bottom: 14px;
  position: relative;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.tl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 8px;
  margin-top: 6px;
  z-index: 1;
}
.timeline-compact li { padding-bottom: 10px; }
.tl-body { min-width: 0; flex: 1; }
.tl-title { font-size: 13px; line-height: 1.55; word-break: break-word; }
.tl-meta { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

.code-block {
  background: rgba(43, 123, 228, .05);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  word-break: break-all;
  color: var(--text-2);
}
.code-block code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
  white-space: normal;
  margin: 3px 0;
}
.code-label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.filter-bar input[type="search"],
.filter-bar select { min-height: 40px; font-size: 14px; padding: 8px 12px; }
.filter-search { flex: 1 1 180px; min-width: 0; }

@media (max-width: 599px) {
  .filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .filter-bar .filter-search,
  .filter-bar .btn { grid-column: 1 / -1; }
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.pager-info { font-size: 12.5px; color: var(--text-3); }

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-3);
  font-size: 13.5px;
}
.empty-state strong { display: block; color: var(--text-2); font-size: 14.5px; margin-bottom: 4px; }

.hint-box {
  background: #f7f9fd;
  border: 1px solid #e3eaf7;
  border-radius: 10px;
  padding: 12px 13px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.7;
}
.smtp-box { display: grid; gap: 12px; }
.test-mail-form { display: flex; gap: 10px; align-items: flex-end; }
.test-mail-form .field { flex: 1; margin-bottom: 0; }

.icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--accent-l);
  color: var(--accent);
}
.icon-ok { background: var(--ok-l); color: var(--ok); }
.icon-warn { background: var(--warn-l); color: var(--warn); }

.crumb { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.crumb a { color: var(--text-3); }

/* 后台操作列表 */
.action-list { display: grid; gap: 2px; }
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  margin: 0;
}
.action-row:last-child { border-bottom: 0; }
.action-row > div { min-width: 0; }
.action-row strong { display: block; font-size: 13.5px; font-weight: 500; }
.action-row small { display: block; color: var(--text-3); font-size: 12px; margin-top: 1px; }
.inline-form { display: inline; margin: 0; }

/* 错误页 */
.error-code {
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: #d9e0ee;
  line-height: 1;
  margin-bottom: 6px;
}

/* ==========================================================================
   安装向导
   ========================================================================== */
.install-wrap { max-width: 720px; margin: 0 auto; padding: 20px 0 40px; }
.install-head { margin-bottom: 18px; }
.install-body { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 18px; }
.install-foot { margin-top: 16px; font-size: 12.5px; color: var(--text-3); }
.checklist { list-style: none; margin: 0 0 16px; padding: 0; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.checklist li:last-child { border-bottom: 0; }
.tick { color: var(--ok); flex: 0 0 auto; font-weight: 600; }
.warn { color: var(--warn); }
.inline-details { font-size: 12.5px; color: var(--text-3); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.grid-two, .grid-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }

/* 网格/弹性子项默认 min-width:auto，会被宽表格撑破，统一压回 0 */
.grid-two > *, .grid-cards > *, .stack > * { min-width: 0; }

/* ==========================================================================
   平板 / 桌面增强
   ========================================================================== */
@media (min-width: 600px) {
  .container, .topbar-inner, .subnav { padding-left: 24px; padding-right: 24px; }
  .card { padding: 20px; }
  .auth-card { padding: 30px 28px 26px; }
  .feature-row { grid-template-columns: repeat(3, 1fr); }
  .steps-row { grid-template-columns: repeat(3, 1fr); }
  .quick-list { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-two { grid-template-columns: 1.35fr 1fr; align-items: start; }
  .profile-head { padding: 22px; }
  .hero { padding: 36px 34px 30px; }
  .hero-title { font-size: 30px; }
  .page { padding-top: 22px; }
}

@media (min-width: 880px) {
  .nav { display: flex; }
  .topbar-action { margin-left: 0; }
  .tabbar { display: none; }
  body.has-tabbar { padding-bottom: 0; }
  /* 认证页去容器后顶栏只留品牌，右上角按钮与页内链接重复 */
  body.is-auth .topbar-action { display: none; }
  .welcome { padding: 26px 28px; }
  .welcome-avatar { width: 64px; height: 64px; flex-basis: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   统一身份认证：应用列表、授权页、密钥展示
   ========================================================================== */
.hero-foot {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.65;
}

.note-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--text-3);
}
.note-row span { display: inline-flex; align-items: center; gap: 5px; }
.note-row span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .45;
}

/* ---------- 应用条目 ---------- */
.app-list { list-style: none; margin: 0; padding: 0; }

.app-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}
.app-item:first-child { border-top: 0; padding-top: 2px; }
.app-item:last-child { padding-bottom: 2px; }
.app-item-action form { flex: 0 0 auto; margin: 0; }

.app-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: linear-gradient(140deg, #4a95ec 0%, #2b7be4 100%);
  box-shadow: 0 8px 16px -10px rgba(43, 123, 228, .9), 0 1px 0 rgba(255, 255, 255, .3) inset;
  overflow: hidden;
}
.app-icon-sm {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 9px;
  font-size: 14px;
}

.app-main { flex: 1; min-width: 0; }
.app-main strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-main small {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 授权确认页 ---------- */
.grant-card { padding: 26px 18px 22px; }

.grant-head { text-align: center; margin-bottom: 18px; }

.grant-icon {
  width: 64px;
  height: 64px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: linear-gradient(145deg, #4a95ec 0%, #2b7be4 100%);
  box-shadow: 0 18px 32px -18px rgba(43, 123, 228, .95), 0 1px 0 rgba(255, 255, 255, .35) inset;
}

.grant-title {
  font-size: 19px;
  line-height: 1.45;
  font-weight: 600;
  margin-bottom: 6px;
  background: linear-gradient(104deg, var(--title-a) 0%, var(--title-b) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  word-break: break-word;
}

.grant-desc {
  margin: 9px 0 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
}

.grant-scope-box {
  background: rgba(43, 123, 228, .05);
  border: 1px solid rgba(43, 123, 228, .13);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}

.grant-scope-title {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-deep);
}

.grant-scopes { list-style: none; margin: 0; padding: 0; }
.grant-scopes li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
}
.grant-scopes li + li { margin-top: 7px; }

.grant-check {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-top: 2px;
  background: rgba(43, 123, 228, .14);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.grant-scope-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-3);
}

.grant-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .9);
  margin-bottom: 14px;
}
.grant-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(43, 123, 228, .08);
}
.grant-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grant-account-main { flex: 1; min-width: 0; }
.grant-account-main strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grant-account-main small {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grant-switch { flex: 0 0 auto; font-size: 12.5px; color: var(--text-3); }

.grant-reuse {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.6;
}

.grant-actions { display: grid; gap: 9px; }

.grant-foot {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
  text-align: center;
}
.grant-foot a { color: var(--accent); font-weight: 500; }

/* ---------- 客户端密钥 ---------- */
.secret-box {
  background: linear-gradient(152deg, rgba(255, 255, 255, .96) 0%, rgba(236, 246, 255, .94) 100%);
  border: 1px solid rgba(43, 123, 228, .3);
  border-radius: 16px;
  padding: 15px 16px;
  margin-bottom: 16px;
  box-shadow: 0 16px 34px -22px rgba(43, 123, 228, .85);
}
.secret-label {
  margin: 0 0 9px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--accent-d);
}
.secret-value { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.secret-value code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(43, 123, 228, .16);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-deep);
  word-break: break-all;
}

/* ---------- 危险操作区 ---------- */
.danger-zone { border-color: rgba(207, 63, 54, .24); }
.danger-zone .card-title {
  background: none;
  color: var(--danger);
  -webkit-text-fill-color: var(--danger);
}

/* ---------- 表单两列 ---------- */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row .field { margin-bottom: 15px; }

/* ---------- 紧凑键值 ---------- */
.kv-tight dt,
.kv-tight dd { padding-top: 7px; padding-bottom: 7px; font-size: 13px; }

.url-break { word-break: break-all; overflow-wrap: anywhere; }

/* ---------- 全屏流程页（授权 / 退出） ---------- */
body.is-bare .page { padding-top: 28px; }
body.is-bare .container { max-width: 452px; }
body.is-bare .foot { display: none; }

/* ---------- 小屏微调 ---------- */
@media (max-width: 599px) {
  .orb-a { width: 240px; height: 240px; right: -100px; }
  .orb-b { width: 200px; height: 200px; left: -110px; }
  .orb-c { width: 300px; height: 300px; right: -70px; bottom: -150px; }

  .field-row { grid-template-columns: 1fr; gap: 0; }
  .grant-card { padding: 22px 15px 20px; }
  .grant-icon { width: 58px; height: 58px; font-size: 23px; border-radius: 17px; }
  .grant-title { font-size: 18px; }
  .app-item-action .btn-sm { padding: 0 10px; font-size: 12.5px; }
}

/* ---------- 首页桌面两栏 ---------- */
@media (min-width: 880px) {
  /* 门户页内容少，让它在视口里垂直居中，避免下方大片空白 */
  .page:has(.home-wrap) {
    display: flex;
    align-items: center;
  }
  .page:has(.home-wrap) .container { width: 100%; }

  .home-wrap {
    display: grid;
    grid-template-columns: 1.12fr .88fr;
    gap: 16px;
    align-items: stretch;
  }
  .home-wrap .hero {
    margin-bottom: 0;
    padding: 30px 26px 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .home-wrap .card { margin-top: 0; }
}

/* ---------- 小屏：顶栏只留登录，注册交给主视觉 ---------- */
@media (max-width: 599px) {
  .topbar-action .btn-primary { display: none; }
  .brand-text { font-size: 14.5px; }
}

/* ---------- 次要动作按钮（获取验证码之类） ---------- */
.btn-soft {
  background: rgba(43, 123, 228, .09);
  border-color: rgba(43, 123, 228, .22);
  color: var(--accent-d);
}
.btn-soft:active {
  background: rgba(43, 123, 228, .18);
  border-color: rgba(43, 123, 228, .34);
}
.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   悬停效果：只在鼠标设备上生效
   手机/平板上不存在真正的 hover，浏览器会在点击后把 :hover 粘住不放，
   表现出来就是「点一下闪一下」。这里统一收口，触屏设备只用 :active。
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--accent-d); }
  .brand:hover { color: var(--text); }
  .nav-link:hover { background: rgba(43, 123, 228, .07); color: var(--text); }
  .foot a:hover { color: var(--accent); }
  .code-row .btn:hover { background: var(--accent-l); }
  .pass-toggle:hover { background: rgba(43, 123, 228, .08); color: var(--text-2); }
  .seg:hover { color: var(--text); }
  .seg.on:hover { color: var(--accent-d); }
  .quick-item:hover { border-color: #cfdcf9; background: #fbfcff; color: var(--text); }
  .table tbody tr:hover { background: #fafbfe; }
  .crumb a:hover { color: var(--accent); }
  .grant-switch:hover { color: var(--accent); }
  .chart-col:hover .chart-bar { background: var(--accent); }
  .btn-soft:hover {
    background: rgba(43, 123, 228, .16);
    border-color: rgba(43, 123, 228, .34);
    color: var(--accent-d);
  }
  .tab:hover { color: var(--accent); }
  .app-item:hover .app-main strong { color: var(--accent-d); }
}

/* ==========================================================================
   页面切换：跨文档视图过渡
   现代浏览器会把上一页截一张图，等新页面渲染好再做交叉淡化，
   中间那段「白屏一闪」就消失了。不支持的浏览器自动忽略，不影响功能。
   ========================================================================== */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-out .16s ease both; }
  ::view-transition-new(root) { animation: vt-in .2s ease both; }
}

@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in  { from { opacity: 0; } }

/* 跳转瞬间的顶部细进度条，给点击一个即时反馈 */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 9999;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, #2b7be4, #79b0ff);
  box-shadow: 0 0 8px rgba(43, 123, 228, .55);
  opacity: 0;
  pointer-events: none;
  transition: width .5s cubic-bezier(.2, .8, .3, 1), opacity .2s ease;
}
.nav-progress.on { opacity: 1; width: 72%; }
.nav-progress.done { opacity: 0; width: 100%; }

/* ==========================================================================
   经验 / 等级 / 签到
   ========================================================================== */
.exp-card {
  position: relative;
  overflow: hidden;
}
.exp-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 123, 228, .16) 0%, rgba(43, 123, 228, 0) 70%);
  pointer-events: none;
}

.exp-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}

.exp-badge {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  color: #fff;
  background: linear-gradient(145deg, #4a95ec 0%, #1f588f 100%);
  box-shadow: 0 10px 20px -12px rgba(31, 88, 143, .95), 0 1px 0 rgba(255, 255, 255, .35) inset;
}
.exp-badge b { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.exp-badge small { font-size: 8.5px; opacity: .8; letter-spacing: .06em; }

.exp-head-main { flex: 1; min-width: 0; }
.exp-head-main strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-deep);
  line-height: 1.4;
}
.exp-head-main small {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 1px;
}

.exp-bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(43, 123, 228, .12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
  overflow: hidden;
}
.exp-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6aa9f2 0%, #2b7be4 100%);
  box-shadow: 0 0 10px rgba(43, 123, 228, .4);
  transition: width .6s cubic-bezier(.2, .8, .3, 1);
}

.exp-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-3);
}
.exp-meta b { color: var(--accent-d); font-weight: 600; }

/* ---------- 签到 ---------- */
.checkin-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(43, 123, 228, .18);
}
.checkin-main { flex: 1; min-width: 0; }
.checkin-main strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}
.checkin-main small {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
}
.checkin-box form { flex: 0 0 auto; margin: 0; }
.checkin-done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  background: rgba(26, 122, 72, .09);
  color: var(--ok);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.checkin-done svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 经验流水 ---------- */
.exp-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.exp-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}
.exp-list li:first-child { border-top: 0; padding-top: 0; }
.exp-list li:last-child { padding-bottom: 0; }
.exp-list .exp-flow-main { flex: 1; min-width: 0; }
.exp-list .exp-flow-main strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exp-list .exp-flow-main small {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
}
.exp-list .exp-amount {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ok);
}
.exp-list .exp-amount.neg { color: var(--danger); }

/* ==========================================================================
   封禁
   ========================================================================== */
.ban-panel {
  border-color: rgba(207, 63, 54, .26);
  background:
    linear-gradient(180deg, rgba(253, 240, 238, .72) 0%, rgba(255, 255, 255, .82) 62%);
}
.ban-panel .card-title {
  background: none;
  color: var(--danger);
  -webkit-text-fill-color: var(--danger);
}

.ban-current {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(207, 63, 54, .07);
  border: 1px solid rgba(207, 63, 54, .16);
  margin-bottom: 14px;
}
.ban-current svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 2px;
  fill: none;
  stroke: var(--danger);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ban-current div { flex: 1; min-width: 0; }
.ban-current strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #a32c23;
}
.ban-current small {
  display: block;
  font-size: 11.5px;
  color: #a9564e;
  margin-top: 2px;
  line-height: 1.6;
}

.ban-reason-text {
  margin: 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(207, 63, 54, .16);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  word-break: break-word;
}

.pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.pick-row input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.pick-row label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.pick-row input[type="radio"]:checked + label {
  background: rgba(43, 123, 228, .10);
  border-color: rgba(43, 123, 228, .38);
  color: var(--accent-d);
  font-weight: 600;
}

@media (max-width: 599px) {
  .exp-head { gap: 10px; }
  .exp-badge { width: 42px; height: 42px; flex-basis: 42px; border-radius: 13px; }
  .checkin-box { gap: 10px; }
  .pick-row label { flex: 1 1 calc(50% - 7px); }
}

/* ---------- 设置页的 Logo 预览 ---------- */
.logo-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 0 0 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid var(--line-soft);
}
.logo-preview img {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(43, 123, 228, .06);
}
.logo-preview-label {
  font-size: 12px;
  color: var(--text-3);
}
.logo-preview-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-deep);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   v4.1 新增：人机验证弹窗
   ========================================================================== */
.captcha-gate { display: none; }
.captcha-noscript {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 11px;
  background: var(--accent-soft);
}
.captcha-noscript img {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask {
  position: absolute;
  inset: 0;
  /* 底层模糊：弹窗后面的一切都被虚化，注意力只能落在验证码上 */
  background: rgba(15, 33, 58, .38);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  animation: modal-fade .18s ease;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 366px;
  padding: 20px 20px 18px;
  border-radius: 22px;
  background: var(--surface-solid);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 28px 70px -28px rgba(9, 26, 48, .55), 0 2px 10px -4px rgba(9, 26, 48, .2);
  animation: modal-pop .22s cubic-bezier(.22, 1, .36, 1);
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}
.modal-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-l);
  color: var(--accent-d);
}
.modal-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.modal-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -.01em;
}
.modal-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
}
.modal-captcha {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  padding: 9px;
  border-radius: 13px;
  background: var(--accent-soft);
  border: 1px solid var(--line-soft);
}
.modal-captcha img {
  /* 按原始比例放大，不要被 flex 拉宽——验证码字符一旦变形就更难认 */
  flex: 0 0 auto;
  height: 52px;
  width: auto;
  max-width: 100%;
  border-radius: 8px;
  background: #fff;
  display: block;
  object-fit: contain;
  cursor: pointer;
}
.modal-refresh {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--accent-d);
  font-size: 12.5px;
  font-family: inherit;
  padding: 6px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.modal-input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--input-bg, #fff);
  color: var(--text);
  font-size: 17px;
  font-family: inherit;
  letter-spacing: .16em;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(43, 123, 228, .14);
}
.modal-error {
  margin: 9px 0 0;
  font-size: 12.5px;
  color: var(--danger);
}
.modal-actions {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}
.modal-actions .btn { flex: 1; }

/* ==========================================================================
   v4.1 新增：扫码登录
   ========================================================================== */
.segmented.seg-3 .seg { padding: 9px 4px; font-size: 13.5px; }

.auth-panel[hidden] { display: none; }

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0 2px;
}
.qr-frame {
  position: relative;
  width: 208px;
  height: 208px;
  padding: 4px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px -18px rgba(21, 62, 110, .45);
  display: grid;
  place-items: center;
}
.qr-frame img {
  width: 200px;
  height: 200px;
  display: block;
  border-radius: 12px;
}
.qr-mask {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 12px;
}
.qr-mask-text {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.qr-hint {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 550;
  color: var(--text);
}
.qr-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.6;
  min-height: 1.6em;
}
.qr-sub.is-ok { color: var(--ok); }
.qr-sub.is-bad { color: var(--danger); }

/* 扫码确认页 */
.qr-confirm-wrap {
  max-width: 430px;
  margin: 0 auto;
  padding: 8px 0 26px;
}
.qr-confirm-card { padding: 26px 20px 22px; }
.qr-confirm-head { text-align: center; margin-bottom: 18px; }
.qr-confirm-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 17px;
  background: var(--accent-l);
  color: var(--accent-d);
}
.qr-confirm-icon svg {
  width: 27px; height: 27px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.qr-device {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--accent-soft);
  padding: 4px 14px;
  margin-bottom: 18px;
}
.qr-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.qr-device-row:last-child { border-bottom: 0; }
.qr-device-row span { color: var(--text-3); flex: 0 0 auto; }
.qr-device-row strong {
  color: var(--text);
  font-weight: 550;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qr-remember { margin: 0 0 16px; }
.qr-cancel { margin-top: 9px; }
.qr-confirm-tip {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-3);
  text-align: center;
}

/* ==========================================================================
   v4.1 新增：用户设置页
   ========================================================================== */
.settings-wrap {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 20px;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.theme-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 6px 9px;
  border-radius: 14px;
  border: 1.5px solid var(--line-soft);
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.theme-opt[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.theme-preview {
  width: 100%;
  height: 46px;
  border-radius: 9px;
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
}
.theme-preview i {
  display: block;
  border-radius: 3px;
  height: 8px;
}
.theme-preview i:first-child { width: 62%; }
.theme-preview i:last-child { width: 84%; opacity: .6; }
.theme-preview-light { background: #f4f9ff; }
.theme-preview-light i { background: #bcd6f5; }
.theme-preview-dark { background: #0d1626; border-color: #22304a; }
.theme-preview-dark i { background: #2f4467; }
.theme-preview-auto {
  background: linear-gradient(105deg, #f4f9ff 0 49.6%, #0d1626 50% 100%);
}
.theme-preview-auto i {
  background: linear-gradient(105deg, #bcd6f5 0 49.6%, #2f4467 50% 100%);
}
.theme-name {
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
}
.theme-opt[aria-pressed="true"] .theme-name { color: var(--accent-d); font-weight: 600; }

.settings-list {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
  text-decoration: none;
}
.settings-row:last-child { border-bottom: 0; }
.settings-row-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-d);
}
.settings-row-icon svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.settings-row-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.settings-row-main strong {
  font-size: 14.5px;
  font-weight: 550;
  color: var(--text);
}
.settings-row-main small {
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-row-arrow {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 19px;
  line-height: 1;
}
.logout-form { margin-top: 16px; }
.logout-form .btn svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.meta-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--accent-soft);
}
.meta-grid span { font-size: 11.5px; color: var(--text-3); }
.meta-grid strong { font-size: 13.5px; color: var(--text); font-weight: 550; }

/* ==========================================================================
   v4.1：底部提示改为直接写在背景上（去掉卡片容器）
   ========================================================================== */
.auth-tip {
  margin: 16px 2px 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.75;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}

/* ==========================================================================
   v4.1：深色模式
   变量整体换一套；少量写死白色的组件在这里单独压一遍。
   ========================================================================== */
:root {
  --input-bg: #ffffff;
  --mask-bg: rgba(15, 33, 58, .38);
}

[data-theme="dark"] {
  --bg:           #0d1626;
  --surface:      rgba(23, 36, 56, .74);
  --surface-solid:#16213280;
  --line:         rgba(120, 168, 235, .22);
  --line-soft:    rgba(120, 168, 235, .13);

  --text:      #e3ecf7;
  --text-2:    #a9bfd6;
  --text-3:    #7c93ac;
  --text-deep: #bcd9ff;

  --accent:      #57a2ff;
  --accent-d:    #8cc2ff;
  --accent-l:    rgba(87, 162, 255, .16);
  --accent-soft: rgba(87, 162, 255, .12);

  --title-a:    #cfe4ff;
  --title-b:    #6fb2ff;
  --subtitle-a: #a8cdf5;
  --subtitle-b: #6fb2ff;

  --danger:   #ff8b80;
  --danger-l: rgba(255, 139, 128, .13);
  --ok:       #6fdca0;
  --ok-l:     rgba(111, 220, 160, .13);
  --warn:     #f0c46a;
  --warn-l:   rgba(240, 196, 106, .13);

  --shadow:    0 10px 30px -16px rgba(0, 0, 0, .6);
  --shadow-lg: 0 14px 40px -16px rgba(0, 0, 0, .68);
  --glass:     0 1px 0 rgba(255, 255, 255, .06) inset, 0 10px 30px -14px rgba(0, 0, 0, .5);

  --input-bg: #0f1b2d;
  --mask-bg: rgba(4, 10, 20, .62);
}

[data-theme="dark"] body { background: transparent; color: var(--text); }

[data-theme="dark"] .bg-tint {
  background-color: #0a1120;
  background-image:
    linear-gradient(0deg, rgba(10, 17, 32, .9) 0%, rgba(10, 17, 32, 0) 40%),
    radial-gradient(120% 70% at 6% -12%, rgba(43, 123, 228, .26) 0%, rgba(43, 123, 228, 0) 60%),
    radial-gradient(90% 60% at 96% 8%, rgba(96, 76, 220, .18) 0%, rgba(96, 76, 220, 0) 62%),
    linear-gradient(180deg, #0a1120 0%, #0c1728 46%, #0a1424 100%);
}
[data-theme="dark"] .orb { opacity: .30; }

[data-theme="dark"] .topbar {
  background: rgba(13, 22, 38, .78);
  border-bottom-color: rgba(120, 168, 235, .14);
}
[data-theme="dark"] .card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .welcome,
[data-theme="dark"] .subnav {
  background: var(--surface);
  border-color: rgba(120, 168, 235, .16);
  box-shadow: var(--glass);
}
[data-theme="dark"] .modal-card {
  background: #16233a;
  border-color: rgba(120, 168, 235, .22);
}
[data-theme="dark"] .modal-mask { background: var(--mask-bg); }

[data-theme="dark"] .field input,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .field select,
[data-theme="dark"] .input,
[data-theme="dark"] .select {
  background: var(--input-bg);
  border-color: var(--line);
  color: var(--text);
}
[data-theme="dark"] .field input::placeholder { color: #5d7186; }

[data-theme="dark"] .btn {
  background: rgba(38, 56, 82, .8);
  border-color: rgba(120, 168, 235, .2);
  color: var(--text);
}
[data-theme="dark"] .btn-primary {
  background: linear-gradient(180deg, #3d8ff0, #2b7be4);
  border-color: rgba(255, 255, 255, .12);
  color: #fff;
}
[data-theme="dark"] .btn-ghost { background: rgba(38, 56, 82, .5); }
[data-theme="dark"] .btn-soft {
  background: rgba(87, 162, 255, .14);
  border-color: rgba(87, 162, 255, .26);
  color: var(--accent-d);
}
[data-theme="dark"] .btn-danger {
  background: rgba(255, 139, 128, .16);
  border-color: rgba(255, 139, 128, .32);
  color: var(--danger);
}

[data-theme="dark"] .tabbar {
  background: rgba(22, 34, 54, .86);
  border-color: rgba(120, 168, 235, .22);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 16px 38px -14px rgba(0, 0, 0, .7);
}
[data-theme="dark"] .tab { color: #7c93ac; }
[data-theme="dark"] .tab.active { color: var(--accent-d); }
[data-theme="dark"] .tab.is-near { color: #8fc0ff; }

[data-theme="dark"] .segmented { background: rgba(87, 162, 255, .10); }
[data-theme="dark"] .seg { color: var(--text-2); }
[data-theme="dark"] .seg.on { background: #1e2f49; color: var(--accent-d); }

[data-theme="dark"] .alert-info { background: rgba(87, 162, 255, .12); color: var(--accent-d); }
[data-theme="dark"] .alert-success { background: var(--ok-l); color: var(--ok); }
[data-theme="dark"] .alert-warn { background: var(--warn-l); color: var(--warn); }
[data-theme="dark"] .alert-danger { background: var(--danger-l); color: var(--danger); }

[data-theme="dark"] table,
[data-theme="dark"] .table { color: var(--text); }
[data-theme="dark"] .table th {
  background: rgba(87, 162, 255, .08);
  color: var(--text-2);
}
[data-theme="dark"] .table tr,
[data-theme="dark"] .table td { border-color: var(--line-soft); }

[data-theme="dark"] .qr-frame { background: #fff; border-color: rgba(120, 168, 235, .3); }
[data-theme="dark"] .qr-mask { background: rgba(22, 35, 58, .94); }
[data-theme="dark"] .qr-device { background: rgba(87, 162, 255, .08); }
[data-theme="dark"] .modal-captcha { background: rgba(87, 162, 255, .08); }
[data-theme="dark"] .captcha-noscript { background: rgba(87, 162, 255, .08); }
[data-theme="dark"] .captcha-noscript img { background: #fff; }

[data-theme="dark"] .auth-tip { text-shadow: none; color: var(--text-3); }
[data-theme="dark"] .theme-preview-light { background: #f4f9ff; }
[data-theme="dark"] .code-box,
[data-theme="dark"] .invite-box,
[data-theme="dark"] .secret-box {
  background: rgba(87, 162, 255, .08);
  border-color: var(--line);
}

/* --------------------------------------------------------------------------
   深色模式：把早期写死为浅色的组件统一压暗
   （截图复查发现的漏网之鱼：首页宫格、hero、feature、输入框聚焦、验证码按钮等）
   -------------------------------------------------------------------------- */
[data-theme="dark"] .hero {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(87, 162, 255, .16) 0%, rgba(87, 162, 255, 0) 62%),
    linear-gradient(158deg, rgba(30, 47, 74, .94) 0%, rgba(23, 36, 58, .9) 58%, rgba(21, 33, 54, .92) 100%);
  border-color: rgba(120, 168, 235, .18);
  box-shadow: var(--glass);
}
[data-theme="dark"] .hero-points { border-top-color: rgba(120, 168, 235, .2); }

[data-theme="dark"] .feature {
  background: rgba(30, 47, 74, .62);
  border-color: rgba(120, 168, 235, .15);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset;
}
[data-theme="dark"] .feature-icon { background: rgba(87, 162, 255, .16); color: var(--accent-d); }

[data-theme="dark"] .quick-item {
  background: rgba(30, 47, 74, .68);
  border-color: rgba(120, 168, 235, .16);
  color: var(--text);
}
[data-theme="dark"] .quick-item:hover {
  background: rgba(87, 162, 255, .15);
  border-color: rgba(87, 162, 255, .34);
  color: var(--text);
}
[data-theme="dark"] .quick-icon {
  background: rgba(87, 162, 255, .16);
  color: var(--accent-d);
}

[data-theme="dark"] .topbar-avatar { background: #16233a; }
[data-theme="dark"] .subnav-wrap {
  background: rgba(13, 22, 38, .82);
  border-bottom-color: rgba(120, 168, 235, .13);
}

/* 输入框：基础态与聚焦态都要跟着换，否则聚焦会「闪白」 */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea { background: var(--input-bg); }
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  background: #12203a;
  border-color: rgba(87, 162, 255, .52);
}
[data-theme="dark"] .code-row .btn {
  background: rgba(87, 162, 255, .14);
  border-color: rgba(87, 162, 255, .3);
  color: var(--accent-d);
}
[data-theme="dark"] .code-row .btn.is-wait {
  background: rgba(38, 56, 82, .5);
  color: var(--text-3);
}
[data-theme="dark"] .btn-ghost:hover {
  background: rgba(87, 162, 255, .16);
  color: var(--accent-d);
}

[data-theme="dark"] .code-block code {
  background: rgba(9, 16, 29, .8);
  border-color: rgba(120, 168, 235, .18);
}
[data-theme="dark"] .hint-box {
  background: rgba(87, 162, 255, .08);
  border-color: rgba(120, 168, 235, .2);
}
[data-theme="dark"] .file-btn {
  background: rgba(87, 162, 255, .08);
  border-color: rgba(120, 168, 235, .3);
}
[data-theme="dark"] .table tbody tr:hover { background: rgba(87, 162, 255, .07); }
[data-theme="dark"] .grant-account { background: rgba(30, 47, 74, .6); }
[data-theme="dark"] .secret-value code { background: rgba(87, 162, 255, .1); }
[data-theme="dark"] .ban-reason-text {
  background: rgba(255, 139, 128, .1);
  border-color: rgba(255, 139, 128, .24);
  color: var(--danger);
}
[data-theme="dark"] .pick-row label { background: rgba(30, 47, 74, .6); }
[data-theme="dark"] .logo-preview { background: rgba(9, 16, 29, .55); }
[data-theme="dark"] .chart-bar.is-zero { background: rgba(120, 168, 235, .16); }
/* 图表：浅色网格线是 #eef1f6，深色下会变成一片亮条纹 */
[data-theme="dark"] .chart {
  background-image: repeating-linear-gradient(
    to top, transparent 0, transparent 29px,
    rgba(120, 168, 235, .12) 29px, rgba(120, 168, 235, .12) 30px
  );
}
[data-theme="dark"] .chart-bar {
  background: linear-gradient(180deg, rgba(140, 194, 255, .88), rgba(87, 162, 255, .62));
}
[data-theme="dark"] .chart-col:hover .chart-bar { background: var(--accent); }
/* 经验条：浅色下靠一条白色内高光做质感，深色下会变成刺眼的白描边 */
[data-theme="dark"] .exp-bar {
  background: rgba(87, 162, 255, .14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset;
}
[data-theme="dark"] .install-body {
  background: #16233a;
  border-color: rgba(120, 168, 235, .2);
}

/* 让原生控件跟着主题走 */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select { color-scheme: dark; }

/* 弹窗打开时锁住背景滚动 */
body.modal-open { overflow: hidden; }

/* ==========================================================================
   v4.1：备份页的"灾难恢复"说明
   ========================================================================== */
.disaster-card {
  border-color: rgba(43, 123, 228, .28);
  background:
    linear-gradient(180deg, rgba(43, 123, 228, .06), rgba(43, 123, 228, 0) 42%),
    var(--surface);
}
.recovery-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.recovery-step {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--line-soft);
}
.recovery-num {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
  margin-top: 1px;
}
.recovery-step strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.recovery-step small {
  display: block;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-3);
  margin-top: 1px;
}
[data-theme="dark"] .recovery-step {
  background: rgba(87, 162, 255, .08);
}
@media (max-width: 620px) {
  .recovery-steps { grid-template-columns: 1fr; }
}

/* ==========================================================================
   v4.2
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Toast 悬浮通知
   -------------------------------------------------------------------------- */
/* 有 JS 时，页面内这些 alert 收进悬浮 toast；没有 JS 就照常内联显示 */
.js .alert[data-toast-auto] { display: none !important; }

.toast-stack {
  position: fixed;
  left: 50%;
  /* 落在顶栏下面，不去盖品牌与头像 */
  top: calc(env(safe-area-inset-top, 0px) + var(--topbar-h) + 10px);
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 400px;
  z-index: 220;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 10px 12px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow:
    0 18px 38px -20px rgba(9, 26, 48, .55),
    0 2px 8px -4px rgba(9, 26, 48, .18);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  pointer-events: auto;
  overflow: hidden;
  will-change: transform, opacity;
  animation: toast-in .54s cubic-bezier(.16, 1.42, .36, 1) both;
}

/* Q 弹：先冲过头一点再落回来 */
@keyframes toast-in {
  0%   { opacity: 0; transform: translateY(-26px) scale(.82); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.toast.is-out {
  animation: toast-out .3s cubic-bezier(.45, 0, .8, .4) both;
}
@keyframes toast-out {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-16px) scale(.9); }
}

.toast-ico {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tone-l, rgba(43, 123, 228, .12));
  color: var(--tone, var(--accent));
}
.toast-ico svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toast-text {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 1px;
  word-break: break-word;
}
.toast-close {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.toast-close svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
.toast-close:hover { background: rgba(43, 123, 228, .1); color: var(--text-2); }

/* 底部走完就自动消失，悬停时暂停 */
.toast-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--tone, var(--accent));
  opacity: .45;
  transform-origin: left center;
  animation: toast-timer linear forwards;
}
@keyframes toast-timer {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
.toast.is-hold .toast-timer { animation-play-state: paused; }

.toast[data-variant="success"] { --tone: #2f9e63; --tone-l: rgba(47, 158, 99, .14); }
.toast[data-variant="danger"]  { --tone: #d6453a; --tone-l: rgba(214, 69, 58, .13); }
.toast[data-variant="warn"]    { --tone: #c8892a; --tone-l: rgba(200, 137, 42, .15); }
.toast[data-variant="info"]    { --tone: #2b7be4; --tone-l: rgba(43, 123, 228, .12); }

/* --------------------------------------------------------------------------
   2. 验证码图片：加载动画
   -------------------------------------------------------------------------- */
.modal-captcha { position: relative; }
.captcha-imghold {
  position: relative;
  display: block;
  flex: 0 0 auto;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  line-height: 0;
}
.captcha-imghold img { max-width: none; }
.modal-captcha img {
  transition: opacity .22s ease;
}
.modal-captcha.is-loading img { opacity: 0; }

.captcha-loading {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: 8px;
  place-items: center;
  pointer-events: none;
  background:
    linear-gradient(100deg,
      rgba(255, 255, 255, .05) 20%,
      rgba(255, 255, 255, .62) 40%,
      rgba(255, 255, 255, .05) 60%);
  background-size: 220% 100%;
  background-color: rgba(43, 123, 228, .07);
  animation: captcha-shimmer 1.05s linear infinite;
}
.modal-captcha.is-loading .captcha-loading { display: grid; }
@keyframes captcha-shimmer {
  from { background-position: 130% 0; }
  to   { background-position: -30% 0; }
}
.captcha-loading i {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2px solid rgba(43, 123, 228, .22);
  border-top-color: var(--accent);
  animation: captcha-spin .7s linear infinite;
}
@keyframes captcha-spin { to { transform: rotate(360deg); } }
/* 加载完让 refresh 按钮亮一点，过渡自然 */
.modal-captcha.is-ready .modal-refresh { opacity: 1; }
.modal-captcha .modal-refresh { opacity: .85; transition: opacity .2s; }

/* --------------------------------------------------------------------------
   3. 软导航：内容淡入，不再白屏
   -------------------------------------------------------------------------- */
body.is-navigating { cursor: progress; }
main.page.is-entering > .container {
  animation: page-in .34s cubic-bezier(.22, .9, .3, 1) both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   4. 认证页：去掉卡片容器，内容直接铺在背景上
   -------------------------------------------------------------------------- */
.is-auth main.page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 26px 0 34px;
}
@media (min-height: 740px) {
  .is-auth main.page {
    align-items: center;
    min-height: calc(100vh - var(--topbar-h) - 78px);
    padding: 20px 0 26px;
  }
}
.is-auth .container { max-width: 460px; }

.is-auth .auth-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 0;
}

/* 关键：容器完全透明，只剩内容本身 */
.is-auth .auth-card {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.is-auth .auth-head { margin-bottom: 24px; }
.is-auth .auth-title {
  font-size: 28px;
  line-height: 1.28;
  letter-spacing: -.025em;
  margin-bottom: 8px;
}
.is-auth .auth-sub {
  font-size: 13.5px;
  color: var(--text-2);
  max-width: 30em;
  margin: 0 auto;
}

/* 分段控件做成玻璃胶囊，浮在背景上 */
.is-auth .segmented {
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .8);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 10px 24px -18px rgba(9, 26, 48, .4);
  margin-bottom: 22px;
}
.is-auth .seg {
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 500;
}
.is-auth .seg.on {
  background: #fff;
  color: var(--accent-d);
  box-shadow: 0 4px 12px -6px rgba(31, 88, 143, .35);
}

/* 输入框：半透明玻璃，边界靠内高光而不是实线 */
.is-auth .field > span:first-child {
  font-size: 12.5px;
  color: var(--text-2);
  letter-spacing: .01em;
}
.is-auth .field input {
  min-height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .58);
  border-color: rgba(255, 255, 255, .9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .65) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.is-auth .field input:focus {
  background: rgba(255, 255, 255, .82);
  border-color: rgba(43, 123, 228, .55);
  box-shadow: 0 0 0 3.5px rgba(43, 123, 228, .13);
}
.is-auth .btn-lg { min-height: 52px; border-radius: 14px; }

.is-auth .auth-foot {
  margin-top: 22px;
  padding-top: 0;
  border-top: 0;
  font-size: 13.5px;
  color: var(--text-2);
}
.is-auth .auth-foot a { font-weight: 500; }

.is-auth .auth-note,
.is-auth .auth-tip {
  margin: 20px auto 0;
  max-width: 32em;
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-3);
}

/* 验证码那行按钮与输入框对齐 */
.is-auth .code-row .btn { border-radius: 14px; }

/* --------------------------------------------------------------------------
   5. 深色模式：新组件与认证页
   -------------------------------------------------------------------------- */
[data-theme="dark"] .toast {
  background: rgba(28, 43, 66, .94);
  border-color: rgba(120, 168, 235, .26);
  box-shadow:
    0 20px 44px -22px rgba(0, 0, 0, .8),
    0 2px 10px -4px rgba(0, 0, 0, .5);
}
[data-theme="dark"] .toast-close:hover { background: rgba(120, 168, 235, .18); }
[data-theme="dark"] .toast[data-variant="success"] { --tone: #6fdca0; --tone-l: rgba(111, 220, 160, .16); }
[data-theme="dark"] .toast[data-variant="danger"]  { --tone: #ff8b80; --tone-l: rgba(255, 139, 128, .16); }
[data-theme="dark"] .toast[data-variant="warn"]    { --tone: #f0c46a; --tone-l: rgba(240, 196, 106, .16); }
[data-theme="dark"] .toast[data-variant="info"]    { --tone: #8cc2ff; --tone-l: rgba(140, 194, 255, .16); }

[data-theme="dark"] .captcha-loading {
  background:
    linear-gradient(100deg,
      rgba(255, 255, 255, .02) 20%,
      rgba(140, 194, 255, .16) 40%,
      rgba(255, 255, 255, .02) 60%);
  background-size: 220% 100%;
  background-color: rgba(87, 162, 255, .1);
}
[data-theme="dark"] .captcha-loading i { border-color: rgba(140, 194, 255, .24); border-top-color: var(--accent-d); }

[data-theme="dark"] .is-auth .segmented {
  background: rgba(30, 47, 74, .62);
  border-color: rgba(120, 168, 235, .18);
  box-shadow: none;
}
[data-theme="dark"] .is-auth .seg.on {
  background: rgba(87, 162, 255, .22);
  color: #cfe4ff;
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .6);
}
[data-theme="dark"] .is-auth .field input {
  background: rgba(15, 27, 45, .72);
  border-color: rgba(120, 168, 235, .22);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset;
}
[data-theme="dark"] .is-auth .field input:focus {
  background: rgba(18, 32, 58, .92);
  border-color: rgba(87, 162, 255, .6);
  box-shadow: 0 0 0 3.5px rgba(87, 162, 255, .16);
}

/* --------------------------------------------------------------------------
   6. 信息架构调整后的零碎样式
   -------------------------------------------------------------------------- */
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

/* 首页底部的一句话说明：不套卡片，直接写在背景上 */
.home-hint {
  margin: 14px 2px 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-3);
  text-align: center;
}
.home-hint a { font-weight: 500; }

.avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.avatar-lg-sm {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 20px;
}
.avatar-row .avatar-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.avatar-row .avatar-form .tiny { flex-basis: auto; }

/* 设置页的分区标题间距更紧凑一点 */
.settings-wrap .card + .card { margin-top: 12px; }
.settings-wrap .divider { margin: 16px 0; }
.settings-wrap .field:last-of-type { margin-bottom: 12px; }

@media (max-width: 599px) {
  .avatar-row { gap: 12px; }
}

/* 认证页：顶栏只留品牌，右上角那两个按钮与页内链接重复，隐掉 */
.is-auth .topbar {
  background: rgba(244, 249, 255, .42);
  border-bottom-color: transparent;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
[data-theme="dark"] .is-auth .topbar { background: rgba(10, 17, 32, .45); }

/* 页脚只剩版权，居中即可 */
.foot-inner { justify-content: center; text-align: center; }

/* 认证页输入框：玻璃感要有，但边界得看得见 */
.is-auth .field input {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(120, 168, 226, .34);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 8px 18px -16px rgba(9, 26, 48, .55);
}
.is-auth .auth-tip { text-wrap: balance; }

/* 原生复选框在深色下会变成一个突兀的浅灰方块，统一自己画 */
.checkbox input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  margin: 1px 0 0;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background-color: var(--input-bg);
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.checkbox input[type="checkbox"]:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.6 4.6 4.6L19 7'/%3E%3C/svg%3E");
  background-size: 13px 13px;
  background-position: center;
  background-repeat: no-repeat;
}
.checkbox input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(43, 123, 228, .18);
}

/* =====================================================================
 * v4.3
 * 1) 密码可见性改成小眼睛图标
 * 2) 邮箱与「发送」同一行
 * 3) 应用图标支持图片链接，条目布局加固
 * 4) 首页卡片鼠标倾角
 * 5) 设置入口从底栏移到「我的」
 * ===================================================================== */

/* ---------- 1. 小眼睛 ---------- */
.pass-toggle {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.pass-toggle:hover { color: var(--text-2); background: var(--hover); }
.pass-toggle:active { transform: scale(.94); }
.pass-toggle:focus-visible {
  outline: none;
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 123, 228, .18);
}
.pass-toggle .eye {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
/* 默认睁眼：提示「点一下能看见」；点开之后换成划线眼 */
.pass-toggle .eye-off { display: none; }
.pass-toggle.is-shown .eye-open { display: none; }
.pass-toggle.is-shown .eye-off { display: block; }
.pass-toggle.is-shown { color: var(--accent); }

.field-pass input { padding-right: 46px; }

/* ---------- 2. 邮箱 + 发送 ---------- */
.field-send {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.field-send input { flex: 1 1 auto; min-width: 0; }
.btn-send {
  flex: 0 0 auto;
  width: 74px;
  padding: 0;
  font-size: 14px;
  border-radius: var(--radius-sm, 12px);
  white-space: nowrap;
}
.btn-send.is-wait {
  width: 74px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
/* 认证页的输入是玻璃的，按钮跟着轻一点 */
.is-auth .field-send .btn-send {
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(120, 168, 226, .34);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
}
[data-theme="dark"] .is-auth .field-send .btn-send {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(120, 168, 226, .22);
  box-shadow: none;
}

/* ---------- 3. 应用图标与条目 ---------- */
.app-icon.has-image,
.grant-icon.has-image {
  background: var(--surface-2, #eef3fb);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset;
}
.app-icon img,
.grant-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
/* 加固：图标不再被长内容撑破；文字列强制可压缩；按钮列不参与挤压 */
.app-icon, .grant-icon { overflow: hidden; }
.app-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.app-item > form { justify-self: end; }
.app-item .app-main { min-width: 0; }
.app-item .app-icon { align-self: start; margin-top: 1px; }
.grant-icon { flex: 0 0 auto; }

@media (max-width: 359px) {
  /* 极窄屏：按钮换到第二行，避免把名称挤成一个字 */
  .app-item { grid-template-columns: auto minmax(0, 1fr); row-gap: 8px; }
  .app-item > form { grid-column: 1 / -1; justify-self: start; }
  .app-item-action .btn-sm { width: 100%; }
}

/* ---------- 4. 首页卡片倾角 ---------- */
[data-tilt] {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --spot-x: 50%;
  --spot-y: 50%;
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  transition: transform .52s cubic-bezier(.22, .8, .3, 1), box-shadow .4s ease;
  will-change: transform;
}
[data-tilt].is-tilting { transition: transform .1s linear; }
[data-tilt]:hover {
  box-shadow: 0 20px 44px -28px rgba(20, 62, 122, .42), 0 2px 6px -4px rgba(20, 62, 122, .14);
}
[data-theme="dark"] [data-tilt]:hover {
  box-shadow: 0 22px 46px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(120, 168, 235, .12);
}
/* 一道跟随指针的柔光，倾角才有「被按住」的实感 */
[data-tilt]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
  background: radial-gradient(340px circle at var(--spot-x) var(--spot-y),
              rgba(126, 176, 255, .3), rgba(126, 176, 255, 0) 62%);
}
[data-tilt]:hover::after { opacity: .75; }
[data-theme="dark"] [data-tilt]::before {
  background: radial-gradient(320px circle at var(--spot-x) var(--spot-y),
              rgba(120, 168, 235, .18), rgba(120, 168, 235, 0) 62%);
}
[data-theme="dark"] [data-tilt]:hover::after { opacity: 1; }
[data-tilt] { position: relative; }

@media (prefers-reduced-motion: reduce) {
  [data-tilt] { transform: none !important; transition: none; }
  [data-tilt]::before { display: none; }
}

/* ---------- 5. 我的页的设置入口 ---------- */
.page-head .btn-settings {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.page-head .btn-settings svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 欢迎卡右上角的装饰圆在深色下会发灰，改成柔光 */
[data-theme="dark"] .welcome::after {
  background: radial-gradient(circle, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 70%);
}

/* 底栏少了一项：改成按项数自适应宽度并居中，两项时不会摊成两块大白板 */
@media (max-width: 879px) {
  .tabbar {
    left: 50%;
    right: auto;
    width: max-content;
    max-width: calc(100% - 28px);
    transform: translateX(-50%) translateZ(0);
  }
  .tabbar .tab {
    flex: 1 1 auto;
    min-width: 96px;
    padding: 0 10px;
  }
}

/* =====================================================================
 * v4.4
 * 1) 连续签到递增经验（文案与明细页）
 * 2) 头衔系统徽章
 * 3) 我的页：经验记录移二级页、卡片间距修复、消息中心入口
 * 4) 备份页移动端卡片化（不再横向滑动）
 * 5) 站内邮箱：顶栏铃铛 + 消息列表
 * 6) 后台：头衔管理、消息推送
 * ===================================================================== */

/* ---------- 1. 经验明细页 ---------- */
.exp-foot {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
.exp-more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}
.exp-more:hover { text-decoration: underline; }
.exp-more svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.exp-rule { line-height: 1.7; }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
}

/* ---------- 卡片间距：经验卡与下面双栏之间本来没有任何间距 ---------- */
.card + .grid-two,
.card + .grid-cards,
.grid-two + .card,
.grid-cards + .card { margin-top: 16px; }

/* ---------- 2. 头衔徽章 ---------- */
.badge-title {
  font-size: 11.5px;
  padding: 2.5px 9px;
  border: 1px solid;
  background: rgba(43, 123, 228, .1);
  border-color: rgba(43, 123, 228, .3);
  color: var(--accent);
  line-height: 1.5;
  white-space: nowrap;
}
.user-cell-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* 后台头衔管理 */
.title-admin-list { list-style: none; margin: 0; padding: 0; }
.title-admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.title-admin-item:last-child { border-bottom: 0; }
.title-admin-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.title-admin-ops { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- 3. 我的页消息入口 ---------- */
a.msg-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-top: 16px;
  padding: 14px 16px;
  color: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
}
a.msg-entry:hover { transform: translateY(-2px); box-shadow: var(--glass-strong, var(--glass)); }
.msg-entry-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-l);
}
.msg-entry-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.msg-entry-main { flex: 1 1 auto; min-width: 0; }
.msg-entry-main strong { display: block; font-size: 14.5px; }
.msg-entry-main small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.msg-entry-arrow {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 4. 备份记录：手机上重排成卡片，不再横向滑动 ---------- */
@media (max-width: 719px) {
  .table-scroll-cards { overflow: visible; }
  .table-scroll-cards .table-cards { min-width: 0; }
  .table-cards,
  .table-cards tbody,
  .table-cards tr,
  .table-cards td { display: block; width: auto; }
  .table-cards thead { display: none; }
  .table-cards tbody { padding: 4px 0 10px; }
  .table-cards tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    margin: 0 4px 10px;
    padding: 10px 14px 8px;
    background: var(--surface-soft, var(--surface));
    box-shadow: none;
  }
  .table-cards td {
    border: 0;
    padding: 5px 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
  }
  .table-cards td::before {
    content: attr(data-label);
    flex: 0 0 64px;
    text-align: left;
    font-size: 12px;
    color: var(--text-3);
  }
  .table-cards td[data-label="操作"] {
    margin-top: 4px;
    padding-top: 9px;
    border-top: 1px dashed var(--line-soft);
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .table-cards td[data-label="操作"]::before { display: none; }
  .table-cards td[data-label="文件名"] { word-break: break-all; }
}

/* ---------- 5. 站内邮箱 ---------- */
.nav-count {
  display: inline-block;
  min-width: 17px;
  height: 17px;
  line-height: 17px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  vertical-align: 1px;
}
.topbar-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--text-2);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.topbar-bell:hover { background: var(--hover); color: var(--text-1, var(--text-deep)); }
.topbar-bell.active { color: var(--accent); background: var(--accent-l); }
.topbar-bell svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bell-dot {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 0 0 2px var(--topbar-bg, #fff);
}
/* 桌面顶栏已有「消息」文字链接，铃铛只在手机端显示 */
.topbar-bell { display: none; }
@media (max-width: 879px) {
  .topbar-bell { display: flex; }
}

/* 消息列表（卡片样式统一放在下方「2. 消息中心」） */
.msg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

/* ---------- 6. 后台消息推送 ---------- */
.segmented-sm .seg { padding: 7px 14px; font-size: 13px; }
.seg-panel { margin-top: 2px; }
.seg-panel[hidden] { display: none; }

.user-pick {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface-soft, var(--surface));
}
.user-pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
  cursor: pointer;
}
.user-pick-item:hover { background: var(--hover); }
.user-pick-item input[type="radio"] { accent-color: var(--accent); flex: 0 0 auto; }
.user-pick-text { min-width: 0; display: grid; }
.user-pick-text strong { font-size: 13.5px; }
.user-pick-text small { font-size: 12px; color: var(--text-3); }

.empty-state-sm { padding: 14px 0; }
.empty-state-sm p { margin: 0 0 4px; }

/* 定向推送：搜索框、候选列表、已选用户合一的批量选择器 */
.user-picker {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft, var(--surface));
  overflow: hidden;
}
.user-picker-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .5);
}
.user-picker-ic {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.user-picker-search {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
}
.user-picker-search::placeholder { color: var(--text-3); }
.user-picker-count {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-l);
  color: var(--accent-d);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.user-picker-count.on { background: var(--accent); color: #fff; }
.user-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line-soft);
}
.user-picker-selected[hidden] { display: none; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 10px;
  border: 1px solid rgba(43, 123, 228, .28);
  border-radius: 999px;
  background: rgba(43, 123, 228, .09);
  color: var(--accent-d);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.user-chip:hover { background: rgba(43, 123, 228, .17); }
.user-chip svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.user-picker-list {
  display: grid;
  gap: 4px;
  max-height: 208px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
}
.user-picker-empty {
  padding: 20px 10px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.user-picker-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 11px;
  border-top: 1px solid var(--line-soft);
}
.user-picker-tool {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-d);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.user-picker-tool:hover { text-decoration: underline; }
.user-picker-hint {
  margin-left: auto;
  color: var(--text-3);
  font-size: 11.5px;
  text-align: right;
}
.user-picker-ids { display: none; }
.user-pick-item.is-checked { background: rgba(43, 123, 228, .09); }
.user-pick-item input[type="checkbox"] { accent-color: var(--accent); flex: 0 0 auto; }
@media (max-width: 479px) {
  .user-picker-hint { display: none; }
}

.ann-list { list-style: none; margin: 0; padding: 0; }
.ann-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.ann-list li:last-child { border-bottom: 0; }
.ann-main { min-width: 0; }
.ann-main strong { display: block; font-size: 13.5px; }
.ann-main small { display: block; margin-top: 2px; color: var(--text-3); }

/* =====================================================================
 * V1.0Beta
 * 1) 二级页面：顶栏返回键 + 页面名，隐藏悬浮底栏，渐入渐出
 * 2) 消息中心：单行省略 + 展开全文 + 点击已读 + 手动删除
 * 3) 自构 CSS 弹窗：确认框、选择框（遮罩底部模糊）
 * 4) 骨架屏：软导航光扫动画
 * 5) 主题跟随系统图标、备份页路径适配、概览页间距
 * ===================================================================== */

/* ---------- 1. 二级页面顶栏 ---------- */
.topbar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-back {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -8px;
  border-radius: 12px;
  color: var(--text-2);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease;
}
.topbar-back:hover { background: var(--hover); color: var(--text-1, var(--text-deep)); }
.topbar-back svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topbar-pagename {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 二级页：桌面导航隐藏（返回键已承担导航），手机 page-head 大标题让位给顶栏 */
body.is-secondary .nav { display: none; }
@media (max-width: 879px) {
  body.is-secondary .page-head > div:first-child { display: none; }
  body.is-secondary .page-head { justify-content: flex-end; min-height: 0; margin-bottom: 2px; }
  body.is-secondary .page-head:empty { display: none; }
}
/* 二级页渐入渐出：软导航整页切换统一动画 */
main.page.is-entering > .container {
  animation: page-in-beta .32s cubic-bezier(.22, .9, .3, 1) both;
}
@keyframes page-in-beta {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 2. 消息中心（v9：收起/展开两段式） ---------- */
.msg-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  overflow: hidden;
  transition: opacity .24s ease, transform .24s ease, border-color .24s ease, box-shadow .24s ease;
}
.msg-item.is-unread {
  border-color: rgba(43, 123, 228, .55);
  box-shadow: 0 0 0 1px rgba(43, 123, 228, .26) inset, var(--glass);
}
.msg-item.is-open {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset, 0 12px 30px -18px rgba(31, 88, 143, .5);
}
.msg-item.is-removing {
  opacity: 0;
  transform: translateX(26px) scale(.97);
  pointer-events: none;
}
/* 置顶公告：只用排序 + 徽标体现，卡片保持普通样式，不再铺金色底 */
.msg-item.is-pinned { border-color: var(--line); }

/* ---------- 2b. 消息中心：收起态固定 2 行，展开态完整正文 ---------- */
.msg-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 123, 228, .13);
}
.msg-badges {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 110px;
  overflow: hidden;
}
.msg-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.msg-badge--pin { background: rgba(43, 123, 228, .12); color: var(--accent-d); }
.msg-badge--ann { background: var(--accent-l); color: var(--accent-d); }
.msg-badge--sys { background: rgba(43, 123, 228, .08); color: var(--text-2); }

/* 收起态：2 行（徽标+标题+时间 / 正文预览+展开键），整块可点击 */
.msg-summary {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: grid-template-rows .32s cubic-bezier(.22, .9, .3, 1), opacity .22s ease;
}
.msg-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 16px; }
.msg-item.is-open .msg-summary { grid-template-rows: 0fr; opacity: 0; }
.msg-summary-inner {
  min-height: 0;
  overflow: hidden;
  padding: 11px 14px 10px;
  display: grid;
  gap: 5px;
  /* 不显式设 visibility：继承父级，加载遮罩隐藏 .container 时这里会一起隐藏 */
  transition: visibility 0s linear 0s;
}
/* 展开后小字预览彻底隐藏（等收起动画走完再切，避免闪一下） */
.msg-item.is-open .msg-summary-inner {
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear .32s;
}
.msg-line1,
.msg-line2 { display: flex; align-items: center; gap: 7px; min-width: 0; }
.msg-line2 { min-height: 24px; }
.msg-title {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-preview {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}
.msg-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.msg-time svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 展开 / 收起键：同一套外形，都贴在容器右下角，位置互相对应 */
.msg-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--accent-d);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease;
}
.msg-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .28s cubic-bezier(.22, .9, .3, 1);
}
.msg-toggle:hover { background: rgba(43, 123, 228, .09); }
.msg-toggle--expand:hover svg { transform: translateY(2px); }
.msg-toggle--collapse:hover svg { transform: translateY(-2px); }

/* 展开态：完整标题 + 完整正文 */
.msg-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .34s cubic-bezier(.22, .9, .3, 1);
}
.msg-item.is-open .msg-panel { grid-template-rows: 1fr; }
.msg-panel-inner {
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s linear .34s;
}
.msg-item.is-open .msg-panel-inner { visibility: visible; transition-delay: 0s; }
.msg-full-title {
  padding: 13px 14px 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--text);
  word-break: break-word;
  animation: msg-body-in .3s ease both;
}
.msg-panel-inner > .msg-full-text {
  margin: 0;
  padding: 8px 14px 12px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-1, var(--text-deep));
  word-break: break-word;
  animation: msg-body-in .3s ease both;
}
@keyframes msg-body-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* 操作行：已读/删除在左，发送时间与剩余删除时间同一行在右 */
.msg-ops {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-soft);
}
.msg-ops-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-ops-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
}
.msg-expire { font-size: 11.5px; color: var(--text-3); }
.msg-expire::before { content: '·'; margin-right: 6px; color: var(--text-3); }
/* 收起键固定在右下角，与收起态展开键位置对应 */
.msg-panel-foot {
  display: flex;
  justify-content: flex-end;
  padding: 8px 14px 12px;
}

/* 已读 / 删除：同一套外形与尺寸，只按语义换颜色 */
.msg-op-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.msg-op-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.msg-op-btn:active { transform: scale(.96); }
.msg-op-btn--read { color: var(--accent-d); border-color: rgba(43, 123, 228, .3); background: rgba(43, 123, 228, .08); }
.msg-op-btn--read:hover { background: rgba(43, 123, 228, .15); }
.msg-op-btn--del { color: var(--danger); border-color: rgba(207, 63, 54, .3); background: rgba(207, 63, 54, .07); }
.msg-op-btn--del:hover { background: rgba(207, 63, 54, .13); }
.msg-op-btn--done {
  color: var(--ok);
  border-color: rgba(26, 122, 72, .26);
  background: rgba(26, 122, 72, .09);
  cursor: default;
}
.msg-op-btn--done:active { transform: none; }
.inline-form { display: inline-flex; margin: 0; }

@media (max-width: 479px) {
  .msg-line1 { gap: 6px; }
  .msg-badges { max-width: 92px; }
  /* 窄屏时两个时间整体换到下一行，但彼此仍在同一行 */
  .msg-ops-meta { width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .msg-summary, .msg-panel, .msg-panel-inner, .msg-toggle svg { transition-duration: .01ms; }
  .msg-full-title, .msg-panel-inner > .msg-full-text { animation: none; }
}

/* ---------- 3. 自构 CSS 弹窗：确认框 ---------- */
.modal-card-confirm { max-width: 340px; }
.confirm-icon { background: var(--warn-l); color: var(--warn); }
.modal-card-confirm .modal-sub { font-size: 13.5px; color: var(--text-2); }
[data-theme="dark"] .confirm-icon { background: rgba(240, 196, 106, .16); color: #f0c46a; }

/* ---------- 3b. 自构选择框 ---------- */
select.sp-native { display: none !important; }
.sp-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--input-bg, #fff);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.sp-btn:hover { border-color: var(--accent); }
.sp-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sp-btn svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}
.sp-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 选择弹窗：底部弹出的面板，遮罩带模糊 */
.modal.select-modal { align-items: flex-end; padding: 12px; }
.select-modal .modal-mask {
  background: rgba(15, 33, 58, .42);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.modal-card-sheet {
  max-width: 480px;
  padding: 16px 14px 12px;
  border-radius: 22px 22px 18px 18px;
  animation: sheet-in .26s cubic-bezier(.22, 1, .36, 1);
}
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(34px); }
  to   { opacity: 1; transform: none; }
}
.modal-card-sheet .modal-head { margin-bottom: 8px; }
.sp-list {
  display: grid;
  gap: 4px;
  max-height: min(52vh, 340px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px;
}
.sp-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sp-option:hover { background: var(--accent-soft); }
.sp-option.active { background: var(--accent-l); color: var(--accent-d); font-weight: 600; }
.sp-check {
  display: grid;
  place-items: center;
  color: var(--accent);
}
.sp-check svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.select-modal .modal-actions { margin-top: 8px; }

/* ---------- 4. 页面加载：转圈固定在「屏幕（视口）中心」 ----------
   之前用 absolute + main.page(相对定位)，转圈会以「页面内容总长度」居中，
   长页面滚动到中部时转圈其实落在屏幕外。改为 fixed 后锚定视口，
   无论页面多长、滚到哪里，转圈始终在可见屏幕正中央。
   z-index 5 低于 topbar(30)/subnav(20)/tabbar(40)，加载时顶栏与底栏仍可见。 */
main.page { position: relative; }
.page-skeleton {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(236, 243, 255, .94), rgba(244, 249, 255, .94));
  pointer-events: none;
  animation: sk-in .18s ease both;
}
@keyframes sk-in { from { opacity: 0; } to { opacity: 1; } }
[data-theme="dark"] .page-skeleton { background: linear-gradient(180deg, rgba(10, 17, 32, .94), rgba(13, 22, 38, .94)); }
.page-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(43, 123, 228, .16);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: sk-spin .78s linear infinite;
}
@keyframes sk-spin { to { transform: rotate(360deg); } }
[data-theme="dark"] .page-spinner {
  border-color: rgba(120, 168, 235, .18);
  border-top-color: #6aa9f5;
  border-right-color: #6aa9f5;
}
.page-loader-text {
  font-size: 12.5px;
  color: var(--text-3);
  letter-spacing: .02em;
}
/* 加载时内容完全隐去：opacity 兜底，避免子组件显式 visibility:visible 透出来 */
main.page.has-skeleton > .container { visibility: hidden; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .page-skeleton { animation: none; }
  .page-spinner { animation: none; }
}

/* ---------- 5a. 主题预览：太阳 / 月亮图标 ---------- */
.theme-preview { position: relative; display: block; padding: 0; }
.theme-preview i { display: none; }
.tp-auto-sun,
.tp-auto-moon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.tp-auto-sun {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffe9a8, #f7b32b 60%, #e8940a);
  box-shadow:
    0 -10px 0 -4.2px rgba(247, 179, 43, .8),
    0 10px 0 -4.2px rgba(247, 179, 43, .8),
    10px 0 0 -4.2px rgba(247, 179, 43, .8),
    -10px 0 0 -4.2px rgba(247, 179, 43, .8),
    7px -7px 0 -4.2px rgba(247, 179, 43, .55),
    -7px 7px 0 -4.2px rgba(247, 179, 43, .55),
    7px 7px 0 -4.2px rgba(247, 179, 43, .55),
    -7px -7px 0 -4.2px rgba(247, 179, 43, .55);
}
.tp-auto-moon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #dbe6f5;
}
.tp-auto-moon::after {
  content: '';
  position: absolute;
  top: -1.5px;
  left: 4.5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #0d1626;
}
.theme-preview-auto .tp-auto-sun { left: 26%; }
.theme-preview-auto .tp-auto-moon { left: 74%; }
.theme-preview-light .tp-auto-moon { display: none; }
.theme-preview-dark .tp-auto-sun { display: none; }
.theme-preview-dark .tp-auto-moon::after { background: #0d1626; }
[data-theme="dark"] .theme-preview-dark { border-color: #2a3b5c; }

/* ---------- 5b. 备份页代码块：手机端路径不超出屏幕 ---------- */
.code-block code {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-all;
  max-width: 100%;
}
.code-block {
  position: relative;
  padding-right: 0;
}
.code-block .copy-btn {
  position: static;
  margin-top: 8px;
}
@media (max-width: 719px) {
  .code-block code { font-size: 11.5px; line-height: 1.7; }
  .code-label { font-size: 12px; }
}

/* ---------- 5c. 概览页：相邻双栏间距修复，防止卡片贴得太近 ---------- */
.grid-two + .grid-two { margin-top: 18px; }
.stat-grid + .grid-two { margin-top: 16px; }
.grid-two + .stat-grid { margin-top: 16px; }
@media (min-width: 600px) {
  .grid-two { gap: 18px; }
}

/* ---------- 5d. 日志导出帮助卡与列表 ---------- */
.log-export-help .card-head { margin-bottom: 6px; }
.log-detail { word-break: break-word; min-width: 140px; }
.filter-bar .sp-btn { min-height: 40px; font-size: 14px; flex: 0 1 auto; }

/* ---------- 5e. 深色主题下自构弹窗细节 ---------- */
[data-theme="dark"] .sp-btn { background: rgba(255, 255, 255, .04); }
[data-theme="dark"] .modal-card-sheet { background: #152034; }

/* =====================================================================
 * V1.0Beta 二期
 * 1) 主题图标：浅灰简约太阳 / 月亮，图标底色与主题背景对应
 * 2) 二级页面右上角只留头像（隐藏消息铃铛）
 * 3) 消息中心：展开区全量标题+正文、单条已读按钮、置顶公告移动端优化
 * 4) 发送类型卡片按钮
 * 5) 弹窗公告
 * ===================================================================== */

/* ---------- 1. 主题切换图标 ---------- */
.theme-preview {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.theme-opt:hover .theme-preview { border-color: var(--accent); }
.theme-opt[aria-pressed="true"] .theme-preview {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.theme-preview-light { background: #eef3f9; }
.theme-preview-dark { background: #16233b; border-color: #22304a; }
.theme-preview-auto {
  background: linear-gradient(90deg, #eef3f9 0 49.7%, #16233b 50% 100%);
}
.tp-svg {
  position: absolute;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #9aa7b8;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tp-svg-moon { fill: #cfd9ea; stroke: none; }
.theme-preview-dark .tp-svg-moon { fill: #e9f0fd; }
.theme-preview-auto .tp-svg-sun { left: calc(25% - 11px); }
.theme-preview-auto .tp-svg-moon { right: calc(25% - 11px); fill: #e9f0fd; stroke: none; }
.theme-preview-light .tp-svg-moon { display: none; }
.theme-preview-dark .tp-svg-sun { display: none; }
[data-theme="dark"] .theme-preview-light .tp-svg-sun { stroke: #8a98ab; }

/* ---------- 2. 二级页面：右上角只留头像 ---------- */
body.is-secondary .topbar-bell { display: none; }

/* 3a. 旧版消息展开区 / 置顶金色底样式已移除，统一并入「2. 消息中心」 */

/* ---------- 4. 发送类型卡片 ---------- */
.send-kind {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.send-kind-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--surface-soft, var(--surface));
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.send-kind-card:hover { border-color: var(--accent); }
.send-kind-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.send-kind-ic {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.send-kind-ic svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.send-kind-ic-ann { background: rgba(43, 123, 228, .12); color: var(--accent-d); }
.send-kind-ic-dir { background: rgba(46, 158, 91, .12); color: #2e9e5b; }
[data-theme="dark"] .send-kind-ic-ann { background: rgba(120, 168, 235, .16); color: #7fb3f5; }
[data-theme="dark"] .send-kind-ic-dir { background: rgba(92, 201, 139, .14); color: #5cc98b; }
.send-kind-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.send-kind-txt strong { font-size: 14px; color: var(--text); }
.send-kind-txt small {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.send-kind-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(.5);
  transition: opacity .15s ease, transform .15s ease;
}
.send-kind-card.active .send-kind-check { opacity: 1; transform: none; }
.ann-options {
  display: grid;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-soft, var(--surface));
}
.checkbox-strong {
  display: block;
  font-size: 14px;
  color: var(--text-1, var(--text-deep));
}
@media (max-width: 479px) {
  .send-kind { grid-template-columns: 1fr; }
}

/* ---------- 5. 弹窗公告（多弹窗进度 + 提醒模式） ---------- */
.popup-modal .modal-mask {
  background: rgba(15, 33, 58, .5);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.modal-card-popup { max-width: 440px; }
.popup-icon {
  background: linear-gradient(135deg, rgba(43, 123, 228, .16), rgba(96, 165, 250, .22));
  color: var(--accent-d);
}
[data-theme="dark"] .popup-icon { color: #7fb3f5; }
.popup-head { align-items: flex-start; }
.popup-head-text { flex: 1 1 auto; min-width: 0; }
.popup-count {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-l);
  color: var(--accent-d);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.popup-progress { display: flex; gap: 5px; margin: 12px 0 0; }
.popup-progress i {
  flex: 1 1 auto;
  height: 4px;
  border-radius: 999px;
  background: rgba(43, 123, 228, .13);
  transition: background-color .24s ease;
}
.popup-progress i.done { background: rgba(43, 123, 228, .4); }
.popup-progress i.on { background: var(--accent); }
.popup-body {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-soft, var(--surface));
  border: 1px solid var(--line-soft);
  max-height: 42vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.popup-body.is-swap { animation: popup-swap .28s cubic-bezier(.22, .9, .3, 1) both; }
@keyframes popup-swap {
  from { opacity: .35; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.popup-title {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  word-break: break-word;
}
.popup-text {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-1, var(--text-deep));
  white-space: pre-wrap;
  word-break: break-word;
}
.popup-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  min-height: 28px;
}
.popup-today,
.popup-skip {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}
.popup-today[hidden], .popup-skip[hidden] { display: none; }
.popup-today {
  margin-right: auto;
  border-color: var(--line);
  color: var(--text-2);
}
.popup-today:hover {
  border-color: var(--accent);
  background: var(--accent-l);
  color: var(--accent-d);
}
.popup-skip { margin-left: auto; }
.popup-skip:hover { color: var(--accent-d); }

/* ---------- 6. 后台：弹窗提醒方式选择 ---------- */
.popup-mode-box {
  margin: -2px 0 4px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-soft, var(--surface));
  animation: popup-mode-in .2s ease both;
}
@keyframes popup-mode-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.popup-mode-label { display: block; font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.popup-mode-opts { display: grid; gap: 8px; }
.popup-mode-opt {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .6);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}
.popup-mode-opt:hover { border-color: var(--accent); }
.popup-mode-opt:has(input:checked) { border-color: var(--accent); background: rgba(43, 123, 228, .07); }
.popup-mode-opt input[type="radio"] { margin: 2px 0 0; accent-color: var(--accent); }
.popup-mode-opt strong { display: block; font-size: 13.5px; color: var(--text); }
.popup-mode-opt small { display: block; font-size: 12px; margin-top: 2px; }

/* ---------- 7. 底部导航：唯一指示块跟手平移，松手吸附 ---------- */
.tabbar {
  transition: transform .24s cubic-bezier(.22, .9, .3, 1), box-shadow .24s ease;
  -webkit-user-drag: none;
}
.tabbar .tab, .tabbar .tab * { -webkit-user-drag: none; }
.tabbar .tab { z-index: 1; background: transparent; }
/* 滑动时只轻微上浮，不再 scale：缩放会让 getBoundingClientRect 的几何
   在进入手势瞬间跳变，指示块会闪一下。 */
.tabbar.is-sliding {
  transform: translateY(-4px);
  box-shadow: 0 22px 46px -14px rgba(21, 62, 110, .5), 0 2px 8px -4px rgba(21, 62, 110, .2);
}
@media (max-width: 879px) {
  .tabbar.is-sliding { transform: translateX(-50%) translateY(-4px); }
}

/* 唯一的指示块：几何（left/top/width/height）由 JS 按当前 tabbar 实测写入，
   位移只用 transform；跟手阶段关掉 transition 做到零延迟。无 JS 时不显示。 */
.tabbar-indicator { display: none; }
html.js .tabbar-indicator {
  display: block;
  position: absolute;
  z-index: 0;
  border-radius: 999px;
  background: rgba(43, 123, 228, .13);
  border: 1px solid rgba(43, 123, 228, .20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px -6px rgba(43, 123, 228, .45);
  transform: translateX(var(--ind-x, 0px));
  transition: transform .3s cubic-bezier(.22, .9, .3, 1), background-color .2s ease;
  pointer-events: none;
  will-change: transform;
}
html.js .tabbar-indicator.is-init { transition: none; }   /* 首次定位不要动画 */
html.js .tabbar.is-sliding .tabbar-indicator {
  transition: none;                                        /* 跟手阶段：实时跟手指 */
  background: rgba(43, 123, 228, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 18px -6px rgba(43, 123, 228, .6);
}
html.js[data-theme="dark"] .tabbar-indicator {
  background: rgba(87, 162, 255, .16);
  border-color: rgba(120, 168, 235, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 4px 12px -6px rgba(0, 0, 0, .55);
}
html.js[data-theme="dark"] .tabbar.is-sliding .tabbar-indicator { background: rgba(87, 162, 255, .28); }

/* ---------- 8. 暗色主题下的消息中心 / 骨架 / 弹窗 ---------- */
[data-theme="dark"] .msg-item.is-unread {
  border-color: rgba(87, 162, 255, .5);
  box-shadow: 0 0 0 1px rgba(87, 162, 255, .24) inset, var(--glass);
}
[data-theme="dark"] .msg-badge--pin,
[data-theme="dark"] .msg-badge--ann { background: rgba(87, 162, 255, .16); color: var(--accent-d); }
[data-theme="dark"] .msg-badge--sys { background: rgba(87, 162, 255, .08); color: var(--text-2); }
[data-theme="dark"] .msg-toggle:hover { background: rgba(87, 162, 255, .12); }
[data-theme="dark"] .msg-op-btn { background: rgba(255, 255, 255, .04); color: var(--text-2); }
[data-theme="dark"] .msg-op-btn--read { background: rgba(87, 162, 255, .12); border-color: rgba(87, 162, 255, .3); color: var(--accent-d); }
[data-theme="dark"] .msg-op-btn--del { background: rgba(255, 139, 128, .1); border-color: rgba(255, 139, 128, .3); color: var(--danger); }
[data-theme="dark"] .msg-op-btn--done { background: rgba(111, 220, 160, .1); border-color: rgba(111, 220, 160, .26); color: var(--ok); }
[data-theme="dark"] .popup-mode-opt { background: rgba(255, 255, 255, .03); }
[data-theme="dark"] .popup-mode-opt:has(input:checked) { background: rgba(87, 162, 255, .1); }
[data-theme="dark"] .user-picker-bar { background: rgba(255, 255, 255, .03); }
[data-theme="dark"] .user-chip { background: rgba(87, 162, 255, .14); border-color: rgba(87, 162, 255, .32); color: var(--accent-d); }
[data-theme="dark"] .user-chip:hover { background: rgba(87, 162, 255, .22); }
[data-theme="dark"] .user-pick-item.is-checked { background: rgba(87, 162, 255, .12); }
[data-theme="dark"] .popup-today { color: var(--text-2); }
[data-theme="dark"] .popup-today:hover { background: rgba(87, 162, 255, .12); color: var(--accent-d); }

@media (prefers-reduced-motion: reduce) {
  .popup-body.is-swap, .popup-mode-box, .page-skeleton { animation: none; }
  .tabbar, .tab, .tabbar-indicator, .msg-item, .msg-dot { transition-duration: .01ms; animation: none; }
}


/* ==========================================================================
   授权流程：登录/注册页内提示 + 登录态授权页无容器版式
   ========================================================================== */

/* 从第三方应用跳过来登录/注册时的页内说明条（不走 toast） */
.auth-intent {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(43, 123, 228, .08);
  border: 1px solid rgba(43, 123, 228, .16);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
  word-break: break-word;
}
.auth-intent svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent-d);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-intent strong { color: var(--accent-d); font-weight: 600; }
[data-theme="dark"] .auth-intent {
  background: rgba(87, 162, 255, .1);
  border-color: rgba(87, 162, 255, .24);
}

/* 登录态授权页：不再套卡片容器，各区块用细分隔线平铺 */
.grant-wrap { padding: 10px 4px 4px; }
.grant-wrap .grant-head { margin-bottom: 22px; }
.grant-scope-plain {
  padding: 0 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.grant-wrap .grant-account {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 12px 0 16px;
  margin-bottom: 16px;
}
.grant-wrap .grant-actions { margin-top: 4px; }
[data-theme="dark"] .grant-wrap .grant-account { background: transparent; border-color: var(--line-soft); }


/* ==========================================================================
   V1.0Beta_111220021 · 接入文档 / 游漫币 / VIP 与 SVIP 会员
   统一使用 :root 变量，浅色 / [data-theme="dark"] 都能自适应
   ========================================================================== */

/* ---------- 1. 会员外显标识 ---------- */
.vip-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .06em;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 2px 6px -2px rgba(31, 88, 143, .35);
}
.vip-badge--vip  { background: linear-gradient(135deg, #e2b459, #ba7d1c); }
.vip-badge--svip { background: linear-gradient(135deg, #8b62f0, #c445b8); }
.vip-badge--lg   { font-size: 12px; padding: 3px 10px; }
.badge-vip  { background: rgba(224, 178, 86, .17);  color: #96660f; }
.badge-svip { background: rgba(139, 98, 240, .15); color: #7540c2; }
[data-theme="dark"] .badge-vip  { background: rgba(226, 180, 89, .18); color: #f0c874; }
[data-theme="dark"] .badge-svip { background: rgba(160, 120, 250, .20); color: #cdb2ff; }
/* 顶栏头像旁的徽章要更小巧，避免把顶栏撑高 */
.topbar-vip { margin-left: 6px; font-size: 9.5px; padding: 0 6px; }

/* ---------- 2. 应用编辑页 · 接入文档卡片 ---------- */
/* 由「接口说明」锚点跳过来时不要被固定顶栏盖住；布局复用 .card */
.doc-card { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.doc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.doc-head .card-title { margin-bottom: 0; }
.doc-head .btn { flex: 0 0 auto; }
.doc-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 14px 0 10px;
  padding: 4px;
  border-radius: 10px;
  background: var(--accent-soft);
}
.doc-tab {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}
.doc-tab.is-on {
  background: var(--surface-solid);
  color: var(--accent-d);
  font-weight: 600;
  box-shadow: 0 2px 8px -3px rgba(31, 88, 143, .28);
}
.doc-meta { margin-left: auto; padding-right: 6px; }
.doc-md {
  margin: 0;
  max-height: 420px;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(43, 123, 228, .045);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}
.doc-preview {
  min-height: 120px;
  max-height: 460px;
  overflow: auto;
  padding: 4px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
}
/* 渲染预览里的 Markdown 元素：作用域收在 .doc-preview 内，不影响全站 */
.doc-preview h1, .doc-preview h2, .doc-preview h3,
.doc-preview h4, .doc-preview h5, .doc-preview h6 {
  margin: 18px 0 8px;
  line-height: 1.4;
  color: var(--text-deep);
  font-weight: 600;
}
.doc-preview > h1:first-child { margin-top: 0; }
.doc-preview h1 { font-size: 19px; }
.doc-preview h2 { font-size: 16px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.doc-preview h3 { font-size: 14.5px; }
.doc-preview h4, .doc-preview h5, .doc-preview h6 { font-size: 13.5px; }
.doc-preview p { margin: 8px 0; }
.doc-preview ul { margin: 8px 0; padding-left: 22px; }
.doc-preview li { margin: 3px 0; }
.doc-preview blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  color: var(--text-2);
}
.doc-preview blockquote p { margin: 0; }
.doc-preview hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.doc-preview a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.doc-preview strong { color: var(--text-deep); font-weight: 600; }
.doc-preview code {
  font-family: var(--mono);
  font-size: .9em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-d);
}
.md-code {
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(43, 123, 228, .05);
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
  white-space: pre;
}
.md-code code { padding: 0; background: none; color: inherit; font-size: inherit; }
.md-table-wrap { margin: 12px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.md-table { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--text); }
.md-table th, .md-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}
.md-table th { background: var(--accent-soft); color: var(--text-deep); font-weight: 600; white-space: nowrap; }
.md-table tbody tr:last-child td { border-bottom: 0; }
.md-table code { white-space: nowrap; }
[data-theme="dark"] .doc-md,
[data-theme="dark"] .md-code { background: rgba(87, 162, 255, .07); border-color: var(--line); }
[data-theme="dark"] .doc-tab.is-on { background: #1e2f49; color: var(--accent-d); }
[data-theme="dark"] .md-table th { background: rgba(87, 162, 255, .1); }
[data-theme="dark"] .doc-preview code { background: rgba(87, 162, 255, .12); }

/* ---------- 3. 会员中心 · 顶部身份 / 余额 ---------- */
.vip-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 14px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(43, 123, 228, .16) 0%, rgba(43, 123, 228, 0) 60%),
    linear-gradient(150deg, #f0f6ff, #ffffff);
  box-shadow: var(--glass);
}
.vip-hero[data-vip-level="vip"] {
  border-color: rgba(226, 180, 89, .38);
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(226, 180, 89, .26) 0%, rgba(226, 180, 89, 0) 62%),
    linear-gradient(150deg, #fff8e9, #ffffff);
}
.vip-hero[data-vip-level="svip"] {
  border-color: rgba(139, 98, 240, .3);
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(160, 110, 240, .24) 0%, rgba(160, 110, 240, 0) 62%),
    linear-gradient(150deg, #f7f1ff, #ffffff);
}
.vip-hero-main, .vip-hero-balance { position: relative; z-index: 1; }
.vip-hero-label {
  display: block;
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 4px;
}
.vip-hero-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-deep);
  letter-spacing: -.01em;
}
.vip-hero-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--text-2); }
.vip-hero-balance {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .92);
  box-shadow: 0 6px 20px -12px rgba(31, 88, 143, .4);
}
.vip-hero-ymb {
  display: block;
  margin: 2px 0 3px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-deep);
  font-variant-numeric: tabular-nums;
}
.vip-hero-ymb small { font-size: 14px; font-weight: 500; color: var(--text-3); }
.vip-hero-hint { display: block; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
[data-theme="dark"] .vip-hero {
  background: radial-gradient(110% 120% at 100% 0%, rgba(87, 162, 255, .16) 0%, rgba(87, 162, 255, 0) 60%),
              linear-gradient(150deg, #16233a, #101a2c);
}
[data-theme="dark"] .vip-hero[data-vip-level="vip"] {
  background: radial-gradient(110% 120% at 100% 0%, rgba(226, 180, 89, .2) 0%, rgba(226, 180, 89, 0) 62%),
              linear-gradient(150deg, #2a2314, #121a2a);
}
[data-theme="dark"] .vip-hero[data-vip-level="svip"] {
  background: radial-gradient(110% 120% at 100% 0%, rgba(160, 110, 240, .22) 0%, rgba(160, 110, 240, 0) 62%),
              linear-gradient(150deg, #251b3c, #121a2a);
}
[data-theme="dark"] .vip-hero-balance { background: rgba(23, 36, 56, .7); border-color: var(--line); }

/* ---------- 4. 权益对照表 ---------- */
.vip-rights-table .strong-cell { font-weight: 600; color: var(--text-deep); white-space: nowrap; }
.vip-rights-table th.col-vip, .vip-rights-table td.col-vip {
  color: #96660f;
  background: rgba(226, 180, 89, .08);
}
.vip-rights-table th.col-svip, .vip-rights-table td.col-svip {
  color: #7540c2;
  background: rgba(139, 98, 240, .07);
}
[data-theme="dark"] .vip-rights-table th.col-vip,
[data-theme="dark"] .vip-rights-table td.col-vip { color: #f0c874; background: rgba(226, 180, 89, .09); }
[data-theme="dark"] .vip-rights-table th.col-svip,
[data-theme="dark"] .vip-rights-table td.col-svip { color: #cdb2ff; background: rgba(139, 98, 240, .11); }

/* ---------- 5. 套餐卡片 ---------- */
.vip-plan-card.vip-plan-svip { border-color: rgba(139, 98, 240, .22); }
.vip-plan-card.vip-plan-vip  { border-color: rgba(226, 180, 89, .26); }
.vip-plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vip-plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.vip-plan.is-closed { opacity: .68; }
.vip-plan-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.vip-plan-name { font-weight: 600; font-size: 14px; color: var(--text-deep); }
.vip-plan-days { font-size: 11px; color: var(--text-3); }
.vip-plan-price { font-size: 12px; color: var(--text-3); }
.vip-plan-price strong {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-deep);
  font-variant-numeric: tabular-nums;
}
.vip-plan form { margin-top: auto; }
.vip-plan-tip { display: block; font-size: 11px; color: var(--text-3); text-align: center; }

/* ---------- 6. 补签卡与游漫币流水 ---------- */
.vip-makeup-list { display: grid; gap: 8px; }
.vip-makeup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--accent-soft);
}
.vip-makeup-date { font-family: var(--mono); font-size: 13px; color: var(--text-deep); }
.vip-makeup-gain { flex: 1 1 auto; font-size: 12px; color: var(--text-2); }
.ymb-plus  { color: var(--ok); }
.ymb-minus { color: var(--danger); }
[data-theme="dark"] .vip-makeup-row { border-color: var(--line); }

/* ---------- 7. 个人中心会员入口 ---------- */
a.vip-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-color: rgba(226, 180, 89, .32);
  background: linear-gradient(120deg, rgba(226, 180, 89, .12), var(--surface));
  transition: transform .2s ease, box-shadow .2s ease;
}
a.vip-entry.is-svip {
  border-color: rgba(139, 98, 240, .32);
  background: linear-gradient(120deg, rgba(139, 98, 240, .12), var(--surface));
}
a.vip-entry:hover { transform: translateY(-2px); box-shadow: var(--glass); }
.vip-entry-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #b8861d;
  background: rgba(226, 180, 89, .18);
}
.is-svip .vip-entry-icon { color: #7540c2; background: rgba(139, 98, 240, .16); }
.vip-entry-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vip-entry-main { flex: 1 1 auto; min-width: 0; }
.vip-entry-main strong { display: block; font-size: 14.5px; color: var(--text-deep); }
.vip-entry-main small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12px; }
.vip-entry-ymb {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 17px;
  color: var(--text-deep);
  font-variant-numeric: tabular-nums;
}
.vip-entry-ymb small { font-size: 11px; font-weight: 500; color: var(--text-3); }
[data-theme="dark"] .vip-entry-icon { color: #f0c874; }

/* ---------- 8. 首页欢迎区 Ymb 余额 ---------- */
.welcome-stats a.welcome-stat-link { text-align: center; color: inherit; text-decoration: none; }
.welcome-stat-link:hover .ymb-num { text-decoration: underline; text-underline-offset: 3px; }
.welcome-stats .ymb-num { color: #ffe6a8; }

/* ---------- 9. 后台会员管理 ---------- */
.vip-global-switch {
  margin: 4px 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 13.5px;
  font-weight: 500;
}
.vip-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #96660f;
}
.vip-group-title::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: #d9a441; }
.vip-group-title.is-svip { color: #7540c2; }
.vip-group-title.is-svip::before { background: #8b62f0; }
.vip-admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vip-admin-plan {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.vip-admin-plan-head strong { display: block; font-size: 14px; color: var(--text-deep); }
.vip-admin-plan-head small { display: block; font-size: 11.5px; margin-top: 2px; }
.vip-admin-plan .field, .vip-admin-plan .checkbox { margin-bottom: 0; }
[data-theme="dark"] .vip-group-title { color: #f0c874; }
[data-theme="dark"] .vip-group-title.is-svip { color: #cdb2ff; }

/* ---------- 10. 响应式 ---------- */
@media (min-width: 720px) {
  .vip-hero { grid-template-columns: 1.2fr 1fr; align-items: center; }
}
@media (max-width: 599px) {
  .vip-plan-grid, .vip-admin-grid { grid-template-columns: 1fr; }
  .vip-hero-ymb { font-size: 24px; }
  .vip-entry-ymb { font-size: 14px; }
  .doc-md { max-height: 320px; font-size: 11.5px; }
  .doc-preview { max-height: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  .vip-entry, .doc-tab { transition: none; }
}

/* ==========================================================================
   会员二期：手机端响应式表格 + 会员服务协议
   手机上「权益对照 / 协议权益 / 后台会员用户」三张表不再强制 620px 横向滚动，
   改为一行一张卡片，列名用 data-label 显示在左侧，内容完整可见、无需横滑。
   ========================================================================== */

/* ---------- 11. 手机端卡片式表格 ---------- */
@media (max-width: 719px) {
  /* 覆盖全局「.table-scroll .table { min-width:620px }」，手机端不再撑宽 */
  .table-scroll > .table.table-responsive { min-width: 0; width: 100%; }
  .table.table-responsive thead { display: none; }
  .table.table-responsive,
  .table.table-responsive tbody,
  .table.table-responsive tr,
  .table.table-responsive td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .table.table-responsive tr {
    margin-bottom: 10px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
  }
  .table.table-responsive tbody tr:last-child { border-bottom: 1px solid var(--line); }
  .table.table-responsive td,
  .table.table-responsive tbody tr:last-child td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 38px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line-soft);
    text-align: right;
    font-size: 13px;
    vertical-align: middle;
    white-space: normal;
  }
  .table.table-responsive td:last-child { border-bottom: 0; }
  .table.table-responsive td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--text-3);
    font-size: 11.5px;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
  }
  /* 第一列（权益名 / 用户名）作为卡片标题独占一行 */
  .table.table-responsive td.ag-item,
  .table.table-responsive td.strong-cell {
    display: block;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--accent-soft);
    color: var(--text-deep);
    font-size: 14px;
    font-weight: 600;
    white-space: normal;
  }
  .table.table-responsive td.ag-item::before,
  .table.table-responsive td.strong-cell::before { display: none; }
  .table.table-responsive td.ag-item .user-cell-text { min-width: 0; }
  .table.table-responsive td.ag-item .user-cell-text small { font-weight: 400; }
  /* 卡片模式下 VIP/SVIP 高亮改为只着色文字，避免整行铺色过花 */
  .vip-rights-table.table-responsive td.col-vip,
  .vip-rights-table.table-responsive td.col-svip,
  .ag-table.table-responsive td.col-vip,
  .ag-table.table-responsive td.col-svip { background: transparent; }
  /* 操作按钮列 */
  .table.table-responsive td.ta-right .btn { flex: 0 0 auto; }
}
/* 600–719px（小平板 / 折叠屏）单独一段：三列改两列，避免价格数字被挤。
   用 min-width 限定，确保不会覆盖 599px 以下的单列规则。 */
@media (min-width: 600px) and (max-width: 719px) {
  .vip-plan-grid, .vip-admin-grid { grid-template-columns: repeat(2, 1fr); }
  .vip-hero { gap: 12px; padding: 16px; }
  .doc-head { gap: 8px; }
}
[data-theme="dark"] .table.table-responsive td.ag-item,
[data-theme="dark"] .table.table-responsive td.strong-cell {
  background: rgba(87, 162, 255, .1);
  border-color: var(--line);
}

/* ---------- 12. 会员服务协议页 ---------- */
.ag-card { padding: 20px; }
.ag-lead {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.8;
}
.ag-section { margin: 22px 0 0; }
.ag-section:first-of-type { margin-top: 4px; }
.ag-title {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-deep);
}
.ag-text { margin: 0 0 12px; font-size: 13.5px; line-height: 1.8; color: var(--text-2); }
.ag-list { margin: 0; padding-left: 22px; }
.ag-list li {
  margin: 8px 0;
  padding-left: 2px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-2);
}
.ag-list li::marker { color: var(--accent-d); font-weight: 600; }
.ag-list strong { color: var(--text-deep); font-weight: 600; }
.ag-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-2);
}
.ag-table { margin-top: 4px; }
.ag-table .ag-item { font-weight: 600; color: var(--text-deep); white-space: nowrap; }
.ag-table th.col-vip, .ag-table td.col-vip { color: #96660f; background: rgba(226, 180, 89, .08); }
.ag-table th.col-svip, .ag-table td.col-svip { color: #7540c2; background: rgba(139, 98, 240, .07); }
.ag-agree {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 16px;
  padding: 14px;
  border: 1px solid rgba(226, 180, 89, .4);
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(226, 180, 89, .14), rgba(139, 98, 240, .1));
  font-size: 15px;
  color: var(--text-deep);
  text-align: center;
}
.ag-agree svg {
  width: 20px; height: 20px; flex: 0 0 auto;
  fill: none; stroke: #b8861d; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.ag-back { margin-top: 4px; }
.ag-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.ag-tip svg {
  width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px;
  fill: none; stroke: var(--accent-d); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.ag-tip a { color: var(--accent-d); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ag-tip strong { color: var(--text-deep); }
[data-theme="dark"] .ag-table th.col-vip,
[data-theme="dark"] .ag-table td.col-vip { color: #f0c874; background: rgba(226, 180, 89, .09); }
[data-theme="dark"] .ag-table th.col-svip,
[data-theme="dark"] .ag-table td.col-svip { color: #cdb2ff; background: rgba(139, 98, 240, .11); }
[data-theme="dark"] .ag-agree svg { stroke: #f0c874; }

@media (max-width: 599px) {
  .ag-card { padding: 15px 14px; }
  .ag-lead, .ag-text, .ag-list li { font-size: 13px; }
  .ag-title { font-size: 14.5px; }
  .ag-agree { font-size: 14px; padding: 12px; }
}

/* ==========================================================================
   v11：皇冠会员标识 / 顶栏等级 / 横滑权益对比 / 卡密 / 游漫币管理 / 购买 UI
   ========================================================================== */

/* ---------- 1. 皇冠会员标识（VIP 金 / SVIP 紫） ---------- */
.vip-crown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
}
.vip-crown svg { width: 1em; height: 1em; display: block; fill: currentColor; }
.vip-crown--vip  { color: #d9a441; filter: drop-shadow(0 1px 3px rgba(217, 164, 65, .45)); }
.vip-crown--svip { color: #9066ec; filter: drop-shadow(0 1px 3px rgba(144, 102, 236, .45)); }

/* 徽章内的皇冠小图标：白色描边压在渐变底上 */
.vip-badge { gap: 3px; }
.vip-badge svg { width: 12px; height: 12px; fill: #fff; flex: 0 0 auto; }
.vip-badge--lg svg { width: 14px; height: 14px; }
.vip-badge-text { display: inline; }

/* 各场景尺寸 */
.crown-hero { font-size: 26px; }
.crown-col  { font-size: 20px; }
.crown-plan { font-size: 17px; margin-right: 2px; }
.crown-xs   { font-size: 14px; margin-right: 2px; }

/* 顶栏：皇冠（左上）与等级（下缘）都盖在头像上，不额外占位、不另起一行 */
.topbar-id {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.topbar-id .topbar-avatar { width: 34px; height: 34px; overflow: visible; }
.topbar-crown {
  position: absolute;
  top: -6px;
  left: -8px;                 /* 会员标志由右侧改到左侧 */
  font-size: 15px;
  z-index: 4;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .28)) drop-shadow(0 0 1px rgba(255, 255, 255, .9));
}
.topbar-crown.vip-crown--vip  { color: #e6b34e; }
.topbar-crown.vip-crown--svip { color: #a074f5; }
/* 暗色下等级标仍用蓝渐变，只把白边压柔一点 */
[data-theme="dark"] .topbar-id .topbar-level { border-color: rgba(255, 255, 255, .55); }

/* ---------- 2. 会员中心 hero 增强 ---------- */
.vip-hero-name .crown-hero { margin-right: 2px; }
.vip-hero-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.vip-hero-lv {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2b7be4, #1f588f);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 3px 10px -4px rgba(31, 88, 143, .8);
}

/* ---------- 3. 横向滑动长条权益对比 ---------- */
.vip-rights-card { overflow: hidden; }
.rights-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-d);
  background: var(--accent-soft);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: opacity .2s ease;
}
.rights-hint svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: rightsNudge 1.4s ease-in-out infinite; }
.rights-hint.is-done { opacity: .4; }
.rights-hint.is-done svg { animation: none; }
@keyframes rightsNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }

.rights-viewport { position: relative; }
.rights-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.rights-rail::-webkit-scrollbar { display: none; }
.rights-fade {
  position: absolute;
  top: 0; right: 0; bottom: 12px;
  width: 46px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--surface-solid));
  transition: opacity .25s ease;
}
[data-theme="dark"] .rights-fade { background: linear-gradient(90deg, rgba(20, 30, 48, 0), #16233a); }

.rights-col {
  flex: 0 0 min(74%, 258px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
}
.rights-col--vip  { border-color: rgba(226, 180, 89, .38); background: linear-gradient(170deg, #fff9ee, var(--surface-solid) 60%); }
.rights-col--svip { border-color: rgba(139, 98, 240, .32); background: linear-gradient(170deg, #f8f3ff, var(--surface-solid) 60%); }
.rights-col.is-current { box-shadow: 0 0 0 2px var(--accent) inset; }
.rights-col-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.rights-col-name { font-size: 15px; font-weight: 700; color: var(--text-deep); }
.rights-col--vip .rights-col-name  { color: #96660f; }
.rights-col--svip .rights-col-name { color: #7540c2; }
.rights-current-tag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 1px 8px;
}
.rights-col-list { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.rights-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.rights-item:last-child { border-bottom: 0; }
.rights-item-icon {
  grid-row: 1 / 3;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
}
.rights-item-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rights-item-name { grid-column: 2; font-size: 11.5px; color: var(--text-3); }
.rights-item-val  { grid-column: 2; font-size: 13px; font-weight: 700; color: var(--text-deep); }
.rights-col--vip .rights-item-val  { color: #96660f; }
.rights-col--svip .rights-item-val { color: #7540c2; }
.rights-col-cta { margin-top: 10px; }
.rights-col-free { margin-top: 10px; text-align: center; font-size: 11.5px; color: var(--text-3); }
.rights-dots { display: flex; justify-content: center; gap: 6px; margin-top: 2px; }
.rights-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line); cursor: pointer; transition: width .2s ease, background .2s ease;
}
.rights-dots i.on { width: 18px; border-radius: 4px; background: var(--accent); }
[data-theme="dark"] .rights-col--vip  { background: linear-gradient(170deg, #2a2314, #16233a 65%); }
[data-theme="dark"] .rights-col--svip { background: linear-gradient(170deg, #251b3c, #16233a 65%); }
[data-theme="dark"] .rights-col--vip .rights-col-name,
[data-theme="dark"] .rights-col--vip .rights-item-val  { color: #f0c874; }
[data-theme="dark"] .rights-col--svip .rights-col-name,
[data-theme="dark"] .rights-col--svip .rights-item-val { color: #cdb2ff; }

/* 桌面：三列平铺，不再需要滑动 */
@media (min-width: 720px) {
  .rights-rail { overflow: visible; gap: 14px; }
  .rights-col { flex: 1 1 0; min-width: 0; }
  .rights-fade { display: none; }
  .rights-dots { display: none; }
}

/* ---------- 4. 卡密兑换卡片 ---------- */
.redeem-title-icon { width: 17px; height: 17px; fill: none; stroke: var(--accent-d); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; margin-right: 4px; }
.redeem-form { display: flex; gap: 10px; flex-wrap: wrap; }
.redeem-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-solid);
  color: var(--text-deep);
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.redeem-input::placeholder { color: var(--text-3); letter-spacing: 0; text-transform: none; }
.redeem-form .btn { flex: 0 0 auto; }

/* ---------- 5. 购买套餐卡优化 ---------- */
.vip-plan { position: relative; }
.vip-plan.is-recommend { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--glass); }
.vip-plan-badge {
  position: absolute;
  top: -9px; right: 10px;
  font-size: 10px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2b7be4, #1f588f);
  border-radius: 999px;
  padding: 2px 9px;
  box-shadow: 0 3px 8px -3px rgba(31, 88, 143, .7);
}
.vip-plan-perk { display: block; font-size: 11px; color: var(--text-3); margin: 2px 0 10px; }
.vip-plan-card .card-title { display: flex; align-items: center; }

/* ---------- 6. 管理端表单栅格（卡密生成 / 游漫币 / 用户详情资产） ---------- */
.card-form-grid, .ymb-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.ymb-form-grid { grid-template-columns: repeat(3, 1fr); }
.card-form-grid .field, .ymb-form-grid .field { margin-bottom: 13px; }
.asset-form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.asset-form-row .field { flex: 1 1 150px; margin-bottom: 0; }
.asset-form-row .btn { flex: 0 0 auto; }
.card-code { font-size: 12.5px; color: var(--accent-d); white-space: nowrap; cursor: pointer; }
.card-code:hover { text-decoration: underline; text-underline-offset: 2px; }
.inline-form { display: inline; }
.inline-form .btn { margin-left: 4px; }

/* 暗色：表单内控件沿用全局 input 样式，这里只补边框对比 */
[data-theme="dark"] .rights-col,
[data-theme="dark"] .redeem-input { border-color: var(--line); }

/* ---------- 7. 移动端适配 ---------- */
@media (max-width: 719px) {
  .card-form-grid, .ymb-form-grid { grid-template-columns: 1fr; gap: 0; }
  .rights-col { flex-basis: min(80%, 260px); }
  .redeem-form .btn { flex: 1 1 100%; }
  .asset-form-row .btn { flex: 1 1 100%; }
  /* 资产表单在手机端改单列：datetime-local 等原生控件有固有最小宽度，
     两列时每列仅约 160px，会把「到期时间」的时间部分裁掉，单列可完整显示。 */
  .asset-form-row .field { flex: 1 1 100%; }
}
@media (min-width: 600px) and (max-width: 719px) {
  .card-form-grid, .ymb-form-grid { grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
  .ymb-form-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 修复：600–879px 时 grid-two 变双列、右列偏窄，
   封禁表单 .field-row 的两列 datetime-local 有固有最小宽度会撑破容器，
   这个区间让 field-row 退回单列（>=880px 右列够宽再恢复两列）。 */
@media (min-width: 600px) and (max-width: 879px) {
  .field-row { grid-template-columns: minmax(0, 1fr); }
}
/* 所有表单控件在 flex/grid 单元里允许收缩，避免 datetime-local 等原生 input 的
   固有最小宽度把 1fr 轨道的下限撑破（minmax(0,1fr) + min-width:0）。 */
.field-row .field,
.asset-form-row .field,
.card-form-grid .field,
.ymb-form-grid .field,
.redeem-form .redeem-input { min-width: 0; }
.field input, .field select { max-width: 100%; min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  .rights-hint svg { animation: none; }
  .rights-col, .rights-rail { scroll-behavior: auto; }
}


/* ==========================================================================
   v12：顶栏标识叠加 / 底栏跟手指示块 / 消息中心（邮箱）UI 与动画
   ========================================================================== */

/* ---------- 1. 消息中心：收件箱概览条 ---------- */
.inbox-overview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  margin-bottom: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(43, 123, 228, .10), rgba(255, 255, 255, .5) 62%);
  box-shadow: var(--glass);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  animation: inbox-overview-in .46s cubic-bezier(.22, .9, .3, 1) backwards;
}
@keyframes inbox-overview-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
.inbox-overview-icon {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(43, 123, 228, .14);
  color: var(--accent-d);
}
.inbox-overview-icon svg,
.inbox-empty-icon svg {
  fill: none; stroke: currentColor;
  stroke-linecap: round; stroke-linejoin: round;
}
.inbox-overview-icon svg { width: 21px; height: 21px; stroke-width: 1.7; }
.inbox-overview-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inbox-overview-text strong { font-size: 14.5px; color: var(--text); }
.inbox-overview-meta { font-size: 12px; color: var(--text-3); }
.inbox-unread-pill {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 12px -6px rgba(43, 123, 228, .8);
  transition: background-color .2s ease, color .2s ease;
}
.inbox-unread-pill.is-clear { background: rgba(43, 123, 228, .10); color: var(--accent-d); box-shadow: none; }
.inbox-readall { flex: 0 0 auto; margin: 0; }
.inbox-readall[hidden] { display: none; }
.inbox-readall .btn { gap: 5px; white-space: nowrap; }
.inbox-readall .btn svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* 二级页（消息中心）手机端隐藏大标题，只留概览条，避免与顶栏重复 */
@media (max-width: 879px) {
  body.is-secondary .inbox-head { display: none; }
}
@media (max-width: 479px) {
  .inbox-overview { flex-wrap: wrap; gap: 9px 10px; }
  .inbox-overview-text { flex: 1 1 calc(100% - 50px); }
  .inbox-unread-pill { order: 3; }
  .inbox-readall { order: 4; margin-left: auto; }
}

/* ---------- 2. 消息中心：空态 ---------- */
.inbox-empty .empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 34px 20px 38px;
}
.inbox-empty .empty-state p { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--text); }
.inbox-empty .empty-state small { max-width: 340px; line-height: 1.7; }
.inbox-empty-icon {
  display: grid; place-items: center;
  width: 62px; height: 62px;
  margin-bottom: 14px;
  border-radius: 20px;
  background: rgba(43, 123, 228, .10);
  color: var(--accent-d);
  animation: inbox-empty-float 3.6s ease-in-out infinite;
}
.inbox-empty-icon svg { width: 30px; height: 30px; stroke-width: 1.5; }
@keyframes inbox-empty-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* ---------- 3. 消息中心：卡片层次与入场动画 ---------- */
.msg-list > .msg-item { animation: msg-item-in .44s cubic-bezier(.22, .9, .3, 1) backwards; }
@keyframes msg-item-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
/* 用 backwards 而非 both：动画结束后不锁死 transform，删除时的 is-removing 才能生效 */
.msg-list > .msg-item:nth-child(1) { animation-delay: .03s; }
.msg-list > .msg-item:nth-child(2) { animation-delay: .07s; }
.msg-list > .msg-item:nth-child(3) { animation-delay: .11s; }
.msg-list > .msg-item:nth-child(4) { animation-delay: .15s; }
.msg-list > .msg-item:nth-child(5) { animation-delay: .19s; }
.msg-list > .msg-item:nth-child(6) { animation-delay: .23s; }
.msg-list > .msg-item:nth-child(7) { animation-delay: .27s; }
.msg-list > .msg-item:nth-child(n+8) { animation-delay: .31s; }

/* 未读：左侧渐变竖条 + 呼吸圆点 */
.msg-item.is-unread::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #5aa2f5, #2b7be4);
  pointer-events: none;
}
.msg-item.is-unread .msg-dot:not([hidden]) { animation: msg-dot-pulse 2.4s ease-in-out infinite; }
@keyframes msg-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(43, 123, 228, .13); transform: scale(1); }
  50%      { box-shadow: 0 0 0 6px rgba(43, 123, 228, .06); transform: scale(1.14); }
}
@media (hover: hover) {
  .msg-item:hover {
    border-color: rgba(43, 123, 228, .42);
    box-shadow: 0 14px 30px -20px rgba(31, 88, 143, .7), var(--glass);
    transform: translateY(-2px);
  }
}
/* 展开态：标题左侧装饰线 + 操作区错峰淡入 */
.msg-item.is-open .msg-full-title { position: relative; padding-left: 22px; }
.msg-item.is-open .msg-full-title::before {
  content: '';
  position: absolute;
  left: 14px; top: 17px; bottom: 3px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #5aa2f5, rgba(43, 123, 228, .15));
}
.msg-item.is-open .msg-panel-inner > .msg-full-text { animation-delay: .07s; }
.msg-item.is-open .msg-ops,
.msg-item.is-open .msg-panel-foot { animation: msg-fade-in .34s ease .1s backwards; }
@keyframes msg-fade-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}
.msg-toggle--expand:hover svg { transform: translateY(3px) rotate(4deg); }
.msg-toggle--collapse:hover svg { transform: translateY(-3px) rotate(-4deg); }

/* ---------- 4. 暗色主题 ---------- */
[data-theme="dark"] .inbox-overview {
  background: linear-gradient(120deg, rgba(87, 162, 255, .14), rgba(22, 34, 54, .35) 62%);
  border-color: rgba(120, 168, 235, .2);
}
[data-theme="dark"] .inbox-overview-icon,
[data-theme="dark"] .inbox-empty-icon { background: rgba(87, 162, 255, .13); color: #8fc0ff; }
[data-theme="dark"] .inbox-unread-pill.is-clear { background: rgba(87, 162, 255, .14); color: #8fc0ff; }
[data-theme="dark"] .msg-item.is-unread::before { background: linear-gradient(180deg, #8fc0ff, #3d7fd0); }
[data-theme="dark"] .msg-item.is-open .msg-full-title::before {
  background: linear-gradient(180deg, #8fc0ff, rgba(87, 162, 255, .12));
}

/* ---------- 5. 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .inbox-overview, .msg-list > .msg-item, .msg-dot,
  .inbox-empty-icon, .msg-item.is-open .msg-ops, .msg-item.is-open .msg-panel-foot,
  .msg-full-title, .msg-panel-inner > .msg-full-text { animation: none !important; }
}

