/* ============================================================
 * FA Data Service Center — 站点样式
 * 设计基调：对齐 fastudio.org（FA Technology Studio）——
 * 极简 / 白底黑字 / 大留白 / 柔和光晕点睛；深色主题同等克制。
 *
 * 动效参数（与 fastudio 一致）：
 *  - Hero 入场：fadeUp .9s，Apple 式减速，stagger 由 nth-child 控制
 *  - 滚动进入视口：.7s（html.anim .reveal，JS IntersectionObserver 加 .in）
 *  - 光晕呼吸：9s / 11s 交替循环，仅 transform + opacity
 *  - 卡片悬浮：translate(-4~-6px) + 阴影加深，.5s
 *  - 统一缓动：--ease-out / --ease-ios / --ease-spring
 *  - prefers-reduced-motion：全部动画降级，内容始终可见
 * ============================================================ */

/* ---------- 设计变量（浅色默认，深色见 html[data-theme="dark"]） ---------- */
:root {
  color-scheme: light;

  --bg:            #ffffff;
  --bg-soft:       #fafafa;
  --fg:            #0b0b0c;
  --fg-2:          #3f3f46;
  --muted:         #71717a;
  --border:        rgba(11, 11, 12, .09);
  --border-strong: rgba(11, 11, 12, .16);
  --card:          #ffffff;

  --header-bg:  rgba(255, 255, 255, .72);
  --hover-bg:   rgba(11, 11, 12, .05);
  --badge-bg:   rgba(255, 255, 255, .6);
  --code-bg:    #0f0f11;
  --code-border: transparent;

  --ok:      #16a34a;
  --ok-ink:  #15803d;
  --warn:    #d97706;
  --warn-ink:#b45309;
  --bad:     #dc2626;
  --bad-ink: #b91c1c;

  --shadow-sm: 0 1px 2px rgba(11, 11, 12, .04);
  --shadow-md: 0 4px 16px rgba(11, 11, 12, .05), 0 1px 3px rgba(11, 11, 12, .04);
  --shadow-lg: 0 16px 48px rgba(11, 11, 12, .09), 0 2px 8px rgba(11, 11, 12, .05);

  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --ease-out:    cubic-bezier(.22, 1, .36, 1);
  --ease-ios:    cubic-bezier(.32, .72, 0, 1);
  --ease-spring: cubic-bezier(.34, 1.45, .64, 1);
  --ease-press:  cubic-bezier(.4, 0, .2, 1);

  --header-h: 68px;
  --container: 1120px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas,
               "Courier New", monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #0a0a0b;
  --bg-soft:       #0e0e10;
  --fg:            #f4f4f5;
  --fg-2:          #c6c6cc;
  --muted:         #8b8b92;
  --border:        rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .17);
  --card:          #121214;

  --header-bg:  rgba(10, 10, 11, .7);
  --hover-bg:   rgba(255, 255, 255, .07);
  --badge-bg:   rgba(18, 18, 20, .65);
  --code-bg:    #151517;
  --code-border: rgba(255, 255, 255, .07);

  --ok:      #4ade80;
  --ok-ink:  #4ade80;
  --warn:    #fbbf24;
  --warn-ink:#fbbf24;
  --bad:     #f87171;
  --bad-ink: #f87171;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out);
}

h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
dl, dt, dd { margin: 0; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; }

[hidden] { display: none !important; }

::selection { background: var(--fg); color: var(--bg); }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 4px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.6; }
.wrap  { overflow-wrap: anywhere; white-space: normal; }
.ta-right { text-align: right; }

main > .view {
  max-width: var(--container);
  margin-inline: auto;
  padding: calc(var(--header-h) + 40px) 24px 64px;
}

/* ---------- 顶部导航 ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease-out), background-color .3s var(--ease-out);
}

.topbar.scrolled { border-bottom-color: var(--border); }

.topbar-inner {
  max-width: var(--container);
  height: var(--header-h);
  margin-inline: auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  flex: none;
}

.brand-text { line-height: 1.25; }
.brand-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand-text small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.nav { flex: 1; display: flex; justify-content: center; gap: 4px; }

.nav-btn {
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg-2);
  cursor: pointer;
  transition: color .25s var(--ease-out), background-color .25s var(--ease-out);
}

.nav-btn:hover { color: var(--fg); background: var(--hover-bg); }
.nav-btn.active { color: var(--fg); background: var(--hover-bg); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--badge-bg);
  font-size: 13px;
  color: var(--fg-2);
  max-width: 220px;
}

.user-chip > span:last-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}

.role-badge {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(217, 119, 6, .12);
  color: var(--warn-ink);
  font-size: 11px;
  font-weight: 600;
}

/* 明暗切换：圆形幽灵按钮，只保留图标（与 fastudio 相同） */
.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: none;
  color: var(--fg-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .3s var(--ease-ios), color .3s var(--ease-ios),
              transform .35s var(--ease-spring);
}

