/* =========================================================
   阅迹 · ReadTrace — design system
   ========================================================= */

:root {
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme="dark"] {
  --bg: #070a0f;
  --bg-2: #0b0f16;
  --surface: #101722;
  --surface-2: #151d29;
  --surface-3: #1b2532;
  --line: rgba(150, 172, 201, .10);
  --line-strong: rgba(150, 172, 201, .18);
  --text: #e9eff7;
  --text-2: #a7b4c6;
  --muted: #6c7b8f;
  --accent: #3ddc97;
  --accent-2: #7df0bd;
  --accent-soft: rgba(61, 220, 151, .12);
  --accent-ink: #04231a;
  --blue: #7aa2f7;
  --blue-soft: rgba(122, 162, 247, .12);
  --amber: #f5b942;
  --amber-soft: rgba(245, 185, 66, .12);
  --red: #ff7a7a;
  --red-soft: rgba(255, 122, 122, .12);
  --purple: #c7a2ff;
  --purple-soft: rgba(199, 162, 255, .12);
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, .8);
  --shadow-sm: 0 10px 30px -18px rgba(0, 0, 0, .8);
  --glass: rgba(255, 255, 255, .025);
  --console-bg: #060910;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f5f3ee;
  --bg-2: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f8f6f1;
  --surface-3: #f0ede6;
  --line: rgba(35, 42, 52, .09);
  --line-strong: rgba(35, 42, 52, .16);
  --text: #1b222b;
  --text-2: #55606f;
  --muted: #8a94a3;
  --accent: #0e9f6e;
  --accent-2: #14b37d;
  --accent-soft: rgba(14, 159, 110, .10);
  --accent-ink: #ffffff;
  --blue: #3b6fe0;
  --blue-soft: rgba(59, 111, 224, .09);
  --amber: #b7791f;
  --amber-soft: rgba(183, 121, 31, .10);
  --red: #d64545;
  --red-soft: rgba(214, 69, 69, .09);
  --purple: #7c5cd6;
  --purple-soft: rgba(124, 92, 214, .09);
  --shadow: 0 30px 60px -34px rgba(30, 40, 60, .30);
  --shadow-sm: 0 10px 26px -20px rgba(30, 40, 60, .35);
  --glass: rgba(255, 255, 255, .65);
  --console-bg: #12161d;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(61, 220, 151, .07), transparent 60%),
    radial-gradient(800px 520px at 100% 0%, rgba(122, 162, 247, .06), transparent 55%),
    radial-gradient(700px 700px at 60% 110%, rgba(199, 162, 255, .045), transparent 60%);
  z-index: 0;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(14, 159, 110, .07), transparent 60%),
    radial-gradient(800px 520px at 100% 0%, rgba(59, 111, 224, .05), transparent 55%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }

::selection { background: var(--accent-soft); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell ---------- */

.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), transparent 55%);
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; }

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--accent-2), var(--accent) 55%, #1c9c74);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px -10px rgba(61, 220, 151, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand-mark svg { width: 22px; height: 22px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 750; font-size: 16px; letter-spacing: .2px; }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; margin-top: 3px; }

.nav-section { padding: 16px 12px 6px; font-size: 10px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 11px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .18s var(--ease), color .18s, border-color .18s;
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, var(--accent-soft), transparent 85%); color: var(--text); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.nav-item .nav-count {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1px 7px;
}

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 14px; }

.conn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--muted);
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.conn.online .dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: breathe 2.4s infinite; }
.conn.offline .dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

.sidebar-actions { display: flex; gap: 6px; }
.side-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 9px;
  font-size: 11.5px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: .16s;
}
.side-btn:hover { background: var(--surface); color: var(--text); }
.side-btn svg { width: 14px; height: 14px; }

