/* GARONA 控制中心 — 苹果式简约 + 液态玻璃 */
:root {
  color-scheme: light dark;
  --bg: #eef0f4;
  --bg-2: #e4e7ee;
  --ink: #16171a;
  --ink-2: #5f6570;
  --ink-3: #8a909b;
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .8);
  --glass-line: rgba(255, 255, 255, .75);
  --glass-edge: rgba(15, 18, 26, .08);
  --tile: rgba(255, 255, 255, .5);
  --fill: rgba(120, 124, 138, .14);
  --sep: rgba(22, 23, 26, .09);
  --blue: #0a6cff;
  --green: #22b361;
  --orange: #f08300;
  --red: #f0342b;
  --shadow: 0 1px 1px rgba(16, 20, 32, .04), 0 10px 30px -12px rgba(16, 20, 32, .22);
  --shadow-lift: 0 2px 4px rgba(16, 20, 32, .06), 0 28px 60px -20px rgba(16, 20, 32, .32);
  --specular: rgba(255, 255, 255, .9);
  --blur: saturate(180%) blur(28px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  --spring: linear(0, .0058 1.9%, .0225 3.9%, .0873 7.9%, .5066 21.3%, .6383 25.6%, .7514 30.1%, .8422 34.8%, .8827 37.4%, .9178 40.1%, .9475 43%, .9719 46.2%, .9909 49.8%, 1.0046 53.8%, 1.0125 58.4%, 1.0148 63.7%, 1.0083 77.2%, 1.0002 96.7%, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08080a;
    --bg-2: #101117;
    --ink: #f2f3f6;
    --ink-2: #9ba1ad;
    --ink-3: #6c7280;
    --glass: rgba(30, 32, 40, .58);
    --glass-strong: rgba(34, 36, 45, .8);
    --glass-line: rgba(255, 255, 255, .14);
    --glass-edge: rgba(0, 0, 0, .5);
    --tile: rgba(255, 255, 255, .05);
    --fill: rgba(140, 146, 160, .18);
    --sep: rgba(255, 255, 255, .09);
    --blue: #4c9bff;
    --green: #32d16f;
    --orange: #ffa524;
    --red: #ff5a4e;
    --shadow: 0 1px 1px rgba(0, 0, 0, .4), 0 16px 40px -18px rgba(0, 0, 0, .8);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .5), 0 34px 70px -24px rgba(0, 0, 0, .9);
    --specular: rgba(255, 255, 255, .3);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 90% at 8% 0%, var(--bg-2), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}

