/* RT WeChat 管理面板：与模块 RtTheme 同一套亮色调色板、圆角与动效曲线。 */

:root {
  color-scheme: light;
  --canvas: #f4f5f7;
  --surface: #ffffff;
  --surface-muted: #f0f2f4;
  --hairline: #e6e9ec;
  --ink: #0f1512;
  --ink-2: #5c6661;
  --ink-3: #9aa29e;
  --accent: #07a35a;
  --accent-strong: #05783f;
  --accent-soft: #e4f5eb;
  --accent-glow: #6adba2;
  --amber: #a86200;
  --amber-soft: #fff3de;
  --danger: #d63a40;
  --danger-soft: #fdebec;
  --shadow-rgb: 10 26 18;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.05, 0.7, 0.1, 1);
  --ease-in: cubic-bezier(0.3, 0, 0.8, 0.15);
  /* Compose spring(0.72, 520) / spring(0.9, 380) / spring(0.5, 600) 的阶跃响应 */
  --spring: linear(0, 0.0454, 0.1473, 0.2827, 0.4213, 0.5542, 0.6733, 0.7744, 0.8563, 0.9217, 0.9678, 0.9998, 1.0202, 1.0317, 1.0367, 1.037, 1.0343, 1.03, 1.0249, 1.0198, 1.015, 1.0106, 1.0071, 1.0043, 1.0022, 1.0007, 0.9997, 0.999, 0.9987, 0.9986, 0.9986, 0.9988, 0.9989, 0.9991, 0.9993, 0.9995, 1);
  --spring-soft: linear(0, 0.0541, 0.1686, 0.3048, 0.44, 0.5624, 0.6669, 0.7524, 0.8202, 0.8724, 0.9116, 0.9403, 0.961, 0.9754, 0.9853, 0.9919, 0.9961, 0.9987, 1.0001, 1.0009, 1.0012, 1.0013, 1.0012, 1.0011, 1);
  --spring-pop: linear(0, 0.0731, 0.2331, 0.4403, 0.6506, 0.8364, 0.9784, 1.0804, 1.139, 1.161, 1.156, 1.1331, 1.1009, 1.0665, 1.0358, 1.0099, 0.9912, 0.9797, 0.9746, 0.9741, 0.9771, 0.982, 0.9874, 0.9928, 0.9973, 1.0006, 1.0028, 1.004, 1.0042, 1.0039, 1.0032, 1.0023, 1.0014, 1.0006, 1.0001, 0.9996, 1);
  --t-spring: 490ms;
  --t-soft: 430ms;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;

  --shadow-card: 0 1px 2px rgb(var(--shadow-rgb) / 0.04), 0 10px 30px -18px rgb(var(--shadow-rgb) / 0.16);
  --shadow-float: 0 2px 6px rgb(var(--shadow-rgb) / 0.05), 0 24px 56px -22px rgb(var(--shadow-rgb) / 0.32);
  --gutter: clamp(16px, 4vw, 40px);
  --dock-space: 112px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.57 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-strong); text-decoration: none; }
::selection { background: rgb(7 163 90 / 0.22); }
.mono { font-family: var(--mono); font-variant-ligatures: none; letter-spacing: 0.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }

/* ------------------------------------------------------------ icons */

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }

/* ------------------------------------------------------------ entrance & motion */

.rise {
  animation: rise 480ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }

.view-leave { animation: leave 160ms var(--ease-in) both; }
@keyframes leave { to { opacity: 0; transform: translateY(-8px); } }

.press { transition: transform 300ms var(--spring); }
.press:active { transform: scale(0.97); transition: transform 90ms var(--ease); }

/* ------------------------------------------------------------ login */

