/* ============================================================
   Elsevier 稿件追踪 — 样式
   主题变量 / 顶栏 / 卡片 / 阶段条 / 指标 / 时间线 / 页脚
   ============================================================ */

:root {
  --accent: #e9711c;
  --accent-soft: #fdf0e4;
  --ok: #178a4c;
  --ok-soft: #e6f6ec;
  --warn: #c77b0a;
  --warn-soft: #fdf3dd;
  --idle: #6b7a8c;
  --idle-soft: #eef1f5;

  --bg: #f5f6f8;
  --bg-grad: radial-gradient(1200px 520px at 50% -10%, #fff2e6 0%, rgba(245, 246, 248, 0) 62%);
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --line: #e4e7ec;
  --line-strong: #d3d8e0;
  --text: #131a22;
  --text-2: #4a5563;
  --text-3: #7b8694;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .18);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, .05), 0 24px 48px -24px rgba(16, 24, 40, .28);

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  --accent: #ff8a3d;
  --accent-soft: #35220f;
  --ok: #3ddc84;
  --ok-soft: #10291b;
  --warn: #ffc45c;
  --warn-soft: #322612;
  --idle: #93a4b8;
  --idle-soft: #1c232c;

  --bg: #0b0f14;
  --bg-grad: radial-gradient(1100px 520px at 50% -12%, #22180f 0%, rgba(11, 15, 20, 0) 60%);
  --surface: #12171e;
  --surface-2: #171d25;
  --line: #232b35;
  --line-strong: #313b48;
  --text: #e9eef5;
  --text-2: #b3bfcd;
  --text-3: #7f8da0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .5), 0 28px 56px -28px rgba(0, 0, 0, .85);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --accent: #ff8a3d;
    --accent-soft: #35220f;
    --ok: #3ddc84;
    --ok-soft: #10291b;
    --warn: #ffc45c;
    --warn-soft: #322612;
    --idle: #93a4b8;
    --idle-soft: #1c232c;
    --bg: #0b0f14;
    --bg-grad: radial-gradient(1100px 520px at 50% -12%, #22180f 0%, rgba(11, 15, 20, 0) 60%);
    --surface: #12171e;
    --surface-2: #171d25;
    --line: #232b35;
    --line-strong: #313b48;
    --text: #e9eef5;
    --text-2: #b3bfcd;
    --text-3: #7f8da0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .5), 0 28px 56px -28px rgba(0, 0, 0, .85);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

code, pre { font-family: var(--mono); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .topbar { background: var(--bg); }
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* 徽标自带白底：暗色主题下补一层同色托板，避免变成突兀的白方块 */
html[data-theme="dark"] .brand-mark {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
html[data-theme="dark"] .brand-mark img { border-radius: 7px; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .brand-mark {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  }
  html[data-theme="auto"] .brand-mark img { border-radius: 7px; }
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; }
.brand-text small { font-size: 10.5px; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: .18s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }
.icon-btn svg {
  width: 17px; height: 17px; fill: none;
  stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-btn .i-moon { display: none; }
html[data-theme="dark"] .icon-btn .i-sun { display: none; }
html[data-theme="dark"] .icon-btn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .icon-btn .i-sun { display: none; }
  html[data-theme="auto"] .icon-btn .i-moon { display: block; }
}
#btn-refresh.spinning svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: .18s ease;
}
.chip-btn .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-3);
  transition: .18s ease;
}
.chip-btn:hover { border-color: var(--line-strong); color: var(--text); }
.chip-btn[aria-pressed="true"] {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  background: var(--ok-soft);
}
.chip-btn[aria-pressed="true"] .dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent);
  animation: blip 2s ease-in-out infinite;
}
@keyframes blip { 50% { opacity: .45; } }

.topbar-progress { height: 2px; overflow: hidden; background: transparent; }
.topbar-progress.loading::after {
  content: "";
  display: block;
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

/* ---------- 布局 ---------- */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 20px 56px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.card-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.card-sub { font-size: 12.5px; color: var(--text-3); margin-left: auto; }

.btn {
  font: inherit;
  font-size: 13.5px;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 8px 16px;
  cursor: pointer;
  transition: .18s ease;
}
.btn.primary {
  background: linear-gradient(140deg, #ff9d4d, var(--accent));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px -8px rgba(233, 113, 28, .9);
}
.btn.primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn.ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text-2);
}
.btn.ghost:hover { border-color: var(--line-strong); color: var(--text); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }

.linkish {
  border: 0;
  background: none;
  font: inherit;
  font-size: inherit;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.linkish:hover { filter: brightness(1.1); }

/* ---------- UUID 面板 ---------- */
.uuid-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  margin-bottom: 16px;
  animation: drop .22s ease;
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.uuid-panel label { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.uuid-row { display: flex; gap: 10px; margin-top: 6px; }
.uuid-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  font-family: var(--mono);
  padding: 10px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}
.uuid-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.hint { margin: 9px 0 0; font-size: 12.5px; color: var(--text-3); }
.hint code {
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 5px;
}

/* ---------- 状态卡 ---------- */
.state-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-2);
}
.state-card p { margin: 12px 0 0; }
.spinner {
  width: 30px; height: 30px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.state-card.error { border-color: color-mix(in srgb, #e74c3c 35%, var(--line)); }
.state-card.error h2 { margin: 0 0 6px; font-size: 16px; color: #e05252; }
.state-card.error p { color: var(--text-2); font-size: 13.5px; word-break: break-word; }
.error-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  padding: 24px 26px;
  overflow: hidden;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #ffb066 55%, transparent);
}
.eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.title {
  margin: 0 0 20px;
  font-size: 21px;
  line-height: 1.42;
  font-weight: 680;
  letter-spacing: -.015em;
  word-break: break-word;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px 20px;
}
.meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding-left: 11px;
  border-left: 2px solid var(--line);
}
.meta span { font-size: 11.5px; color: var(--text-3); letter-spacing: .02em; }
.meta b {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 650;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.status-pill .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.status-pill.done { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 32%, transparent); }
.status-code { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.side-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.side-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-3);
  white-space: nowrap;
}
.side-chip:empty { display: none; }
.side-note { margin-top: auto; font-size: 11px; color: var(--text-3); line-height: 1.5; }

/* ---------- Stepper ---------- */
.stepper {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 4px 0 0;
  padding: 0;
}
.stepper li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
  transition: color .2s ease;
}
.stepper li::before {
  content: "";
  position: absolute;
  top: 7px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--line);
  z-index: 0;
}
.stepper li:first-child::before { display: none; }
.stepper .node {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  position: relative;
  z-index: 1;
  transition: .2s ease;
}
.stepper li.done { color: var(--text-2); }
.stepper li.done .node { background: var(--ok); border-color: var(--ok); }
.stepper li.done::before { background: var(--ok); }
.stepper li.active { color: var(--accent); font-weight: 650; }
.stepper li.active .node {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
.stepper li.active .node::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: var(--accent);
}
.stepper li.active::before { background: var(--ok); }