.theme-toggle:hover { background: var(--hover-bg); color: var(--fg); }
.theme-toggle:active { transform: scale(.94); }

.theme-toggle svg {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: opacity .3s var(--ease-out), transform .4s var(--ease-spring);
}

html[data-theme="light"] .theme-toggle .icon-sun,
html[data-theme="dark"]  .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(.6); }
html[data-theme="light"] .theme-toggle .icon-moon,
html[data-theme="dark"]  .theme-toggle .icon-sun  { opacity: 1; transform: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .35s var(--ease-spring),
              background-color .3s var(--ease-ios),
              border-color .3s var(--ease-ios),
              box-shadow .35s var(--ease-ios),
              color .3s var(--ease-ios),
              opacity .3s var(--ease-ios);
}

.btn:hover { transform: translateY(-1px); }

.btn:active {
  transform: translateY(0) scale(.97);
  transition-duration: .12s;
  transition-timing-function: var(--ease-press);
}

.btn:disabled { opacity: .55; cursor: default; transform: none; }

.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { opacity: .82; }

.btn-outline {
  background: var(--bg);
  border-color: var(--border-strong);
  color: var(--fg);
}
.btn-outline:hover { border-color: var(--fg); }

.btn-ghost { color: var(--fg-2); }
.btn-ghost:hover { color: var(--fg); background: var(--hover-bg); }

.btn-soft {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--fg-2);
}
.btn-soft:hover { color: var(--fg); border-color: var(--border-strong); }

.btn-danger { color: var(--bad-ink); }
.btn-danger:hover { color: var(--bad); background: rgba(220, 38, 38, .08); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-lg { padding: 13px 30px; font-size: 15px; }

/* 架构选择：竖排双行的轮廓按钮 */
.arch-row { display: flex; gap: 12px; flex-wrap: wrap; }

.arch-btn {
  flex: 1 1 160px;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
}

.arch-btn strong { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.arch-btn small { font-size: 12px; font-weight: 400; color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  margin: calc(-1 * (var(--header-h) + 40px)) -24px 0;
  padding: calc(var(--header-h) + 96px) 24px 56px;
  text-align: center;
}

/* 柔和光晕：唯一的一处色彩点睛，低饱和蓝 + 紫 */
.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform, opacity;
}

.glow-a {
  width: 560px;
  height: 560px;
  left: 50%;
  top: -180px;
  margin-left: -560px;
  background: radial-gradient(circle, rgba(191, 219, 254, .55), transparent 70%);
  animation: breathe 9s ease-in-out infinite alternate;
}

.glow-b {
  width: 520px;
  height: 520px;
  left: 50%;
  top: -120px;
  background: radial-gradient(circle, rgba(221, 214, 254, .5), transparent 70%);
  animation: breathe 11s ease-in-out -4s infinite alternate;
}

/* 深色下的光晕：降低亮度，保留一点冷色微光 */
html[data-theme="dark"] .glow-a {
  background: radial-gradient(circle, rgba(96, 165, 250, .16), transparent 70%);
}
html[data-theme="dark"] .glow-b {
  background: radial-gradient(circle, rgba(167, 139, 250, .15), transparent 70%);
}

@keyframes breathe {
  from { transform: scale(1);    opacity: .75; }
  to   { transform: scale(1.12); opacity: 1; }
}

.hero-inner { position: relative; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--badge-bg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--fg-2);
  transition: border-color .3s var(--ease-out);
}

.hero-kicker:hover { border-color: var(--border-strong); }