.login {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px var(--gutter);
  overflow: hidden;
  background: var(--canvas);
}
.login-glow { position: absolute; inset: -20%; pointer-events: none; filter: blur(60px); opacity: 0.9; }
.login-glow span {
  position: absolute;
  border-radius: 50%;
  animation: drift 22s ease-in-out infinite alternate;
}
.login-glow span:nth-child(1) { width: 46vmax; height: 46vmax; left: 8%; top: 4%; background: radial-gradient(closest-side, rgb(106 219 162 / 0.42), transparent); }
.login-glow span:nth-child(2) { width: 40vmax; height: 40vmax; right: 4%; bottom: 0; background: radial-gradient(closest-side, rgb(228 245 235 / 0.95), transparent); animation-duration: 26s; animation-delay: -8s; }
.login-glow span:nth-child(3) { width: 30vmax; height: 30vmax; left: 46%; top: 40%; background: radial-gradient(closest-side, rgb(112 214 255 / 0.16), transparent); animation-duration: 30s; animation-delay: -14s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vmax, -4vmax, 0) scale(1.08); }
  100% { transform: translate3d(-5vmax, 5vmax, 0) scale(0.94); }
}
.login::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  padding: 40px 32px 32px;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.9), rgb(255 255 255 / 0.78));
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--shadow-float), inset 0 1px 0 rgb(255 255 255 / 0.95), inset 0 0 0 1px rgb(230 233 236 / 0.7);
  animation: card-in 720ms var(--ease-out) both 80ms;
}
@keyframes card-in { from { opacity: 0; transform: translateY(28px) scale(0.97); } }
.login-card.shake { animation: shake 420ms var(--ease); }
.login-card.leaving { animation: card-out 380ms var(--ease-in) forwards; }
@keyframes card-out { to { opacity: 0; transform: translateY(-12px) scale(0.98); filter: blur(4px); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

.brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: block;
  object-fit: cover;
  box-shadow: 0 10px 24px -10px rgb(var(--shadow-rgb) / 0.45), inset 0 0 0 1px rgb(255 255 255 / 0.4);
}
.login-card .brand-mark { margin: 0 auto 28px; animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-4px); } }
.login-card form { display: grid; gap: 14px; }
/* 密码框与登录按钮之间：左侧错误提示，最右侧「记住我」 */
.login-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: -2px 2px 0; }
.login-error { flex: 1; min-width: 0; min-height: 22px; color: var(--danger); font-size: 13px; line-height: 22px; }
.remember {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 22px;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.remember input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.remember .check { width: 18px; height: 18px; border-radius: 6px; }
.remember .check svg { width: 12px; height: 12px; }
.remember input:checked + .check { background: var(--accent); box-shadow: inset 0 0 0 1.6px var(--accent); }
.remember input:checked + .check svg { stroke-dashoffset: 0; }
.remember input:focus-visible + .check { outline: 2px solid var(--accent); outline-offset: 2px; }
.remember:active .check { transform: scale(0.88); }
.remember:hover { color: var(--ink); }
.login-card .btn { height: 48px; border-radius: 16px; font-size: 15px; margin-top: 6px; }

/* ------------------------------------------------------------ fields & buttons */

.field { position: relative; display: block; }
.field input, .field textarea, .input {
  width: 100%;
  height: 48px;
  padding: 18px 16px 6px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  outline: none;
  transition: border-color 200ms var(--ease), box-shadow 260ms var(--ease), background 200ms var(--ease);
}
.field span {
  position: absolute;
  left: 17px;
  top: 14px;
  color: var(--ink-3);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 260ms var(--ease), color 200ms var(--ease);
}
.field input:focus + span, .field input:not(:placeholder-shown) + span { transform: translateY(-8px) scale(0.78); color: var(--ink-2); }
.field input:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgb(7 163 90 / 0.13); }
.input { height: 42px; padding: 0 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  transition: transform 300ms var(--spring), background 200ms var(--ease), color 200ms var(--ease), box-shadow 200ms var(--ease), opacity 200ms;
}
.btn:active:not(:disabled) { transform: scale(0.97); transition: transform 90ms var(--ease); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 6px 16px -8px rgb(var(--shadow-rgb) / 0.6); }
.btn-primary:hover:not(:disabled) { background: #1c2621; }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-muted); }
.btn-soft { background: var(--surface-muted); color: var(--ink); }
.btn-soft:hover:not(:disabled) { background: #e8ebee; }
.btn-accent { background: var(--accent-soft); color: var(--accent-strong); }
.btn-accent:hover:not(:disabled) { background: #d6efe1; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #fadcde; }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; border-radius: 11px; font-size: 13px; }
.btn.loading { pointer-events: none; }
.btn .spin { display: none; }
.btn.loading .spin { display: block; }
.btn.loading .label-idle { opacity: 0.7; }

.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot 800ms linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--ink-2);
  transition: background 200ms var(--ease), color 200ms var(--ease), transform 300ms var(--spring);
}
.icon-btn:hover { background: var(--surface-muted); color: var(--ink); }
.icon-btn:active { transform: scale(0.9); transition: transform 90ms var(--ease); }

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

.app { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 var(--gutter);
  transition: background 260ms var(--ease), box-shadow 260ms var(--ease);
}
.topbar.scrolled {
  background: rgb(244 245 247 / 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgb(230 233 236 / 0.9);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; letter-spacing: -0.2px; }
.brand .brand-mark { width: 30px; height: 30px; border-radius: 10px; box-shadow: 0 4px 10px -6px rgb(var(--shadow-rgb) / 0.5); }
.brand small { color: var(--ink-3); font-weight: 500; font-size: 12.5px; }
.compact-title {
  font-weight: 600;
  font-size: 15px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 260ms var(--ease), transform 360ms var(--spring-soft);
}
.topbar.titled .compact-title { opacity: 1; transform: none; }
.who { justify-self: end; display: flex; align-items: center; gap: 8px; }
.who-name {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--ink-2);
  font-size: 13px;
}

.view {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 8px var(--gutter) calc(var(--dock-space) + env(safe-area-inset-bottom, 0px));
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 24px; }
.page-title { margin: 0; font-size: clamp(28px, 4vw, 34px); line-height: 1.2; font-weight: 600; letter-spacing: -0.9px; }
.page-sub { margin: 6px 0 0; color: var(--ink-2); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.card-title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
.card-body { padding: 18px 22px 22px; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-strong); font-weight: 500; font-size: 13px; padding: 6px 8px; margin: -6px -8px; border-radius: 10px; transition: background 200ms; }
.link-btn:hover { background: var(--accent-soft); }

/* ------------------------------------------------------------ dock (floating glass navigation) */

.dock {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  width: min(480px, calc(100% - 32px));
  height: 64px;
  padding: 6px;
  border-radius: 32px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.94), rgb(255 255 255 / 0.78) 50%, rgb(240 242 244 / 0.92));
  box-shadow: 0 22px 48px -18px rgb(var(--shadow-rgb) / 0.34), 0 2px 8px rgb(var(--shadow-rgb) / 0.05),
    inset 0 0 0 1px rgb(230 233 236 / 0.55);
  animation: dock-in 700ms var(--spring) both 200ms;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dock {
    background: linear-gradient(180deg, rgb(255 255 255 / 0.62), rgb(255 255 255 / 0.4) 50%, rgb(240 242 244 / 0.56));
    backdrop-filter: blur(22px) saturate(190%);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
  }
}
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 40px) scale(0.92); } }
.dock::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 1px;
  height: 1.4px;
  border-radius: 1px;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  pointer-events: none;
}
.dock::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.95), rgb(230 233 236 / 0.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.dock-lens {
  position: absolute;
  left: 6px;
  top: 6px;
  height: 52px;
  border-radius: 26px;
  pointer-events: none;
  will-change: transform;
  background:
    radial-gradient(120% 90% at 30% 0%, rgb(255 255 255 / 0.55), transparent 60%),
    linear-gradient(135deg, rgb(255 255 255 / 0.72), rgb(228 245 235 / 0.62) 55%, rgb(106 219 162 / 0.22));
  box-shadow: 0 6px 16px -6px rgb(var(--shadow-rgb) / 0.22), inset 0 -10px 18px -14px rgb(var(--shadow-rgb) / 0.28);
}
.dock-lens::before {
  /* 棱镜描边 */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 210deg, rgb(112 214 255 / 0.4), rgb(255 255 255 / 0.2), rgb(255 154 213 / 0.33), rgb(255 255 255 / 0.2), rgb(168 240 200 / 0.4), rgb(112 214 255 / 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.dock-lens::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: 2px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  box-shadow: 0 47px 0 0.4px rgb(106 219 162 / 0.6);
}
.dock-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  transition: color 260ms var(--ease);
}
.dock-item .i { width: 22px; height: 22px; will-change: transform; }
.dock-item span { will-change: transform; }
.dock-item[aria-selected="true"] { color: var(--accent-strong); }

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

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { padding: 20px 22px; overflow: hidden; }
.stat-label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.stat-value { margin-top: 6px; font-size: 34px; line-height: 1.15; font-weight: 600; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat-foot { margin-top: 8px; color: var(--ink-3); font-size: 12.5px; }
.stat-foot b { color: var(--ink-2); font-weight: 500; }
.stat.accent::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(106 219 162 / 0.28), transparent);
  pointer-events: none;
}

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.chart-card { display: flex; flex-direction: column; }
.chart-card .card-body { flex: 1; display: flex; flex-direction: column; }
.chart-card .chart-wrap { flex: 1; }