/* ---------- Metrics ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px 14px;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.metric header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.m-label { font-size: 12.5px; font-weight: 600; color: var(--text-3); letter-spacing: .02em; }
.m-icon {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 7px;
  font-size: 12px;
  background: var(--idle-soft);
  color: var(--idle);
}
.metric[data-kind="accepted"] .m-icon { background: var(--warn-soft); color: var(--warn); }
.metric[data-kind="completed"] .m-icon { background: var(--ok-soft); color: var(--ok); }

.m-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 8px 0 10px;
  font-size: 30px;
  font-weight: 720;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.m-rate { font-size: 12.5px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.m-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--idle-soft);
  overflow: hidden;
}
.m-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--idle);
  transition: width .7s cubic-bezier(.22, .8, .28, 1);
}
.metric[data-kind="accepted"] .m-bar i { background: var(--warn); }
.metric[data-kind="completed"] .m-bar i { background: var(--ok); }
.metric footer { margin-top: 8px; font-size: 11px; color: var(--text-3); letter-spacing: .02em; }

/* ---------- Revision / 时间线 ---------- */
.rev-notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
}
.rev-notice .n-icon { flex: 0 0 20px; font-size: 15px; line-height: 1.4; }
.rev-notice b { color: var(--text); }

.rev-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}
.rev-block:last-child { margin-bottom: 0; }
.rev-block.current { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); }