.hero-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.hero h1 {
  margin-top: 28px;
  font-size: clamp(44px, 7.5vw, 84px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.05;
}

.hero-sub {
  margin: 18px auto 0;
  max-width: 600px;
  font-size: 16px;
  color: var(--muted);
  text-wrap: pretty;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Hero 入场动画：Apple 式平滑减速 + 轻微缩放，stagger 由子元素序号控制 */
html.anim .hero-anim {
  opacity: 0;
  animation: fadeUp .9s var(--ease-ios) forwards;
}

.hero-inner > .hero-anim:nth-child(1) { animation-delay: 80ms; }
.hero-inner > .hero-anim:nth-child(2) { animation-delay: 180ms; }
.hero-inner > .hero-anim:nth-child(3) { animation-delay: 300ms; }
.hero-inner > .hero-anim:nth-child(4) { animation-delay: 420ms; }
.hero-inner > .hero-anim:nth-child(5) { animation-delay: 560ms; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 终端演示卡：亮暗主题都用近黑底（fastudio 的 code 块做法） */
.hero-visual {
  margin: 56px auto 0;
  max-width: 560px;
  text-align: left;
}

.terminal {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 18px 0;
}

.terminal-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
}

.terminal-bar em {
  margin-left: 8px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, .4);
}

.terminal pre {
  margin: 0;
  padding: 18px 22px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  color: rgba(255, 255, 255, .85);
  overflow-x: auto;
}

.terminal .t-dim { color: rgba(255, 255, 255, .38); }
.terminal .t-ok  { color: #7ee2b8; }

.terminal .caret { animation: caret-blink 1.1s steps(1) infinite; }

@keyframes caret-blink { 50% { opacity: 0; } }

/* ---------- 通用区块 ---------- */
.section-head { max-width: 640px; margin: 56px 0 32px; }
.section-head:first-child { margin-top: 0; }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -.03em;
}

.section-sub {
  margin-top: 14px;
  font-size: 15px;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- 滚动进入动画（JS IntersectionObserver 加 .in） ---------- */
html.anim .reveal {
  opacity: 0;
  transform: translateY(24px) scale(.988);
  transition: opacity .7s var(--ease-ios), transform .7s var(--ease-ios);
  will-change: opacity, transform;
}

html.anim .reveal.in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 能力卡三列的入场 stagger */
html.anim .grid-3 > .reveal:nth-child(2) { transition-delay: 80ms; }
html.anim .grid-3 > .reveal:nth-child(3) { transition-delay: 160ms; }

/* ---------- 卡片 ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 32px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.card-head h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.card-head h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
}

/* 能力卡（首页三列） */
.feature {
  padding: 28px;
  transition: translate .5s var(--ease-ios), scale .5s var(--ease-ios),
              box-shadow .5s var(--ease-ios), border-color .5s var(--ease-ios);
}

.feature:hover {
  translate: 0 -4px;
  scale: 1.003;
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.feature-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  transition: transform .45s var(--ease-spring);
}

.feature:hover .feature-ico { transform: translateY(-3px) scale(1.04); }

.feature-ico svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature h3 {
  margin-top: 18px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.feature p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  text-wrap: pretty;
}

/* 混淆入口横条 */
.feature-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.feature-strip h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.feature-strip > div > p { margin-top: 6px; max-width: 560px; }

/* ---------- 公告 ---------- */
.ann-list { display: flex; flex-direction: column; gap: 12px; }

.ann {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--fg);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  font-size: 14px;
}

.ann.warn     { border-left-color: var(--warn); }
.ann.critical { border-left-color: var(--bad); }

.ann-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ann-head strong { font-size: 14px; font-weight: 600; }
.ann-head time { color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .03em; }
.ann-body { margin-top: 6px; color: var(--fg-2); font-size: 13.5px; overflow-wrap: anywhere; white-space: pre-wrap; }

/* ---------- 表单 ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }

.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.form-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.form-inline input, .form-inline select { flex: 1 1 180px; width: auto; }

.field { display: block; }

.field > span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-2);
  margin-bottom: 6px;
}

.field small { display: block; margin-top: 5px; }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color .3s var(--ease-ios), background-color .3s var(--ease-ios),
              box-shadow .3s var(--ease-ios);
}

textarea { resize: vertical; min-height: 96px; line-height: 1.7; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--fg);
}

input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

select { cursor: pointer; }

/* 步进码输入（管理台） */
.stepup {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.stepup input {
  width: 88px;
  text-align: center;
  font-family: var(--font-mono);
  letter-spacing: .1em;
}

/* 复选行 */
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color .3s var(--ease-out);
}

.check:hover { border-color: var(--border-strong); }

.check input {
  width: auto;
  margin: 4px 0 0;
  accent-color: var(--fg);
  flex: none;
}

.check span { display: block; font-size: 14px; }
.check small { display: block; margin-top: 3px; font-weight: 400; }

/* 表单提示 */
.form-msg {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 13.5px;
  color: var(--fg-2);
}

.form-msg.error { border-color: rgba(220, 38, 38, .3); background: rgba(220, 38, 38, .06); color: var(--bad-ink); }

/* 生成结果 */
.gen-result {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
}

.gen-result .card-head { margin-bottom: 10px; }

.gen-result pre {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--fg-2);
  white-space: pre;
}

/* 密钥/URI 行 */
.secret-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.secret-row code {
  flex: 1 1 240px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.secret-row code.uri { font-size: 11px; }

/* ---------- 分段页签 ---------- */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  max-width: 100%;
  overflow-x: auto;
}

.tabs-center { display: flex; justify-content: center; }