/* ------------------------------------------------------------ chart */

.chart-wrap { position: relative; height: 240px; min-height: 240px; margin-top: 8px; }
.chart-wrap svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid line { stroke: var(--hairline); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis text { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-bar { fill: var(--accent); transform-box: fill-box; transform-origin: 50% 100%; transition: opacity 200ms var(--ease); animation: grow 700ms var(--spring) both; animation-delay: calc(var(--i) * 28ms + 120ms); }
@keyframes grow { from { transform: scaleY(0); } }
.chart-hit { fill: transparent; cursor: default; }
.chart-wrap.hovering .chart-bar { opacity: 0.38; }
.chart-wrap.hovering .chart-bar.on { opacity: 1; }
.chart-cap text { fill: var(--ink); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-empty { position: absolute; inset: 0 0 28px; display: grid; place-items: center; color: var(--ink-3); pointer-events: none; }
.tooltip {
  position: absolute;
  z-index: 5;
  min-width: 132px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgb(15 21 18 / 0.92);
  color: #fff;
  font-size: 12.5px;
  pointer-events: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px -12px rgb(var(--shadow-rgb) / 0.5);
  opacity: 0;
  transform: translate(-50%, calc(-100% - 6px)) scale(0.96);
  transition: opacity 160ms var(--ease), transform 260ms var(--spring-soft), left 260ms var(--spring-soft), top 260ms var(--spring-soft);
}
.tooltip.show { opacity: 1; transform: translate(-50%, calc(-100% - 12px)); }
.tooltip b { display: block; font-size: 12px; font-weight: 500; color: rgb(255 255 255 / 0.7); margin-bottom: 4px; }
.tooltip .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.tooltip .key { display: inline-flex; align-items: center; gap: 6px; }
.tooltip .key::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--accent-glow); }
.tooltip .key.fail::before { background: rgb(255 255 255 / 0.4); }

/* ------------------------------------------------------------ lists */

.list { list-style: none; margin: 0; padding: 0; }
.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px 22px;
  border-top: 1px solid var(--hairline);
  transition: background 200ms var(--ease);
}
.recent-item:first-child { border-top: 0; }
.recent-item.clickable { cursor: pointer; }
.recent-item.clickable:hover { background: #fafbfb; }
.recent-main { min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { grid-column: 1; min-width: 0; color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-side { grid-row: 1 / span 2; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 4px; }
.recent-time { color: var(--ink-3); font-size: 12px; }
.empty { padding: 40px 22px; text-align: center; color: var(--ink-3); }
.empty strong { display: block; margin-bottom: 4px; color: var(--ink-2); font-weight: 500; }

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

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  background: var(--surface-muted);
  color: var(--ink-2);
}
.badge.accent { background: var(--accent-soft); color: var(--accent-strong); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.soft-accent { background: #eef8f2; color: #2f7d55; }
.corner-tag {
  position: absolute;
  top: 0;
  right: 0;
  padding: 5px 14px;
  border-radius: 0 var(--r-xl) 0 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
}

/* ------------------------------------------------------------ toolbar & segmented control */

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px; margin-bottom: 16px; }
.seg {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-muted);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.seg::-webkit-scrollbar { display: none; }
.seg-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.08), 0 4px 12px -6px rgb(var(--shadow-rgb) / 0.18);
  transition: transform var(--t-spring) var(--spring), width var(--t-spring) var(--spring);
}
.seg button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
  transition: color 220ms var(--ease);
}
.seg button[aria-selected="true"] { color: var(--ink); }
.seg button em { font-style: normal; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; pointer-events: none; }
.search input { padding-left: 38px; background: var(--canvas); border-color: transparent; }
.search input:focus { background: var(--surface); }
.search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-3);
  font: 11px var(--mono);
  pointer-events: none;
  transition: opacity 160ms;
}
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { opacity: 0; }

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