/* 背景光晕：给玻璃一点可折射的东西 */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .5;
  animation: drift 26s var(--ease) infinite alternate;
}
.ambient span:nth-child(1) { width: 46vw; height: 46vw; left: -8vw; top: -10vw; background: #8fb6ff; }
.ambient span:nth-child(2) { width: 38vw; height: 38vw; right: -6vw; top: 18vh; background: #ffc59a; animation-delay: -9s; }
.ambient span:nth-child(3) { width: 42vw; height: 42vw; left: 30vw; bottom: -18vw; background: #a5f0d8; animation-delay: -17s; }
@media (prefers-color-scheme: dark) { .ambient span { opacity: .26; } }

button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2.5px solid color-mix(in srgb, var(--blue) 65%, transparent); outline-offset: 3px; }

/* ── 玻璃基底 ─────────────────────────────── */
.sidebar, .card, .refresh, .alert, .application-row, .notice, .empty-state {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: .5px solid var(--glass-line);
  box-shadow: var(--shadow), inset 0 1px 0 var(--specular);
}

/* ── 侧边栏 ───────────────────────────────── */
.sidebar {
  position: fixed;
  z-index: 20;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: 232px;
  padding: 22px 16px 18px;
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 19px;
  font-weight: 640;
  letter-spacing: -.03em;
}
.brand img { border-radius: 7px; }
.brand span { color: var(--blue); }
.sidebar-label {
  margin: 0 8px -8px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.rail { display: flex; flex-direction: column; gap: 2px; }
.rail a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: color .25s, background-color .25s;
}
.rail svg { width: 18px; height: 18px; opacity: .85; }
.rail a:hover { background: var(--fill); color: var(--ink); }
.rail a.current {
  color: var(--ink);
  background: var(--glass-strong);
  box-shadow: 0 1px 2px rgba(16, 20, 32, .08), inset 0 1px 0 var(--specular);
}
.rail a.current::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  width: 3px;
  height: 18px;
  margin-top: -9px;
  border-radius: 0 3px 3px 0;
  background: var(--blue);
}
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.site-link {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  padding: 7px 8px;
  border-radius: 10px;
  transition: background-color .25s, color .25s;
}
.site-link:hover { background: var(--fill); color: var(--ink); }
.device {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--fill);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  min-width: 0;
}
.device span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--ink-3); }
.device[data-state="pending"] i { animation: pulse 1.5s ease-in-out infinite; }
.device[data-state="ok"] i { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.device[data-state="denied"] i { background: var(--red); }

/* ── 页面 ─────────────────────────────────── */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 40px 48px 296px;
}
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: 42px; line-height: 1.1; font-weight: 680; letter-spacing: -.035em; }
.hero-description { margin: 10px 0 0; color: var(--ink-2); font-size: 15.5px; }
.hero-controls { display: flex; align-items: center; gap: 14px; }
.subtitle { margin: 0; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; transition: color .4s; }
.subtitle.flash { color: var(--green); }
.refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 17px 0 14px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
  transition: transform .45s var(--spring), box-shadow .3s, background-color .3s;
}
.refresh svg { width: 16px; height: 16px; }
.refresh:hover { background: var(--glass-strong); box-shadow: var(--shadow-lift), inset 0 1px 0 var(--specular); }
.refresh:active { transform: scale(.94); }
.refresh:disabled { cursor: default; opacity: .7; }
.refresh.spinning svg { animation: spin .9s cubic-bezier(.45, 0, .2, 1) infinite; }

.section-label {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 40px 4px 16px;
}
.section-label h2 { margin: 0; font-size: 20px; font-weight: 620; letter-spacing: -.025em; }
.section-label > span { color: var(--ink-3); font-size: 13px; }
.section-description { margin: -8px 4px 18px; color: var(--ink-2); font-size: 14px; }
.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 13.5px;
  font-weight: 550;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background-color .25s;
}
.text-button:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }

/* ── 订阅卡片 ─────────────────────────────── */
.accounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
  align-items: start;
}
.card {
  position: relative;
  container-type: inline-size;
  border-radius: 28px;
  padding: 24px;
  overflow: hidden;
  animation: rise .6s var(--ease) both;
  transition: box-shadow .4s var(--ease), transform .4s var(--ease);
}
.card:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(n+4) { animation-delay: .18s; }
/* 指针跟随的高光，玻璃的“湿润感” */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .5s var(--ease);
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), var(--specular), transparent 70%);
  mix-blend-mode: soft-light;
}
.card:hover { box-shadow: var(--shadow-lift), inset 0 1px 0 var(--specular); }
.card:hover::after { opacity: 1; }