.tab {
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .3s var(--ease-ios), color .3s var(--ease-ios),
              box-shadow .3s var(--ease-ios), transform .3s var(--ease-spring);
}

.tab:active { transform: scale(.97); }

.tab.active {
  background: var(--card);
  color: var(--fg);
  box-shadow: var(--shadow-sm);
}

/* ---------- 页头（控制台/管理/混淆页） ---------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.page-head h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -.03em;
}

.license-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--badge-bg);
  font-size: 12.5px;
  color: var(--fg-2);
}

.panel { display: grid; gap: 24px; }

/* ---------- 键值对 ---------- */
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 16px; font-size: 14px; }

.kv dt { color: var(--muted); }
.kv dd { overflow-wrap: anywhere; }

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th, .table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td.wrap { white-space: normal; overflow-wrap: anywhere; min-width: 120px; }

.table th {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-soft);
  letter-spacing: .02em;
}

.table tbody tr { transition: background-color .25s var(--ease-out); }
.table tbody tr:hover { background: var(--hover-bg); }
.table tbody tr:last-child td { border-bottom: 0; }

.table-compact th, .table-compact td { padding: 8px 12px; font-size: 12.5px; }

.pager { justify-content: center; margin-top: 16px; }

/* ---------- 状态徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--fg-2);
  white-space: nowrap;
}

.badge-good {
  border-color: rgba(22, 163, 74, .25);
  background: rgba(22, 163, 74, .09);
  color: var(--ok-ink);
}

.badge-warn {
  border-color: rgba(217, 119, 6, .25);
  background: rgba(217, 119, 6, .09);
  color: var(--warn-ink);
}

.badge-bad {
  border-color: rgba(220, 38, 38, .25);
  background: rgba(220, 38, 38, .09);
  color: var(--bad-ink);
}

/* ---------- 拖放区 ---------- */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .3s var(--ease-out), background-color .3s var(--ease-out);
}

.dropzone:hover, .dropzone.drag {
  border-color: var(--fg);
  background: var(--bg-soft);
}

.dropzone-inner strong { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.dropzone-inner span { display: block; margin-top: 6px; }

.dropzone-file code {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.dropzone-file span { display: block; margin-top: 4px; }

/* ---------- 进度条 ---------- */
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 16px;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--fg);
  transition: width .3s var(--ease-ios);
}

/* ---------- 条目清单 ---------- */
.notes { display: flex; flex-direction: column; gap: 12px; }

.notes li {
  padding-left: 16px;
  border-left: 2px solid var(--border-strong);
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.75;
  text-wrap: pretty;
}

.notes strong { color: var(--fg); font-weight: 600; }

/* ---------- 登录卡 ---------- */
.auth-wrap { padding: 24px 0 32px; }

.auth-card {
  max-width: 440px;
  margin: 0 auto;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

html.anim .auth-card { animation: authCardIn .5s var(--ease-ios) both; }

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 下载状态 ---------- */
#dlStatus:empty, #dlStatus2:empty, #obfStatus:empty, #obfWarn:empty { display: none; }
#dlStatus, #dlStatus2, #obfStatus { margin-top: 10px; }

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  color: var(--fg);
  max-width: min(480px, 88vw);
  animation: toastIn .4s var(--ease-ios) both;
}

.toast::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.toast.ok::before { background: var(--ok); }
.toast.err::before { background: var(--bad); }

.toast.out { animation: toastOut .3s var(--ease-out) both; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(.97); }
}

/* ---------- 确认对话框 ---------- */
dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  width: min(420px, 88vw);
}

dialog::backdrop {
  background: rgba(11, 11, 12, .45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.dialog-body p { font-size: 14.5px; color: var(--fg); }

.dialog-actions { margin-top: 20px; justify-content: flex-end; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px 32px;
  background: var(--bg);
}

.footer-inner {
  max-width: var(--container);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -.01em;
}

.footer-meta { font-size: 13px; color: var(--muted); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .brand-text small { display: none; }
}

@media (max-width: 720px) {
  main > .view { padding: calc(var(--header-h) + 24px) 20px 48px; }
  .hero { margin-inline: -20px; padding: calc(var(--header-h) + 64px) 20px 40px; }
  .hero h1 { font-size: clamp(36px, 10vw, 56px); }
  .nav { display: none; }
  .topbar-inner { gap: 12px; }
  .card { padding: 24px; border-radius: var(--radius-lg); }
  .kv { grid-template-columns: 100px minmax(0, 1fr); }
  .user-chip { display: none; }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  html.anim .hero-anim, html.anim .reveal { opacity: 1; transform: none; }
  html.anim .auth-card { animation: none; }
}