.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  position: sticky;
  top: 0;
  padding: 14px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.3px;
  white-space: nowrap;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.table td { padding: 14px 12px; border-bottom: 1px solid var(--hairline); vertical-align: middle; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table tbody tr { transition: background 180ms var(--ease); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.row { cursor: pointer; }
.table tbody tr.row:hover { background: #fafbfb; }
.table tbody tr.selected { background: #f3faf6; }
.table tbody tr.selected:hover { background: #ecf7f0; }
.table tbody tr.rise { animation-duration: 420ms; animation-delay: calc(var(--i, 0) * 28ms); }
.cell-note { max-width: 200px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.cell-sub { display: block; color: var(--ink-3); font-size: 12px; }
.cell-clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.col-check { width: 44px; }

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink);
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.code-chip .i { width: 15px; height: 15px; color: var(--ink-3); opacity: 0; transform: scale(0.8); transition: opacity 180ms, transform 300ms var(--spring); }
.code-chip:hover { background: var(--surface-muted); }
.code-chip:hover .i { opacity: 1; transform: none; }
.code-chip.copied { background: var(--accent-soft); color: var(--accent-strong); }
.code-chip.copied .i { opacity: 1; transform: none; color: var(--accent-strong); }
.code-chip .pre { color: var(--ink-3); }
.code-chip.copied .pre { color: inherit; }

/* checkbox */
.check {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1.6px #c9cfcc;
  background: var(--surface);
  transition: background 200ms var(--ease), box-shadow 200ms var(--ease), transform 300ms var(--spring);
  vertical-align: middle;
}
.check svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset 260ms var(--ease) 40ms; }
.check[aria-checked="true"], .check[aria-checked="mixed"] { background: var(--accent); box-shadow: inset 0 0 0 1.6px var(--accent); }
.check[aria-checked="true"] svg { stroke-dashoffset: 0; }
.check[aria-checked="mixed"]::after { content: ""; width: 10px; height: 2.2px; border-radius: 2px; background: #fff; position: absolute; }
.check:active { transform: scale(0.88); }

/* pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--hairline); color: var(--ink-3); font-size: 13px; }
.pager-btns { display: flex; align-items: center; gap: 6px; }
.pager-btns .pg {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.pager-btns .pg:hover:not(:disabled) { background: var(--surface-muted); color: var(--ink); }
.pager-btns .pg[aria-current="page"] { background: var(--ink); color: #fff; }
.pager-btns .pg:disabled { opacity: 0.35; cursor: default; }

/* skeleton */
.sk { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef0f2 0%, #f6f7f8 40%, #eef0f2 80%); background-size: 300% 100%; animation: shimmer 1.4s var(--ease) infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* bulk bar */
.bulkbar {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 32px);
  padding: 8px 8px 8px 18px;
  border-radius: 20px;
  background: rgb(15 21 18 / 0.94);
  color: #fff;
  box-shadow: 0 20px 44px -18px rgb(var(--shadow-rgb) / 0.6);
  transform: translate(-50%, 24px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease), transform var(--t-spring) var(--spring);
  overflow-x: auto;
}
.bulkbar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.bulkbar .count { margin-right: 8px; white-space: nowrap; font-weight: 500; font-variant-numeric: tabular-nums; }
.bulkbar .btn { background: rgb(255 255 255 / 0.1); color: #fff; height: 34px; border-radius: 12px; padding: 0 12px; font-size: 13px; }
.bulkbar .btn:hover { background: rgb(255 255 255 / 0.18); }
.bulkbar .btn.warn { color: #ffb4b7; }
.bulkbar .icon-btn { color: rgb(255 255 255 / 0.7); }
.bulkbar .icon-btn:hover { background: rgb(255 255 255 / 0.12); color: #fff; }

/* ------------------------------------------------------------ overlays */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgb(10 26 18 / 0.26);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 260ms var(--ease) both;
}
.scrim.closing { animation: fade-out 220ms var(--ease-in) forwards; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.dialog-wrap { position: fixed; inset: 0; z-index: 51; display: grid; place-items: center; padding: 20px; pointer-events: none; }
.dialog {
  pointer-events: auto;
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  animation: dialog-in var(--t-spring) var(--spring) both;
  overflow: hidden;
}
.dialog.small { width: min(400px, 100%); }
.dialog.closing { animation: dialog-out 200ms var(--ease-in) forwards; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(0.96); } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 22px 6px 26px; }
.dialog-head h2 { margin: 0; font-size: 19px; line-height: 26px; font-weight: 600; letter-spacing: -0.3px; }
.dialog-body { padding: 12px 26px 8px; overflow-y: auto; transition: height 420ms var(--spring-soft); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 22px; }
.dialog-foot .grow { flex: 1; }
.dialog p { margin: 0; color: var(--ink-2); }

.drawer-wrap { position: fixed; inset: 0; z-index: 51; pointer-events: none; display: flex; justify-content: flex-end; padding: 12px; }
.drawer {
  pointer-events: auto;
  position: relative;
  width: min(540px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  animation: drawer-in 560ms var(--spring-soft) both;
}
.drawer.closing { animation: drawer-out 240ms var(--ease-in) forwards; }
@keyframes drawer-in { from { opacity: 0; transform: translateX(40px); } }
@keyframes drawer-out { to { opacity: 0; transform: translateX(32px); } }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 26px 28px; overscroll-behavior: contain; }

.code-hero { margin: 8px 0 18px; }
.code-hero .label { color: var(--ink-3); font-size: 12px; letter-spacing: 0.3px; }
.code-hero .value { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.code-hero .code-chip { font-size: 17px; margin: 0 -8px; padding: 6px 8px; word-break: break-all; white-space: normal; }
.code-hero .code-chip .i { opacity: 1; transform: none; width: 17px; height: 17px; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0 0 18px; border-radius: var(--r-md); overflow: hidden; background: var(--hairline); box-shadow: 0 0 0 1px var(--hairline); }
.facts div { padding: 12px 14px; background: var(--surface); min-width: 0; }
.facts dt { color: var(--ink-3); font-size: 12px; }
.facts dd { margin: 2px 0 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts .wide { grid-column: 1 / -1; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 10px; font-size: 14px; font-weight: 600; }
.section-title .faint { font-weight: 400; font-size: 12.5px; }

.inline-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; height: 42px; border-radius: 14px; background: var(--surface-muted); padding: 3px; }
.stepper button { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--ink-2); transition: background 200ms, transform 300ms var(--spring); }
.stepper button:hover { background: var(--surface); color: var(--ink); }
.stepper button:active { transform: scale(0.88); transition: transform 90ms; }
.stepper input { width: 64px; height: 36px; border: 0; background: transparent; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.device {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--canvas);
  margin-bottom: 10px;
  animation: rise 420ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
.device.removing { animation: collapse 320ms var(--ease-in) forwards; }
@keyframes collapse { to { opacity: 0; transform: scale(0.97); } }
.device-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.device-name { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.device-name .i { color: var(--ink-3); transition: transform 300ms var(--spring); }
.device-head { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; border-radius: 10px; padding: 2px 4px; margin: -2px -4px; transition: background 200ms var(--ease); }
.device-head:hover { background: rgb(255 255 255 / 0.7); }
.device-head:hover .device-name .i { transform: translateX(2px); }
.device-title { margin-top: 2px; font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }
.code-hero .id-chip { font-size: 13px; }

.ban-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 4px; border-radius: var(--r-md); background: var(--danger-soft); }
.ban-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; color: var(--ink-2); }
.ban-text strong { color: var(--danger); font-size: 14px; font-weight: 600; }
.ban-form { flex-wrap: nowrap; }
.ban-form .input { flex: 1; min-width: 0; }

.binding { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 10px 12px 16px; border-radius: var(--r-md); background: var(--canvas); margin-bottom: 8px; animation: rise 420ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
.binding-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.binding .code-chip { font-size: 12.5px; }

.cell-link { display: block; max-width: 220px; text-align: left; border-radius: 8px; padding: 2px 6px; margin: -2px -6px; transition: background 200ms var(--ease); }
.cell-link:hover { background: var(--surface-muted); }
.cell-link .cell-clip { display: block; }
.device-id { color: var(--ink-3); font-size: 12px; word-break: break-all; }
.device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin-top: 12px; font-size: 13px; }
.device-grid dt { color: var(--ink-3); font-size: 12px; }
.device-grid dd { margin: 1px 0 0; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: -6px; width: 1.5px; background: var(--hairline); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.timeline li.fail::after { box-shadow: inset 0 0 0 2px #d9a3a5; }
.timeline .t-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.timeline .t-meta { color: var(--ink-3); font-size: 12.5px; }

/* create dialog */
.form-row { margin-bottom: 18px; }
.form-label { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 34px;
  padding: 0 14px;
  border-radius: 11px;
  background: var(--surface-muted);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 13px;
  transition: background 220ms var(--ease), color 220ms var(--ease), box-shadow 220ms var(--ease), transform 300ms var(--spring);
}
.chip:hover { color: var(--ink); }
.chip:active { transform: scale(0.94); transition: transform 90ms; }
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1.5px rgb(7 163 90 / 0.35); }
.custom-days { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; animation: rise 360ms var(--ease-out) both; }
.custom-days .input { width: 110px; }
.summary { padding: 12px 14px; border-radius: 14px; background: var(--canvas); color: var(--ink-2); font-size: 13px; }

.result-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.result-head .big { font-size: 17px; font-weight: 600; }
.code-list { list-style: none; margin: 0; padding: 0; max-height: min(46vh, 420px); overflow-y: auto; border-radius: var(--r-md); background: var(--canvas); }
.code-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px 9px 16px; border-top: 1px solid rgb(230 233 236 / 0.7); animation: rise 360ms var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 24) * 30ms); }
.code-list li:first-child { border-top: 0; }
.code-list .idx { color: var(--ink-3); font-size: 12px; width: 28px; font-variant-numeric: tabular-nums; }
.code-list .code { flex: 1; font-family: var(--mono); font-size: 13.5px; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ marks (check / cross drawn like the module) */

.mark { position: relative; width: 40px; height: 40px; flex: none; }
.mark .disc { position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: disc 520ms var(--spring-pop) both; }
.mark.fail .disc { background: var(--danger); }
.mark .halo { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent-glow); animation: halo 900ms var(--ease-out) 220ms both; }
.mark svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mark svg path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 200ms var(--ease) forwards; }
.mark svg path:nth-child(1) { animation-delay: 180ms; animation-duration: 140ms; }
.mark svg path:nth-child(2) { animation-delay: 320ms; animation-duration: 220ms; }
.mark.fail svg path:nth-child(1) { animation-duration: 180ms; }
.mark.fail svg path:nth-child(2) { animation-delay: 380ms; animation-duration: 180ms; }
@keyframes disc { from { transform: scale(0); } }
@keyframes halo { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ------------------------------------------------------------ toast */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 10px 18px 10px 10px;
  border-radius: 20px;
  background: rgb(255 255 255 / 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-float), inset 0 0 0 1px rgb(230 233 236 / 0.8);
  cursor: pointer;
  animation: toast-in 560ms var(--spring) both;
}
.toast.fail { animation: toast-in 560ms var(--spring) both, nudge 420ms var(--ease) 520ms; }
.toast.leaving { animation: toast-out 240ms var(--ease-in) forwards; }
.toast .mark { width: 30px; height: 30px; }
.toast .mark svg { stroke-width: 3.4; }
.toast-text { font-weight: 500; line-height: 1.45; }
@keyframes toast-in { from { opacity: 0; transform: translateY(26px) scale(0.92); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes nudge { 20% { transform: translateX(-6px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-2px); } }

/* ------------------------------------------------------------ settings */

.settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.settings .stack { display: grid; gap: 16px; }
.pw-form { display: grid; gap: 12px; }
.api-base { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--canvas); }
.endpoint { margin-top: 18px; }
.endpoint-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 500; }
.method { padding: 2px 8px; border-radius: 7px; background: var(--ink); color: #fff; font: 600 11px var(--mono); letter-spacing: 0.04em; }
pre.code {
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: #0f1512;
  color: #d8e4dd;
  font: 12.5px/1.6 var(--mono);
  overflow-x: auto;
  white-space: pre;
}
pre.code .k { color: #6adba2; }
pre.code .s { color: #f2d49b; }
pre.code .c { color: #6f7d76; }
.err-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.err-table td { padding: 8px 0; border-top: 1px solid var(--hairline); vertical-align: top; }
.err-table td:first-child { width: 48px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.err-table td:nth-child(2) { width: 120px; font-family: var(--mono); font-size: 12.5px; }

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

@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .settings { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --dock-space: 104px; }
  .topbar { grid-template-columns: 1fr auto; height: 56px; }
  .compact-title { display: none; }
  .brand small { display: none; }
  .stats { gap: 12px; }
  .stat { padding: 16px; }
  .stat-value { font-size: 28px; }
  .toolbar { padding: 10px; }
  .search { max-width: none; flex-basis: 100%; }
  .search kbd { display: none; }
  .chart-wrap { height: 200px; min-height: 200px; }
  .card-head { padding: 18px 18px 0; }
  .card-body { padding: 16px 18px 18px; }
  .recent-item { padding: 12px 18px; }

  /* 表格改为卡片 */
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody { display: block; }
  .table.responsive tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table.responsive td { display: block; padding: 0; border: 0; white-space: normal; }
  .table.responsive td:first-child, .table.responsive td:last-child { padding: 0; }
  .table.responsive td[data-label]::before { content: attr(data-label) "  "; color: var(--ink-3); font-size: 12px; }
  /* 激活码独占首行，状态与摘要在第二行 */
  .table.responsive.codes-table tr { grid-template-columns: auto auto minmax(0, 1fr); align-items: center; }
  .codes-table td.c-check { grid-row: 1; grid-column: 1; }
  .codes-table td.c-code { grid-row: 1; grid-column: 2 / 4; min-width: 0; overflow: hidden; }
  .codes-table td.c-status { grid-row: 2; grid-column: 2; }
  .codes-table td.c-meta { grid-row: 2; grid-column: 3; font-size: 12.5px; color: var(--ink-2); }
  .codes-table td.c-hide { display: none; }
  .codes-table .code-chip { font-size: 12.5px; }
  .table.responsive.events-table tr { grid-template-columns: minmax(0, 1fr) auto; }
  .events-table td.e-time { grid-column: 1; color: var(--ink-3); font-size: 12px; }
  .events-table td.e-result { grid-column: 2; grid-row: 1; justify-self: end; }
  .events-table td.e-code { grid-column: 1 / -1; min-width: 0; overflow: hidden; }
  .events-table td.e-meta { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-2); }
  .events-table td.e-hide { display: none; }
  .table.responsive.devices-table tr { grid-template-columns: minmax(0, 1fr) auto; }
  .devices-table td.v-device { grid-column: 1; min-width: 0; }
  .devices-table td.v-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .devices-table td.v-meta { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-2); }
  .devices-table td.v-hide { display: none; }
  .dock-item { font-size: 10.5px; letter-spacing: 0.2px; }
  .drawer-wrap { padding: 0; padding-top: 48px; }
  .drawer { border-radius: var(--r-xl) var(--r-xl) 0 0; animation-name: sheet-up; }
  .drawer.closing { animation-name: sheet-down; }
  @keyframes sheet-up { from { transform: translateY(48px); opacity: 0; } }
  @keyframes sheet-down { to { transform: translateY(40px); opacity: 0; } }
  .drawer-body { padding: 8px 20px 28px; }
  .dialog-wrap { align-items: end; padding: 0; }
  .dialog { width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .code-hero .code-chip { font-size: 15px; }
  .pager { padding: 12px 18px; }
  .pager .range { display: none; }
}
@media (min-width: 761px) {
  .only-mobile { display: none !important; }
}
@media (max-width: 760px) {
  .only-desktop { display: none !important; }
}

/* ------------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  .login-glow span, .login-card .brand-mark { animation: none !important; }
}

body.bulk-on .toast-host { bottom: calc(160px + env(safe-area-inset-bottom, 0px)); }
.identity-hash { overflow-wrap: anywhere; word-break: break-all; }
/* 弹窗打开时提示条让开底部按钮：桌面贴底，手机底部是面板，改到顶部 */
body.overlay-open .toast-host { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 760px) {
  body.overlay-open .toast-host { top: calc(16px + env(safe-area-inset-top, 0px)); bottom: auto; flex-direction: column; }
}