.main {
  margin-left: 238px;
  width: calc(100% - 238px);
  padding: 30px 40px 70px;
  min-height: 100vh;
}
.page-inner { max-width: 1220px; margin: 0 auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  animation: rise .45s var(--ease) both;
}
.topbar-main {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.page-title { font-size: 20px; font-weight: 720; letter-spacing: -.02em; line-height: 1.25; }
.page-sub { color: var(--muted); font-size: 12.5px; min-width: 0; }
.top-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.mobile-nav { display: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .16s var(--ease), border-color .16s, background .16s, box-shadow .16s, opacity .16s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); border-color: var(--line-strong); background: var(--surface-3); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 70%);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 10px 26px -12px rgba(61, 220, 151, .6);
}
.btn-primary:hover { background: linear-gradient(135deg, #8cf6c8, var(--accent) 70%); border-color: transparent; }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }

.btn-danger { color: var(--red); border-color: rgba(255, 122, 122, .28); background: var(--red-soft); }
.btn-danger:hover { background: rgba(255, 122, 122, .16); border-color: rgba(255, 122, 122, .4); }

.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-icon.btn-sm { width: 34px; height: 34px; }

.btn.loading { pointer-events: none; opacity: .75; position: relative; color: transparent !important; }
.btn.loading::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  color: var(--accent-ink);
  animation: spin .7s linear infinite;
}
.btn-ghost.loading::after, .btn:not(.btn-primary).loading::after { color: var(--text); }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.label { font-size: 12px; font-weight: 620; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; }
.label .opt { font-weight: 500; color: var(--muted); font-size: 10.5px; }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m5.5 9 6.5 7 6.5-7'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 11px 11px;
  padding-right: 32px;
  cursor: pointer;
  line-height: 1.4;
  min-height: 40px;
  font-size: 13px;
}
.select:hover { border-color: var(--line-strong); background-color: var(--surface-2); }
.select:disabled { opacity: .5; cursor: not-allowed; }
.select option, .select optgroup {
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
}
.select:focus { background-color: var(--surface); }
.textarea { min-height: 120px; resize: vertical; font-family: var(--mono); font-size: 12px; line-height: 1.6; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.hint code { font-family: var(--mono); font-size: 11px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; color: var(--text-2); }
.row { display: flex; gap: 12px; align-items: center; }
.row > * { min-width: 0; }
.row .grow { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  transition: .2s;
  cursor: pointer;
}
.switch i::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  background: var(--text-2);
  transition: .2s var(--ease);
}
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { left: 18px; background: var(--accent-ink); }
/* 扩大开关的触控命中区（≤44px 都太小，用透明 input 覆盖更大的点击区域） */
.switch input { opacity: 0; position: absolute; inset: -10px; width: 58px; height: 42px; cursor: pointer; }

/* ---------- badges / pills ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 680;
  letter-spacing: .02em;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
}
.badge svg { width: 11px; height: 11px; }
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.run { background: var(--blue-soft); color: var(--blue); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.err { background: var(--red-soft); color: var(--red); }
.badge.neutral { background: var(--surface-3); color: var(--muted); }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: breathe 1.8s infinite; }

/* ---------- cards / stats ---------- */