.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.app-icon {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 11px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(155deg, #43464f, #17181d);
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.card[data-provider="claude"] .app-icon { background: linear-gradient(155deg, #e9926f, #c96442); }
.app-icon svg, .notice-icon svg, .meta-icon svg, .row-icon svg { display: block; width: 100%; height: 100%; }
.identity { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card h2 { margin: 0; font-size: 20px; font-weight: 620; letter-spacing: -.025em; }
.email { margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0; }
.email-text { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-text.is-masked { letter-spacing: .04em; }
.email-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  opacity: .65;
  transition: opacity .2s, background-color .2s, color .2s;
}
.email-toggle:hover { opacity: 1; background: var(--fill); color: var(--ink-2); }
.email-icon { display: block; width: 14px; height: 14px; }
.email-icon svg { display: block; width: 100%; height: 100%; }
.plan {
  align-self: flex-start;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 620;
  text-transform: capitalize;
}

.windows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr));
  gap: 12px;
}
.window {
  --level: var(--green);
  position: relative;
  padding: 16px 16px 14px;
  border-radius: 20px;
  background: var(--tile);
  border: .5px solid var(--sep);
  min-width: 0;
}
.window[data-level="warn"] { --level: var(--orange); }
.window[data-level="low"] { --level: var(--red); }
.window[data-level="none"] { --level: var(--ink-3); }
.window-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
.window-label { color: var(--ink-2); font-size: 13px; font-weight: 550; }
.window-flag {
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--red) 15%, transparent);
  color: var(--red);
  font-size: 11px;
  font-weight: 620;
}
.window.balance .value-number { font-size: 34px; }
.window.balance .value-unit { font-size: 22px; margin: 0 3px 0 0; color: var(--ink-2); }
.card[data-provider="deepseek"] .app-icon { background: linear-gradient(155deg, #6f87ff, #3d59e8); }
.window-value { display: flex; align-items: baseline; margin: 8px 0 12px; white-space: nowrap; }
.value-number {
  font-family: var(--rounded);
  font-size: 38px;
  line-height: 1;
  font-weight: 620;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.window[data-level="low"] .value-number { color: var(--red); }
.window[data-level="none"] .value-number { color: var(--ink-3); }
.value-unit { font-family: var(--rounded); font-size: 19px; font-weight: 620; color: var(--ink-2); margin-left: 2px; }
.value-caption { margin-left: 8px; color: var(--ink-3); font-size: 12.5px; }
.bar { height: 7px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.bar-fill {
  --p: 0%;
  width: var(--p);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--level) 72%, #fff), var(--level));
  box-shadow: 0 0 12px -2px color-mix(in srgb, var(--level) 70%, transparent);
  transition: width 1.1s var(--ease);
}
.window-meta { margin-top: 12px; font-size: 12px; font-variant-numeric: tabular-nums; }
.meta-line { display: flex; align-items: center; gap: 5px; font-weight: 550; }
.meta-icon { width: 13px; height: 13px; flex: none; color: var(--ink-3); }
.meta-sub { color: var(--ink-3); padding-left: 18px; margin-top: 1px; }

/* ── 重置卡：钱包式卡片 ───────────────────── */
.credits { margin-top: 24px; }
.section-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 14px; }
.credits h3 { margin: 0; font-size: 16px; font-weight: 620; letter-spacing: -.02em; }
.count { padding: 2px 9px; border-radius: 999px; background: var(--fill); color: var(--ink-2); font-size: 12px; font-weight: 620; }
.count.has { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.demo-badge { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.stack-toggle {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 550;
  padding: 4px 8px;
  border-radius: 9px;
  white-space: nowrap;
  transition: background-color .25s;
}
.stack-toggle:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }

.wallet {
  list-style: none;
  margin: 0;
  padding: 8px 0 16px;
  display: flex;
  /* 横向叠放：默认压住大半，露出左边一条关键信息 */
  /* 卡宽和叠压量都按可用宽度算，扇开后正好不超出订阅卡 */
  --spread: 18px;
  /* 卡片保持可读的最小宽度，宽度不够就让它们叠得更多 */
  --w: clamp(228px, calc((100% - (var(--count) - 1) * var(--spread)) / (1 + .44 * (var(--count) - 1))), 300px);
  --peek: clamp(76px, calc((100% - var(--w) - (var(--count) - 1) * var(--spread)) / (var(--count) - 1)), calc(var(--w) * .46));
}
.credit-card:nth-child(n+5) { display: none; }
.credit-card {
  position: relative;
  flex: none;
  width: var(--w);
  margin-left: calc(var(--peek) - var(--w));
  z-index: calc(var(--card-index) + 1);
  aspect-ratio: 1.6;
  padding: 12px;
  border-radius: 19px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #f4fbff;
  overflow: hidden;
  /* 缇宝卡：紫金配色 + 星辉质感 */
  background:
    radial-gradient(90% 120% at 82% 8%, rgba(255, 225, 160, .42), transparent 55%),
    radial-gradient(120% 140% at 10% 0%, rgba(255, 255, 255, .34), transparent 50%),
    linear-gradient(145deg, #7b5cc4 0%, #4a2f86 48%, #241a49 100%);
  border: .5px solid rgba(255, 228, 168, .45);
  box-shadow: 0 12px 30px -14px rgba(28, 12, 48, .9), inset 0 1px 0 rgba(255, 240, 210, .5);
  transition: transform .65s var(--spring), box-shadow .45s var(--ease);
}
.credit-card:first-child { margin-left: 0; }
.credit-use {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(31,20,57,.82);
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.credit-use:hover { background: rgba(31,20,57,.96); }
.credit-use:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* 卡面图：铺满整张卡，正常显示；文字不压在图上，所以不需要压暗 */
.credit-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: url("/quota-api/card-art") 44% 46%/108% no-repeat;
  opacity: .96;
  transition: opacity .5s var(--ease), transform .8s var(--ease);
  pointer-events: none;
}
.credit-card:hover::before,
.credit-card:focus-within::before,
.credit-card.is-front::before { opacity: 1; transform: scale(1.04); }

/* 前景面：形状由 SVG 裁剪路径定义（见 index.html 的 #tibo-shape），
   一条带起伏的曲线从左边缘约 52% 高度处起，一路下降到底部约 80% 宽处。 */
.credit-label {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0 12px 14px;
  background: linear-gradient(122deg, #fdf4e4 0%, #f8e9d2 46%, #eedcbe 100%);
  color: #4b2a70;
  clip-path: url(#tibo-shape);
  /* 沿撕口投一道阴影，纸边看起来是翘起来的 */
  filter: drop-shadow(1px -2px 2px rgba(42, 20, 62, .38));
}
.shape-defs { position: absolute; width: 0; height: 0; }
.credit-label-head { display: flex; align-items: baseline; gap: 8px; }
.credit-label-head strong { font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.credit-label-sub { font-size: 11px; color: #6b4a8c; margin-top: 1px; }
.credit-label-date { font-size: 11px; color: #7a5a3a; margin-top: 3px; font-variant-numeric: tabular-nums; }
.credit-serial { font-size: 10px; letter-spacing: .1em; color: #8a6a45; font-variant-numeric: tabular-nums; }

/* 掠过卡面的高光 */
.credit-card::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -40% -60%;
  background: linear-gradient(72deg, transparent 42%, rgba(255, 238, 200, .55) 50%, transparent 58%);
  transform: translateX(-30%);
  opacity: 0;
  transition: opacity .5s, transform 1.1s var(--ease);
  pointer-events: none;
}
/* 鼠标进入整摞：横向再散开一点 */
.wallet:hover .credit-card,
.wallet:focus-within .credit-card {
  transform: translateX(calc(var(--card-index) * var(--spread)));
}
/* 指到哪张，那张浮到最上层并完整显示（靠层级盖住右边的，不用把它们推开） */
.wallet .credit-card:hover,
.wallet .credit-card:focus-within,
.wallet .credit-card.is-front {
  z-index: 40;
  transform: translateX(calc(var(--card-index) * var(--spread))) translateY(-10px) scale(1.02);
  box-shadow: 0 26px 50px -18px rgba(8, 12, 24, .95), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.credit-card:hover::after,
.credit-card:focus-within::after,
.credit-card.is-front::after { opacity: .9; transform: translateX(30%); }
/* 被压住时右半边的细节先淡出，浮起来再显示 */
.row-icon {
  width: 30px;
  height: 30px;
  flex: none;
  padding: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .17);
  border: .5px solid rgba(255, 255, 255, .3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.pill {
  white-space: nowrap;
  border: .5px solid rgba(255, 255, 255, .42);
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .19);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  transition: transform .45s var(--spring), background-color .3s;
}
.pill:hover { background: rgba(255, 255, 255, .32); }
.pill:active { transform: scale(.93); }
.list { list-style: none; margin: 0; padding: 0; }
.row.empty {
  padding: 18px;
  border-radius: 16px;
  background: var(--tile);
  border: .5px dashed var(--sep);
  color: var(--ink-2);
  font-size: 13.5px;
}

/* ── 申请列表 ─────────────────────────────── */
.applications-section { margin-top: 8px; }
#application-list { display: flex; flex-direction: column; gap: 12px; }
.application-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 20px;
}
.application-name { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; }
.application-email { margin: 3px 0 0; color: var(--ink-2); font-size: 13px; }
.application-purpose { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.application-usage { margin-top: 3px; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.application-quota { margin-top: 6px; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.application-actions .quota { color: var(--blue); }
.application-state {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 620;
  background: var(--fill);
  color: var(--ink-2);
}
.application-state[data-state="pending"] { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.application-state[data-state="approved"] { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.application-state[data-state="rejected"], .application-state[data-state="revoked"] { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.application-actions { display: flex; gap: 8px; }
.application-actions button {
  border: .5px solid var(--sep);
  background: var(--tile);
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 560;
  transition: transform .45s var(--spring), background-color .25s, color .25s;
}
.application-actions button:active { transform: scale(.94); }
.application-actions .approve { background: var(--blue); border-color: transparent; color: #fff; }
.application-actions .approve:hover { background: color-mix(in srgb, var(--blue) 88%, #000); }
.application-actions .reject:hover, .application-actions .revoke:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.empty-state { padding: 26px; border-radius: 20px; color: var(--ink-2); font-size: 14px; text-align: center; }

/* ── 提示条 ───────────────────────────────── */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  margin: 22px 0 0;
  border-radius: 16px;
  font-size: 14px;
  --tone: var(--orange);
}
.notice[data-kind="error"] { --tone: var(--red); }
.notice[data-kind="info"] { --tone: var(--blue); }
.notice-icon { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--tone); }
.notice.inline {
  margin: 0 0 16px;
  padding: 12px 14px;
  font-size: 13px;
  background: color-mix(in srgb, var(--tone) 10%, transparent);
  border-color: color-mix(in srgb, var(--tone) 22%, transparent);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* ── 骨架屏 ───────────────────────────────── */
.skeleton { animation: none; }
.sk { display: block; background: var(--fill); border-radius: 10px; animation: pulse 1.5s ease-in-out infinite; }
.sk-icon { width: 46px; height: 46px; border-radius: 14px; flex: none; }
.sk-line { height: 12px; margin: 5px 0; }
.w40 { width: 40%; } .w60 { width: 60%; }
.sk-block { height: 148px; border-radius: 20px; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 48px;
  padding-top: 18px;
  border-top: .5px solid var(--sep);
  color: var(--ink-3);
  font-size: 12px;
}

/* ── 弹窗 ─────────────────────────────────── */
.alert {
  width: min(380px, calc(100% - 40px));
  padding: 0;
  border-radius: 26px;
  color: var(--ink);
  background: var(--glass-strong);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  backdrop-filter: saturate(180%) blur(40px);
  box-shadow: 0 40px 90px -30px rgba(10, 14, 24, .7), inset 0 1px 0 var(--specular);
}
.alert[open] { animation: pop .5s var(--spring); }
.alert::backdrop { background: rgba(10, 12, 18, .3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.alert-body { padding: 24px 22px 20px; text-align: center; }
.alert-body .eyebrow { text-align: center; }
.alert-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--orange) 16%, transparent);
  color: var(--orange);
  font-size: 11px;
  font-weight: 620;
}
.alert h2 { margin: 12px 0 8px; font-size: 18px; font-weight: 620; letter-spacing: -.02em; }
.alert p { margin: 0; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.alert-note { margin-top: 12px !important; color: var(--ink-2); font-size: 12.5px !important; }
.alert label { display: block; margin-top: 16px; text-align: left; color: var(--ink-2); font-size: 12.5px; }
.alert input[type="number"] {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 11px 13px;
  border-radius: 14px;
  border: .5px solid var(--sep);
  background: var(--tile);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.alert textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 11px 13px;
  border-radius: 14px;
  border: .5px solid var(--sep);
  background: var(--tile);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  resize: vertical;
}
#review-error:not(:empty) { margin-top: 12px; color: var(--red); font-size: 13px; }
.alert-actions { display: flex; border-top: .5px solid var(--sep); }
.alert-actions button {
  flex: 1;
  height: 50px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 16px;
  transition: background-color .25s;
}
.alert-actions button + button { border-left: .5px solid var(--sep); }
.alert-actions button:hover { background: var(--fill); }
.alert-actions .primary { font-weight: 620; }
.alert-actions button:first-child { border-bottom-left-radius: 26px; }
.alert-actions button:last-child { border-bottom-right-radius: 26px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vw, 4vh, 0) scale(1.15); }
}

/* ── 响应式 ───────────────────────────────── */
@media (max-width: 1000px) {
  .sidebar {
    position: sticky;
    top: 10px;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    margin: 10px 12px 0;
    padding: 10px 12px;
    border-radius: 22px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .sidebar-label { display: none; }
  .brand { padding: 0; font-size: 17px; }
  .rail { flex-direction: row; gap: 4px; margin-left: 6px; }
  .rail a { padding: 8px 12px; font-size: 13.5px; }
  .rail a.current::before { display: none; }
  .sidebar-bottom { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .site-link { display: none; }
  .page { padding: 24px 20px 40px; }
}
@media (max-width: 700px) {
  /* 顶栏空间有限：只留图标 logo，导航文字不换行 */
  .brand { font-size: 0; gap: 0; flex: none; }
  .brand img { width: 24px; height: 24px; }
  .sidebar { overflow: hidden; }
  .rail { margin-left: 4px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail a { white-space: nowrap; gap: 7px; }
  .sidebar-bottom { flex: none; }
  /* 手机上只留状态点，设备名对读屏器仍可见 */
  .device { padding: 8px; }
  .device span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  h1 { font-size: 32px; }
  .hero { align-items: flex-start; }
  .hero-description { font-size: 14px; }
  .hero-controls { width: 100%; justify-content: space-between; }
  .rail a span, .brand { font-size: 13px; }
  .card { padding: 18px; border-radius: 24px; }
  .windows { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .window { padding: 14px 12px 12px; border-radius: 17px; }
  .value-number { font-size: 30px; }
  .value-caption { display: none; }
  .meta-sub { padding-left: 0; }
  .oauth-admin { grid-template-columns: 1fr; padding: 14px; }
  .oauth-admin-actions button { flex: 1; }
  .application-row { grid-template-columns: 1fr; gap: 12px; }
  .footer { flex-direction: column; }
}
@media (max-width: 420px) {
  .rail a { padding: 8px 9px; }
  .rail svg { width: 16px; height: 16px; }
  .device span { max-width: 84px; }
}

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

.activation:not([hidden]) {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 12, 18, .58);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.activation-card {
  width: min(100%, 440px);
  padding: 34px;
  border: 1px solid var(--glass-line);
  border-radius: 28px;
  background: var(--glass-strong);
  color: var(--ink);
  box-shadow: 0 28px 100px rgba(0, 0, 0, .3);
  animation: rise .3s var(--ease) both;
}
.activation-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px; color: white; background: linear-gradient(145deg, #5882ff, #8e65f2); font-size: 20px; font-weight: 700; }
.activation-eyebrow { margin: 22px 0 7px; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.activation-card h2 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.activation-card > p:not(.activation-eyebrow) { margin: 9px 0 22px; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.activation-card code { display: inline-block; margin-top: 8px; padding: 5px 7px; border-radius: 7px; background: var(--fill); font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.activation-command { display: flex; align-items: center; gap: 8px; margin: -9px 0 4px; }
.activation-command code { min-width: 0; flex: 1; }
.activation-command button { flex: none; border: 0; border-radius: 10px; padding: 9px 12px; background: var(--blue); color: white; font-size: 12px; font-weight: 650; }
#device-command-status { min-height: 18px; margin: 4px 0 14px; color: var(--ink-2); font-size: 12px; }
.activation-card form label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.oauth-admin { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; margin: 0 4px 18px; padding: 16px 18px; border: 1px solid var(--glass-line); border-radius: 16px; background: color-mix(in srgb, var(--blue) 5%, var(--tile)); }
.oauth-admin-copy { display: grid; gap: 4px; }
.oauth-admin-copy strong { font-size: 14px; font-weight: 650; }
.oauth-admin-copy span { color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.oauth-admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.oauth-admin-actions button, .oauth-flow-panel .reauth-link, .oauth-flow-panel .reauth-callback button { width: fit-content; border: 0; border-radius: 10px; padding: 10px 13px; background: var(--blue); color: white; font: inherit; font-size: 12px; font-weight: 650; text-decoration: none; cursor: pointer; }
.oauth-admin-actions button:disabled, .oauth-flow-panel button:disabled { opacity: .55; cursor: wait; }
.oauth-flow-panel { display: grid; gap: 10px; grid-column: 1 / -1; min-width: 0; }
.oauth-flow-panel[hidden] { display: none; }
.oauth-flow-panel .reauth-message { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.6; }
.oauth-flow-panel .reauth-callback label { color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.oauth-flow-panel input { width: 100%; min-width: 0; border: 1px solid var(--glass-line); border-radius: 10px; padding: 11px 12px; background: var(--tile); color: var(--ink); font: inherit; font-size: 13px; }
.card .oauth-flow-panel { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--glass-line); }
.card .reauth-start { margin-top: 12px; padding: 9px 12px; border: 1px solid var(--glass-line); border-radius: 10px; background: color-mix(in srgb, var(--blue) 10%, var(--tile)); color: var(--blue); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.card .reauth-start:disabled { opacity: .6; cursor: wait; }
.card .reauth-hint { margin: 12px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.reauth-callback { display: grid; gap: 8px; }
.reauth-callback[hidden], .reauth-link[hidden] { display: none; }
.reauth-callback input { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid var(--glass-edge); border-radius: 10px; outline: none; background: var(--tile); color: var(--ink); font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.reauth-callback input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.reauth-callback button { margin-top: 2px; }
.activation-row { display: flex; gap: 8px; }
.activation-row input { width: 0; min-width: 0; flex: 1; height: 46px; padding: 0 13px; border: 1px solid var(--glass-edge); border-radius: 13px; outline: none; background: var(--tile); color: var(--ink); font: 14px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.activation-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.activation-row button { border: 0; border-radius: 13px; padding: 0 17px; background: var(--blue); color: white; font-size: 13px; font-weight: 650; white-space: nowrap; }
.activation-row button:disabled { opacity: .55; cursor: wait; }
#activation-error { min-height: 20px; margin: 8px 0 0; color: #ff5c67; font-size: 12px; }
@media (max-width: 520px) { .activation-card { padding: 27px 22px; border-radius: 24px; } .activation-row button { padding: 0 12px; } }