.rev-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 38px 12px 16px;
  background: var(--surface-2);
  cursor: pointer;
  user-select: none;
  transition: background .18s ease;
}
.rev-head:hover { background: color-mix(in srgb, var(--surface-2) 60%, var(--line)); }
.rev-title { font-weight: 650; font-size: 14px; }
.rev-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  text-transform: uppercase;
}
.rev-chips { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.rev-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--idle-soft);
  color: var(--idle);
  white-space: nowrap;
}
.rev-chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; font-style: normal; }
.rev-chip.ok { background: var(--ok-soft); color: var(--ok); }
.rev-chip.warn { background: var(--warn-soft); color: var(--warn); }
.rev-chev {
  position: absolute;
  right: 15px;
  top: 13px;
  color: var(--text-3);
  font-size: 11px;
  transition: transform .2s ease;
}
.rev-head[aria-expanded="true"] .rev-chev { transform: rotate(180deg); }

.rev-body { padding: 4px 0 6px; }
.rev-empty { padding: 20px 16px; text-align: center; color: var(--text-3); font-size: 13px; }

/* 审稿人行 */
.reviewer {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.reviewer-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.r-name { font-weight: 650; font-size: 13.5px; }
.r-tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--idle-soft);
  color: var(--idle);
}
.r-tag.accepted { background: var(--warn-soft); color: var(--warn); }
.r-tag.completed { background: var(--ok-soft); color: var(--ok); }
.r-duration { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 时间线（三节点） */
.track {
  display: grid;
  grid-template-columns: auto minmax(52px, 1fr) auto minmax(52px, 1fr) auto;
  align-items: center;
  gap: 0;
}
.t-step {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 104px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  text-align: center;
}
.t-step .t-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text-3); }
.t-step .t-date {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.t-step.s-invited { border-color: color-mix(in srgb, var(--idle) 26%, var(--line)); }
.t-step.s-accepted {
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
  background: var(--warn-soft);
}
.t-step.s-accepted .t-label { color: var(--warn); }
.t-step.s-completed {
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  background: var(--ok-soft);
}
.t-step.s-completed .t-label { color: var(--ok); }
.t-step.pending {
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
}
.t-step.pending .t-date { color: var(--text-3); font-weight: 500; }

.t-link {
  position: relative;
  height: 2px;
  background: var(--line);
  margin: 0 6px;
}
.t-link.done { background: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.t-link .t-dur {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.t-link.live .t-dur { color: var(--accent); }
.t-link.live { background: repeating-linear-gradient(90deg, var(--accent) 0 5px, transparent 5px 10px); }

/* ---------- 原始数据 ---------- */
.raw { padding: 0; }
.raw-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 22px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  border-radius: var(--radius);
}
.raw-toggle:hover { color: var(--text); }
.raw-toggle .chev { transition: transform .2s ease; font-size: 11px; }
.raw-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.raw-body { padding: 0 22px 18px; }
.raw-actions { display: flex; gap: 8px; margin-bottom: 10px; }
#raw-json {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
  overflow: auto;
  max-height: 380px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.foot-line {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: var(--text-3);
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.foot-line .sep { opacity: .5; }
.foot-note {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.65;
  max-width: 640px;
  margin-inline: auto;
}
.foot-note code {
  font-size: 10.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 1px 4px;
  border-radius: 4px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
  z-index: 80;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* hidden 属性优先级兜底（避免被 display 规则覆盖） */
[hidden] { display: none !important; }

/* ---------- 推送设置浮层 ---------- */
.icon-btn.bell { position: relative; }
.bell-dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 2px var(--surface);
}

.notify-pop {
  position: fixed;
  top: 58px;
  right: max(14px, calc(50vw - 540px));
  width: min(360px, calc(100vw - 28px));
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.985); } }

.np-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.np-head strong { display: block; font-size: 13.5px; }
.np-head small { font-size: 11px; color: var(--text-3); }

/* 开关 */
.switch { margin-left: auto; position: relative; width: 40px; height: 22px; flex: 0 0 40px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line-strong);
  transition: .2s ease;
  pointer-events: none;
}
.switch .slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: .2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }

.np-body { padding: 12px 16px 14px; }
.np-kv { margin: 0 0 12px; display: grid; gap: 6px; }
.np-kv > div { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; }
.np-kv dt { color: var(--text-3); flex: 0 0 66px; margin: 0; }
.np-kv dd { margin: 0; color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-kv dd.mono { font-family: var(--mono); font-size: 11.5px; font-weight: 500; }

.np-watch { border-top: 1px dashed var(--line); padding-top: 10px; margin-bottom: 12px; }
.np-sub { font-size: 11.5px; color: var(--text-3); font-weight: 700; letter-spacing: .04em; margin-bottom: 6px; }
.np-items { display: grid; gap: 6px; }
.np-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.np-item .np-doc { font-weight: 650; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-item .np-st { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--ok); white-space: nowrap; }
.np-item .np-st.idle { color: var(--text-3); }

.np-actions { display: flex; gap: 8px; }
.np-actions .btn { flex: 1; min-width: 0; white-space: nowrap; padding: 0 8px; font-size: 12.5px; }
.np-note { margin: 10px 0 0; font-size: 11px; color: var(--text-3); line-height: 1.55; }
.np-note code { font-size: 10.5px; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 4px; border-radius: 4px; }

@media (max-width: 620px) {
  .notify-pop { top: 54px; right: 8px; left: 8px; width: auto; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .hero-side {
    padding-left: 0;
    padding-top: 16px;
    border-left: 0;
    border-top: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }
  .side-note { width: 100%; margin-top: 0; }
  .metrics { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 620px) {
  .wrap { padding: 16px 14px 44px; }
  .card, .hero { padding: 16px 16px; }
  .title { font-size: 18px; }
  .brand-text small { display: none; }
  .topbar-inner { padding: 8px 12px; gap: 10px; flex-wrap: nowrap; }
  .brand { gap: 8px; min-width: 0; }
  .brand-mark { width: 28px; height: 28px; border-radius: 9px; font-size: 14px; }
  .brand-text strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-actions { gap: 6px; }
  .icon-btn { width: 32px; height: 32px; }
  .chip-btn { width: 32px; height: 32px; padding: 0; justify-content: center; }
  .chip-btn .chip-label { display: none; }
  .meta-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
  .stepper { grid-template-columns: repeat(4, 1fr); }
  .stepper li { font-size: 11px; }

  /* 时间线改为纵向堆叠，避免横向溢出 */
  .track {
    grid-template-columns: 1fr;
    gap: 0;
    padding-left: 4px;
  }
  .t-step { min-width: 0; align-items: flex-start; text-align: left; }
  .t-link {
    width: 2px;
    height: 22px;
    margin: 0 0 0 16px;
  }
  .t-link .t-dur {
    left: 14px;
    top: 50%;
    transform: translate(0, -50%);
  }
  .rev-chips { margin-left: 0; width: 100%; }
  .m-value { font-size: 26px; }
}

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

/* =============================================================
   顶栏账号入口 + 未登录时的推送浮层
   ============================================================= */

.acct-chip {
  display: inline-block;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.7;
}

.np-guest {
  padding: 14px 16px 16px;
  display: grid;
  gap: 12px;
}
.np-guest p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.np-guest .btn { justify-self: start; }

@media (max-width: 620px) {
  .acct-chip { max-width: 76px; padding: 5px 9px; font-size: 12px; }
}

/* =============================================================
   顶栏用户胶囊（首页 / 账号页 / 管理后台共用）
   ============================================================= */

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  text-decoration: none;
  max-width: 220px;
  transition: border-color .15s, color .15s;
}
.user-chip:hover { border-color: var(--line-strong); color: var(--text); }
.user-chip .avatar {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
}
.user-chip .u-mail {
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .user-chip { max-width: 132px; padding: 3px; gap: 0; }
  .user-chip .u-mail { display: none; }

  /* 手机端顶栏放不下太多按钮：隐藏次要入口，其余按钮不换行 */
  .topbar-actions { flex-wrap: nowrap; }
  .topbar-actions .only-wide { display: none; }
  .topbar-actions .btn.ghost.sm {
    padding: 5px 9px;
    font-size: 12px;
    white-space: nowrap;
  }
}