.card {
  background:
    linear-gradient(180deg, var(--glass), transparent 42%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.card-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 15px; height: 15px; color: var(--muted); }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  padding: 18px 19px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--glass), transparent 60%), var(--surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
  overflow: hidden;
  animation: rise .5s var(--ease) both;
}
.stat:nth-child(2) { animation-delay: .04s; }
.stat:nth-child(3) { animation-delay: .08s; }
.stat:nth-child(4) { animation-delay: .12s; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 620; letter-spacing: .03em; }
.stat-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.stat-ico svg { width: 14px; height: 14px; }
.stat-ico.accent { background: var(--accent-soft); color: var(--accent); }
.stat-ico.blue { background: var(--blue-soft); color: var(--blue); }
.stat-ico.amber { background: var(--amber-soft); color: var(--amber); }
.stat-ico.purple { background: var(--purple-soft); color: var(--purple); }
.stat-value { font-size: 29px; font-weight: 760; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat-foot { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.stat-foot .up { color: var(--accent); }
.stat-foot .down { color: var(--red); }

/* ---------- dashboard hero ---------- */

.hero {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(500px 260px at 0% 0%, var(--accent-soft), transparent 60%),
    linear-gradient(180deg, var(--glass), transparent 50%),
    var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid var(--line);
  pointer-events: none;
}
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.hero-grid { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; }
.ring-wrap { position: relative; width: 132px; height: 132px; flex: none; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ring-center b { font-size: 23px; font-weight: 760; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ring-center span { font-size: 10px; color: var(--muted); }
.hero-body { min-width: 0; }
.hero-title { font-size: 17px; font-weight: 730; display: flex; align-items: center; gap: 10px; }
.hero-meta { color: var(--muted); font-size: 12px; margin-top: 5px; }
.hero-numbers { display: flex; gap: 26px; margin: 16px 0 12px; }
.hero-num b { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-num span { font-size: 10.5px; color: var(--muted); }
.hero-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hero-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s var(--ease); }
.hero-log {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.hero-log-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.mini-log { font-family: var(--mono); font-size: 11.5px; line-height: 1.75; max-height: 92px; overflow: hidden; display: flex; flex-direction: column; gap: 1px; }
.mini-log .ln { display: flex; gap: 8px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-log .ln i { color: var(--muted); font-style: normal; flex: none; }
.mini-log .ln.warn { color: var(--amber); }
.mini-log .ln.error { color: var(--red); }
.mini-log .ln.info { color: var(--text-2); }

/* ---------- charts ---------- */

.chart-host { position: relative; width: 100%; }
.chart-svg { display: block; width: 100%; overflow: visible; }
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 11px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  display: none;
  z-index: 5;
  white-space: nowrap;
  transform: translate(-50%, -120%);
}
.chart-tip b { color: var(--accent); }

.chart-legend { display: flex; align-items: center; gap: 16px; font-size: 11px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* ---------- account cards ---------- */

.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

/* 账号列表（横向一行一账号） */
.pool-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pool-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  font-weight: 620;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.pool-tab:hover { color: var(--text); background: var(--surface-2); }
.pool-tab.active { color: var(--accent); background: var(--accent-soft); }
.pool-tab svg { width: 14px; height: 14px; }

/* 书池：书架式卡片网格 */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.book-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: visible;
  transition: transform .18s var(--ease), border-color .18s, opacity .18s;
  position: relative;
}
.book-card.menu-open { z-index: 40; }
.book-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.book-card.is-off { opacity: .55; }
.book-cover {
  aspect-ratio: 3 / 4;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  cursor: pointer;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover-fallback { color: var(--muted); width: 22px; height: 22px; }
.book-card-body { padding: 10px 12px 4px; cursor: pointer; }
.book-title { font-size: 13px; font-weight: 680; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.book-author { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-badges { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.book-badges .badge { font-size: 10.5px; }
.book-card-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px 10px;
  margin-top: auto;
}
.book-card-actions .btn { padding: 5px 8px; font-size: 11px; }
[data-book-enabled] { margin: 0; }

/* 书架内封面缩略 */
.shelf-cover { width: 38px; height: 52px; border-radius: 6px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; }
.shelf-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shelf-cover svg { width: 16px; height: 16px; color: var(--muted); }

/* 书池管理列表：表头与内容统一居中 */
.pool-book-table .table td { padding: 10px 10px; }
.pool-book-table .table th, .pool-book-table .table td { text-align: center; vertical-align: middle; }
.pool-book-table .shelf-cover { margin: 0 auto; display: inline-grid; }

.chap-id {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
  word-break: break-all;
  line-height: 1.5;
  max-width: 100%;
}

/* 底部翻页工具条 */
.table-pager { display: flex; align-items: center; gap: 9px; margin-top: 12px; }
.table-pager-gap { flex: 1; }
.table-pager .hint { white-space: nowrap; }

/* 推送渠道 / 定时任务表格：表头与内容统一居中 */
.push-table th, .push-table td,
.sch-table th, .sch-table td { text-align: center; vertical-align: middle; }

/* 全站列表表格统一表头/内容居中 */
.runs-table th, .runs-table td,
.shelf-table th, .shelf-table td { text-align: center; vertical-align: middle; }
.runs-table .progress-cell { justify-content: center; }
.runs-table .table td { white-space: normal; }

/* 模态框表格的滚动兜底 */
.modal-body-scroll { max-height: 52vh; overflow-y: auto; }
.acc-list { display: flex; flex-direction: column; gap: 10px; }
.acc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--glass), transparent 55%), var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s;
  animation: rise .45s var(--ease) both;
}
.acc-row:hover { border-color: var(--line-strong); }
.acc-row-main { flex: 1; min-width: 0; }
.acc-row-meta { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; max-width: 380px; }
.acc-row-actions { display: flex; gap: 7px; align-items: center; }
.acc-row-actions .btn { flex: none; }
.acc-progress { margin-top: 7px; max-width: 320px; }
@media (max-width: 900px) {
  .acc-row { flex-wrap: wrap; }
  .acc-row-meta { justify-content: flex-start; max-width: none; }
}
.account-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--glass), transparent 55%), var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform .2s var(--ease), border-color .2s;
  animation: rise .45s var(--ease) both;
}
.account-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.account-top { display: flex; gap: 13px; align-items: center; }
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-weight: 760;
  font-size: 17px;
  color: var(--accent);
  overflow: hidden;
  flex: none;
  border: 1px solid var(--line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.account-sub { font-size: 11px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.account-actions { display: flex; gap: 7px; margin-top: auto; }
.account-actions .btn { flex: 1; }

/* 账号管理表格：表头与内容统一居中 */
.acc-table th, .acc-table td { text-align: center; vertical-align: middle; }
.acc-table .acc-info { display: flex; gap: 12px; align-items: center; justify-content: center; }
.acc-table .acc-info-text { text-align: left; min-width: 0; max-width: 340px; }
.acc-table .acc-idline { justify-content: center; }
.acc-table .acc-checkline { text-align: left; }
.acc-table .acc-badges { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; align-content: center; min-width: 0; flex: none; max-width: none; }
.acc-table .acc-cta { display: flex; gap: 7px; justify-content: center; }
.acc-table .acc-cta .btn { flex: none; white-space: nowrap; }
.acc-table .acc-ops { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.acc-table .acc-ops .btn { flex: none; }
.acc-table .acc-progress { max-width: 320px; margin: 6px auto 0; }

/* 账号行分区：信息块紧贴头像（三行同列同左缘） | 徽标（靠左、垂直居中） | 主操作 | 次级操作 */
.acc-info { display: flex; gap: 13px; align-items: center; flex: 0 1 auto; }
.acc-info-text { flex: 0 1 auto; min-width: 0; max-width: 340px; }
.acc-idline { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 3px; min-width: 0; }
.acc-checkline { margin-top: 3px; }
.acc-badges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  flex: 1 1 auto;
  justify-content: flex-start;
  min-width: 0;
}
.acc-cta { display: flex; gap: 7px; flex: none; }
.acc-cta .btn { flex: none; white-space: nowrap; }
.acc-ops { display: flex; gap: 5px; flex: none; }
.acc-ops .btn { flex: none; }
@media (max-width: 900px) {
  .acc-info { flex: 1 1 100%; }
  .acc-badges { flex: 1 1 100%; padding-left: 0; }
  .acc-cta { flex: 1; }
  .acc-cta .btn { flex: 1; }
  .acc-ops { flex: 1; }
}

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left;
  font-weight: 620;
  font-size: 10.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  white-space: nowrap;
}
.table td { padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.cell-strong { font-weight: 650; color: var(--text); }
.cell-muted { color: var(--muted); font-size: 11.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s var(--ease); }
.progress-cell { min-width: 120px; display: flex; align-items: center; gap: 9px; }
.progress-cell .bar { flex: 1; }
.progress-cell span { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- list rows ---------- */

.list { display: flex; flex-direction: column; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
}
.list-row:first-child { border-top: none; }
.list-main { min-width: 0; flex: 1; }
.list-title { font-size: 12.5px; font-weight: 620; display: flex; align-items: center; gap: 8px; }
.list-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.list-time { font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- schedules ---------- */

.schedule-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 4px;
  border-top: 1px solid var(--line);
}
.schedule-row:first-child { border-top: none; }
.schedule-icon { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); flex: none; }
.schedule-icon.on { background: var(--accent-soft); color: var(--accent); }
.schedule-main { flex: 1; min-width: 0; }
.schedule-title { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.schedule-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.schedule-next { text-align: right; font-size: 11px; color: var(--muted); white-space: nowrap; }
.schedule-next b { display: block; font-size: 12px; color: var(--text-2); font-weight: 600; }

/* ---------- logs console ---------- */

.console {
  background: var(--console-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  height: 340px;
  overflow: auto;
  padding: 13px 15px;
  color: #c8d3e0;
}
[data-theme="light"] .console { color: #cfd8e3; }
.console .log-line { display: flex; gap: 10px; white-space: pre-wrap; word-break: break-word; }
.console .log-line .t { color: #5c6b80; flex: none; }
.console .log-line .lv { flex: none; width: 42px; font-weight: 700; }
.console .log-line .m { flex: 1; }
.console .log-line.info .lv { color: #6fb7ff; }
.console .log-line.warn .lv { color: #f5b942; }
.console .log-line.error .lv { color: #ff7a7a; }
.console .log-line.error .m { color: #ffb3b3; }
.console .empty-log { color: #5c6b80; text-align: center; padding-top: 120px; }

/* ---------- drawer ---------- */

.drawer-mask { position: fixed; inset: 0; background: rgba(3, 6, 10, .55); backdrop-filter: blur(3px); z-index: 90; animation: fade .2s; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(680px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  box-shadow: -30px 0 80px -40px rgba(0, 0, 0, .8);
  z-index: 91;
  display: flex;
  flex-direction: column;
  animation: slideIn .28s var(--ease);
}
.drawer-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.drawer-body { padding: 22px 24px; overflow: auto; flex: 1; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--bg-2); }

/* ---------- modal ---------- */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 10, .62);
  backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 120;
  animation: fade .18s;
}
.modal {
  width: min(540px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: pop .22s var(--ease);
}
.modal.wide { width: min(760px, 100%); }
.modal.narrow { width: min(420px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.modal-title { font-size: 18px; font-weight: 730; letter-spacing: -.02em; }
.modal-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.modal-close { width: 30px; height: 30px; border-radius: 8px; border: none; background: var(--surface-2); color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none; }
.modal-close:hover { color: var(--text); background: var(--surface-3); }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin: 22px -24px -24px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, var(--surface) 40%);
  position: sticky;
  bottom: -24px;
  z-index: 3;
}

/* ---------- toasts ---------- */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 9px; max-width: 360px; }
.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  color: var(--text);
  animation: slideUp .25s var(--ease);
}
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--accent); }
.toast.error svg { color: var(--red); }
.toast.warn svg { color: var(--amber); }
.toast.info svg { color: var(--blue); }
.toast.out { animation: fadeOut .2s forwards; }

/* ---------- empty / loading ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 54px 24px;
  color: var(--muted);
  gap: 12px;
}
.empty-ico {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  color: var(--text-2);
}
.empty-ico svg { width: 24px; height: 24px; }
.empty h3 { font-size: 15px; color: var(--text); font-weight: 680; }
.empty p { font-size: 12.5px; max-width: 340px; line-height: 1.65; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}

.page-loading { display: grid; gap: 14px; }
.page-loading .skeleton { height: 90px; border-radius: var(--radius); }

/* ---------- auth (minimal) ---------- */

.auth-minimal {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}
.auth-minimal-form {
  width: min(320px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-input {
  height: 46px;
  padding: 0 14px;
  background: var(--surface);
  text-align: center;
}
.auth-submit {
  height: 46px;
  width: 100%;
  font-size: 13.5px;
}
.auth-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  display: none;
}
.auth-error.show { display: flex; gap: 8px; align-items: center; animation: shake .3s; }

/* ---------- menus ---------- */

.menu-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 178px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 35;
  display: none;
}
.menu.open { display: block; animation: pop .15s var(--ease); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 550;
  color: var(--text-2);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item.danger { color: var(--red); }
.menu-item svg { width: 14px; height: 14px; flex: none; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ---------- QR / login modal ---------- */

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 0 4px;
  text-align: center;
}
.qr-frame {
  width: 232px;
  height: 232px;
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  position: relative;
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .6);
  border: 1px solid var(--line);
}
.qr-frame img { width: 100%; height: 100%; border-radius: 8px; }
.qr-frame.expired img { opacity: .12; filter: blur(2px); }
.qr-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #222;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, .55);
  border-radius: 18px;
}
.qr-frame.expired .qr-overlay { display: flex; }
.qr-status { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.qr-status .pulse-dot { color: var(--accent); }
.qr-countdown { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 18px; }
.qr-countdown.urgent { color: var(--amber); }
.qr-countdown.dead { color: var(--red); }
.otp-wrap { margin-top: 2px; }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 20px; font-family: var(--mono); }

/* ---------- tabs / segmented ---------- */

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  appearance: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .16s, border-color .16s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tabbar-actions { margin-left: auto; display: flex; gap: 8px; padding-left: 10px; }

/* 弹窗内的分段控件（与页面级下划线 tab 区分） */
.tabs.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  margin-bottom: 16px;
  overflow: visible;
}
.tabs.segmented .tab {
  border: none;
  border-radius: 8px;
  margin: 0;
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.tabs.segmented .tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.type-opt {
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: .16s;
  font-size: 11.5px;
  color: var(--text-2);
}
.type-opt:hover { border-color: var(--line-strong); }
.type-opt.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.type-opt b { display: block; font-size: 12px; margin-bottom: 2px; }
.type-opt svg { width: 20px; height: 20px; margin: 7px auto 0; display: block; opacity: .9; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-size: 11.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.dash-grid { display: grid; grid-template-columns: 1.58fr 1fr; gap: 16px; align-items: stretch; }

/* ---------- misc ---------- */

.section-title { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.kv:first-child { border-top: none; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; }
.note {
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--blue-soft);
  border: 1px solid rgba(122, 162, 247, .18);
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.65;
  display: flex;
  gap: 9px;
}
.note svg { width: 15px; height: 15px; color: var(--blue); flex: none; margin-top: 2px; }
.note.warn { background: var(--amber-soft); border-color: rgba(245, 185, 66, .2); }
.note.warn svg { color: var(--amber); }
.note.danger { background: var(--red-soft); border-color: rgba(255, 122, 122, .2); }
.note.danger svg { color: var(--red); }

/* ---------- animations ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 26px 26px 70px; }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; width: 100%; padding: 20px 16px 104px; }
  .topbar { margin-bottom: 14px; }
  .top-actions { width: 100%; justify-content: flex-end; }
  .page-title { font-size: 18px; }
  .mobile-nav {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    padding: 7px;
    gap: 4px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav a, .mobile-nav .mobile-more {
    flex: 0 0 auto;
    min-width: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 6px;
    border-radius: 12px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 600;
    cursor: pointer;
  }
  .mobile-nav a svg, .mobile-nav .mobile-more svg { width: 18px; height: 18px; }
  .mobile-nav a.active, .mobile-nav .mobile-more.active { color: var(--accent); background: var(--accent-soft); }
  .hero-grid { grid-template-columns: 1fr; gap: 18px; }
  .ring-wrap { width: 108px; height: 108px; margin: 0 auto; }
  .hero-numbers { gap: 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  .toasts { left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); max-width: none; }
  .drawer { width: 100%; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 24px; }
  .stat .stat-foot svg { display: none; }
  .accounts-grid { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 18px; }
  .card { padding: 18px; }
  .modal { padding: 20px; border-radius: 18px; }
  .modal-foot { margin: 18px -20px -20px; padding: 12px 20px 16px; bottom: -20px; }
  .qr-frame { width: 208px; height: 208px; }
  .top-actions .btn { padding: 9px 11px; }
  .top-actions .btn svg { margin: 0; }
}

@media (max-width: 640px) {
  .table-compact th:nth-child(3), .table-compact td:nth-child(3),
  .table-compact th:nth-child(4), .table-compact td:nth-child(4),
  .table-compact th:nth-child(5), .table-compact td:nth-child(5) { display: none; }
  .table-compact th:nth-child(6), .table-compact td:nth-child(6) { white-space: nowrap; }
  .table-wide { min-width: 720px; }
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
}

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

/* ===== 列表工具条（筛选 / 搜索） ===== */
.tool-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tool-row .input, .tool-row .select { width: auto; min-width: 160px; }
.tool-row .spacer { flex: 1; }

/* ===== 设置页：卡片瀑布流（等宽折列，避免双栏高度差留白） ===== */
.settings-flow {
  columns: 2 400px;
  column-gap: 16px;
}
.settings-card {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .settings-flow { columns: 1 auto; }
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ===== 关于页 ===== */
.about-brand { display: flex; align-items: center; gap: 12px; }
.about-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.about-cmd {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}
.stack-list { display: flex; flex-direction: column; gap: 4px; }
.stack-item { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.stack-item:first-child { border-top: none; }
.stack-item svg { width: 17px; height: 17px; color: var(--muted); flex: none; margin-top: 2px; }
.stack-item .stack-text { min-width: 0; }
.stack-item .stack-text b { display: block; font-size: 13px; }
.stack-item .stack-text span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.6; }

/* ===== 更新日志页 ===== */
.release-list-wrap { display: flex; flex-direction: column; gap: 16px; }
.release-card.current {
  background:
    radial-gradient(600px 280px at 100% 0%, var(--accent-soft), transparent 62%),
    linear-gradient(180deg, var(--glass), transparent 42%),
    var(--surface);
}
.release-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.release-heading { min-width: 0; }
.release-version {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 25px;
  font-weight: 760;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.release-version .badge { font-size: 10px; }
.release-meta { color: var(--muted); font-size: 11.5px; margin-top: 6px; letter-spacing: .02em; }
.release-mark {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(61, 220, 151, .18);
}
.release-mark svg { width: 21px; height: 21px; }
.release-intro {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.8;
  max-width: 76ch;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.release-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.release-group {
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
}
.release-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.release-group-head svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.release-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.release-list li {
  position: relative;
  padding-left: 13px;
  color: var(--text-2);
  font-size: 11.8px;
  line-height: 1.65;
}
.release-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .64em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}
.release-list li b { color: var(--text); font-weight: 650; }
.release-list code {
  font-family: var(--mono);
  font-size: 10.8px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
}
@media (max-width: 900px) {
  .release-groups { grid-template-columns: 1fr; }
  .release-version { font-size: 22px; }
  .release-mark { width: 38px; height: 38px; border-radius: 11px; }
  .release-mark svg { width: 18px; height: 18px; }
}

/* ===== 概览页：等高卡片 ===== */
.dash-grid > article.card { height: 100%; display: flex; flex-direction: column; }
.dash-grid > article.card > .chart-host { flex: 1; }
.dash-grid > article.card > .list { flex: 1; }

/* ===== 设置页安全卡片操作区 ===== */
.bot-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ===== 移动端「更多」弹层 ===== */
.more-list { display: flex; flex-direction: column; gap: 6px; }
.more-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.more-item svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.more-item .more-text { min-width: 0; }
.more-item b { display: block; font-size: 13px; }
.more-item .more-text span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ===== 列表表格统一居中（追加于文件末尾以覆盖基础表样式） ===== */
.table.pool-book-table td, .table.pool-book-table th,
.table.acc-table td, .table.acc-table th,
.table.push-table td, .table.push-table th,
.table.sch-table td, .table.sch-table th,
.table.runs-table td, .table.runs-table th,
.table.shelf-table td, .table.shelf-table th {
  text-align: center;
  vertical-align: middle;
}
/* 池管理表的选择器作用于包裹层 */
.pool-book-table .table th, .pool-book-table .table td {
  text-align: center;
  vertical-align: middle;
}
/* 账号表与推送/定时表的 flex 内容同样居中 */
.acc-table td .acc-info, .acc-table td .acc-cta, .acc-table td .acc-ops,
.push-table td > div, .sch-table td > div {
  justify-content: center;
}
