/*
 * TG管理系统 · 组件样式。依赖 tokens.css。
 * 章节：基础 / 骨架 / 按钮与表单 / 数据展示 / 总览 / 列表 / 反馈 / 登录页 / 响应式
 */

/* ---------- 基础 ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body { margin: 0; min-height: 100vh; }
h1, h2, h3, h4, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-ring); }

.i {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono { font-family: var(--font-mono); font-size: .9em; letter-spacing: -.01em; }
.muted { color: var(--text-3); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-3);
  font: 600 11px/1 var(--font-mono);
  transition: opacity var(--dur-1);
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 骨架：侧栏 + 顶栏 + 内容 ---------- */

.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px 16px 18px;
  color: var(--rail-text);
  background:
    radial-gradient(120% 50% at 0% 0%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 60%),
    linear-gradient(180deg, var(--rail-bg), var(--rail-bg-2));
  border-right: 1px solid var(--rail-line);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 13px;
  background: transparent;
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--brand) 80%, transparent);
  overflow: hidden;
}
.brand-logo { width: 42px; height: 42px; display: block; border-radius: 13px; }
.brand-text b { display: block; color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .02em; line-height: 1.2; }
.brand-text small {
  display: block;
  margin-top: 3px;
  color: var(--rail-dim);
  font-size: 12px;
  letter-spacing: .04em;
}

.nav { display: grid; gap: 4px; }
.nav-label { padding: 0 12px 6px; color: var(--rail-dim); font-size: 11px; letter-spacing: .14em; }
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--r-md);
  color: var(--rail-text);
  font-weight: 550;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.nav a .i { color: var(--rail-dim); transition: color var(--dur-1); }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a[aria-current="page"] {
  background: var(--rail-active);
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-tint) 16%, transparent);
}
.nav a[aria-current="page"] .i { color: var(--brand-tint); }
.nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--grad-brand);
  box-shadow: 0 0 12px color-mix(in srgb, var(--brand) 80%, transparent);
}
.nav-count {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .08);
  color: var(--rail-text);
  font-style: normal;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.nav-count[data-tone="danger"] { background: #e5455d; color: #fff; }
.nav-count:empty { display: none; }

.rail-foot { margin-top: auto; display: grid; gap: 12px; }
.bot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--rail-line);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.bot-card:hover { background: rgba(255, 255, 255, .09); }
.rail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--rail-line);
  color: var(--rail-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.rail-btn:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.guide-steps { display: grid; gap: 14px; margin: 0; padding: 18px 22px 22px 40px; }
.guide-steps li { display: grid; gap: 4px; }
.guide-steps b { font-size: 14px; }
.guide-steps span { color: var(--text-2); font-size: 13px; line-height: 1.55; }
.bot-text { min-width: 0; }
.bot-text b {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bot-text small { display: block; color: var(--rail-dim); font-size: 12px; }
.pulse { position: relative; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--rail-dim); }
[data-state="online"] .pulse { background: #22c58b; animation: pulse 2.4s var(--ease) infinite; }
[data-state="idle"] .pulse { background: #e9a23b; }
[data-state="error"] .pulse { background: #ff5a6e; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 139, .55); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(34, 197, 139, 0); }
}
.rail-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rail .icon-btn { width: auto; background: rgba(255, 255, 255, .04); border-color: var(--rail-line); color: var(--rail-text); }
.rail .icon-btn:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.rail-hint { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--rail-dim); font-size: 11.5px; }
.rail-hint kbd { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: var(--rail-text); }

.lang-switch { position: relative; }
.lang-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
}
.lang-btn::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: .65;
}
.lang-menu {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
}
.lang-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  text-align: left;
}
.lang-menu button:hover,
.lang-menu button[aria-selected="true"] { background: var(--surface-3); }
.lang-region {
  margin: 8px 8px 2px;
  color: var(--text-3);
  font-size: 10px;
  letter-spacing: .14em;
}
.rail .lang-btn {
  border-color: var(--rail-line);
  background: rgba(255, 255, 255, .04);
  color: #fff;
}
.rail .lang-menu {
  background: #141b2b;
  color: #e7eefc;
  border-color: rgba(255, 255, 255, .08);
}
.rail .lang-menu button:hover,
.rail .lang-menu button[aria-selected="true"] { background: rgba(255, 255, 255, .08); }
.rail .lang-region { color: var(--rail-dim); }
.auth-panel { position: relative; }
.auth-lang { position: absolute; top: 22px; right: 22px; width: 168px; z-index: 2; }
.auth-lang .lang-menu { top: calc(100% + 6px); bottom: auto; left: auto; width: 220px; }
.lang-mobile { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 var(--gutter);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { min-width: 0; }
.crumb { display: block; color: var(--text-3); font-size: 12px; letter-spacing: .02em; }
.topbar h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.sync { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.is-spinning .i { animation: spin .9s linear infinite; }
.mobile-only, .bot-pill { display: none !important; }

.content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
}
.view { display: grid; gap: 20px; animation: view-in var(--dur-3) var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }
.foot { margin-top: auto; padding: 18px var(--gutter) 28px; text-align: center; color: var(--text-3); font-size: 12px; }

/* ---------- 按钮与表单 ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface-3);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  transition:
    background var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease),
    box-shadow var(--dur-1) var(--ease),
    color var(--dur-1),
    transform var(--dur-1);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .i { width: 17px; height: 17px; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 6px 16px -8px var(--brand); }
.btn.primary:hover:not(:disabled) { background: var(--brand-strong); }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); border-color: color-mix(in srgb, var(--text-3) 55%, var(--line-strong)); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.soft:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 18%, transparent); }
.btn.danger { background: var(--danger); color: #fff; box-shadow: 0 6px 16px -8px var(--danger); }
.btn.danger:hover:not(:disabled) { filter: brightness(.94); }
.btn.sm { height: 30px; padding: 0 11px; gap: 6px; border-radius: 8px; font-size: 12.5px; }
.btn.sm .i { width: 14px; height: 14px; }
.btn.lg { height: 46px; padding: 0 20px; border-radius: 12px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.is-busy { color: transparent !important; pointer-events: none; }
.btn.is-busy:disabled { opacity: 1; }
.btn.is-busy > * { visibility: hidden; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
.btn.primary.is-busy::after, .btn.danger.is-busy::after { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-2);
  transition: background var(--dur-1), color var(--dur-1), border-color var(--dur-1);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.field { position: relative; display: flex; align-items: center; min-width: 0; }
.field > .i { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color var(--dur-1), box-shadow var(--dur-1), background var(--dur-1);
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: color-mix(in srgb, var(--text-3) 55%, var(--line-strong)); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.field > .i ~ .input { padding-left: 38px; }
.field kbd { position: absolute; right: 10px; pointer-events: none; }
.field.has-kbd .input { padding-right: 38px; }
.field .input:focus ~ kbd, .field .input:not(:placeholder-shown) ~ kbd { opacity: 0; }
.select {
  width: auto;
  min-width: 180px;
  max-width: 280px;
  padding-right: 34px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238592A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  text-overflow: ellipsis;
  cursor: pointer;
}
.grow { flex: 1; min-width: 220px; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--dur-1), color var(--dur-1), box-shadow var(--dur-1);
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 27, 45, .08), 0 0 0 1px var(--line); }
.seg .n { color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.seg .n[data-tone] { color: var(--tone); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1), opacity var(--dur-1);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tone, var(--text-3)); }
.chip.all::before { display: none; }
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip .n { color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip[aria-pressed="true"] .n { color: color-mix(in srgb, var(--surface) 62%, transparent); }
.chip.is-empty:not([aria-pressed="true"]) { opacity: .5; }

.switch-wrap { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--r-full);
  background: var(--line-strong);
  transition: background var(--dur-2) var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 27, 45, .3);
  transition: transform var(--dur-2) var(--ease);
}
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.switch:disabled { opacity: .55; cursor: wait; }

input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }
input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .3; }

/* ---------- 数据展示 ---------- */

.panel {
  min-width: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 15px; font-weight: 650; }
.panel-head.toolbar { flex-wrap: wrap; }
.panel-body { padding: 18px 20px 20px; }
.meta { color: var(--text-3); font-size: 12.5px; }
.toolbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.panel-head > .field { width: min(300px, 100%); }
.link { display: inline-flex; align-items: center; gap: 2px; color: var(--brand); font-size: 13px; font-weight: 600; }
.link .i { width: 15px; height: 15px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: var(--r-full);
  background: var(--tone-soft, var(--gray-soft));
  color: var(--tone, var(--text-2));
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  color: hsl(var(--hue, 220) 55% 36%);
  background: hsl(var(--hue, 220) 75% 93%);
  box-shadow: inset 0 0 0 1px hsl(var(--hue, 220) 50% 50% / .12);
}
.avatar.square { border-radius: 11px; }
.avatar.is-serial { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: -.04em; }
[data-theme="dark"] .avatar { color: hsl(var(--hue, 220) 85% 78%); background: hsl(var(--hue, 220) 35% 20%); }

.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-text { min-width: 0; }
.who-text b {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.who-text small { display: flex; align-items: center; gap: 6px; margin-top: 1px; color: var(--text-3); font-size: 12px; }

.id-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  margin-left: -4px;
  padding: 0 4px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.id-chip .i { width: 12px; height: 12px; opacity: 0; transition: opacity var(--dur-1); }
.id-chip:hover { background: var(--surface-3); color: var(--text-2); }
.id-chip:hover .i, .id-chip:focus-visible .i { opacity: 1; }

.link-btn {
  display: block;
  max-width: 220px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-weight: 500;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-btn:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  height: 42px;
  padding: 0 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  text-align: left;
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background var(--dur-1); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.is-selected { background: var(--brand-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.empty-row:hover { background: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .right { text-align: right; }
.table .check { width: 44px; padding-right: 0; }
.cell-actions { display: flex; justify-content: flex-end; gap: 6px; }
.cell-sub { display: block; color: var(--text-3); font-size: 12px; }
.cell-sub[data-tone] { color: var(--tone); }
.stack-cell { display: grid; gap: 3px; justify-items: start; }
.num .stack-cell { justify-items: end; }
.err { display: block; max-width: 260px; color: var(--danger); font-size: 12px; line-height: 1.45; }
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12.5px;
}
.hint { color: var(--text-3); font-size: 12.5px; text-align: center; }

.empty { display: grid; justify-items: center; gap: 8px; padding: 52px 20px; text-align: center; color: var(--text-3); }
.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  border-radius: 16px;
  background: var(--surface-3);
  color: var(--text-3);
}
.empty-icon .i { width: 22px; height: 22px; }
.empty b { color: var(--text); font-size: 15px; font-weight: 650; }
.empty small { max-width: 38ch; font-size: 13px; }
.empty .btn { margin-top: 8px; }

.skeleton {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-3) 50%, var(--surface) 70%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* ---------- 总览 ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 32px;
  align-items: center;
  padding: 30px 32px;
  border-radius: var(--r-xl);
  color: #dde6f5;
  background: var(--ink-grad);
  box-shadow: var(--shadow-2);
}
.hero::before, .auth-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(100deg, transparent 10%, #000 70%);
  mask-image: linear-gradient(100deg, transparent 10%, #000 70%);
}
.eyebrow { display: inline-block; color: var(--brand-tint); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.hero h2 { margin: 10px 0; color: #fff; font-size: var(--fs-2xl); font-weight: 750; line-height: 1.25; letter-spacing: -.02em; }
.hero p { max-width: 46ch; color: #a7b5cd; }
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.flow li {
  position: relative;
  padding: 16px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .09);
  backdrop-filter: blur(6px);
}
.flow i {
  display: inline-grid;
  place-items: center;
  height: 22px;
  margin-bottom: 12px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .1);
  color: #c8d6f2;
  font: 600 11px/1 var(--font-mono);
  font-style: normal;
  letter-spacing: .06em;
}
.flow li:nth-child(2) {
  background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 30%, transparent), color-mix(in srgb, var(--accent) 12%, transparent));
  border-color: color-mix(in srgb, var(--brand-tint) 35%, transparent);
}
.flow li:nth-child(2) i { background: var(--grad-brand); color: #fff; }
.flow b { display: block; color: #fff; font-weight: 650; }
.flow small { display: block; margin-top: 2px; color: #8d9bb5; font-size: 12px; }
.flow li + li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid rgba(255, 255, 255, .4);
  border-right: 1.5px solid rgba(255, 255, 255, .4);
  transform: translate(-50%, -50%) rotate(45deg);
}

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 136px;
  padding: 18px 20px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2);
}
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.kpi::after {
  content: "";
  position: absolute;
  top: -34px;
  right: -34px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: var(--tone-soft, var(--surface-3));
  opacity: .75;
}
.kpi-label { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.kpi-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--tone-soft); color: var(--tone); }
.kpi-icon .i { width: 16px; height: 16px; }
.kpi-value { position: relative; z-index: 1; font-size: var(--fs-3xl); font-weight: 750; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-value small { margin-left: 6px; color: var(--text-3); font-size: 15px; font-weight: 550; letter-spacing: 0; }
.kpi-foot { position: relative; z-index: 1; color: var(--text-3); font-size: 12.5px; }
.kpi-foot b { color: var(--tone); font-weight: 650; }
.kpi.is-hot { border-color: color-mix(in srgb, var(--tone) 40%, var(--line)); background: linear-gradient(180deg, var(--tone-soft), var(--surface) 78%); }
.kpi.is-hot .kpi-value { color: var(--tone); }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }

.chart { position: relative; }
.bars {
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 172px;
  background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%;
  border-bottom: 1px solid var(--line-strong);
}
.col { position: relative; flex: 1; min-width: 0; display: flex; align-items: flex-end; border-radius: 6px 6px 0 0; }
.col:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.col > i {
  display: block;
  width: 100%;
  height: calc(var(--h, 0) * 1%);
  min-height: 2px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 45%, var(--accent)) 100%);
  opacity: .85;
  transition: opacity var(--dur-1);
}
.col.is-zero > i { background: var(--line-strong); opacity: .7; }
.col.is-now > i { box-shadow: 0 0 0 2px var(--brand-ring); }
.col:hover > i { opacity: 1; }
.col::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(var(--h, 0) * 1% + 10px);
  z-index: 3;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity var(--dur-1), transform var(--dur-1);
}
.col:hover::after { opacity: 1; transform: translate(-50%, 0); }
.col:nth-child(-n + 3)::after { left: 0; transform: translate(0, 4px); }
.col:nth-child(-n + 3):hover::after { transform: translate(0, 0); }
.col:nth-last-child(-n + 3)::after { left: auto; right: 0; transform: translate(0, 4px); }
.col:nth-last-child(-n + 3):hover::after { transform: translate(0, 0); }
.axis { display: flex; justify-content: space-between; margin-top: 10px; color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart-empty { position: absolute; inset: 0 0 30px; display: grid; place-items: center; color: var(--text-3); font-size: 13px; }

.todo { display: grid; }
.todo-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.todo-item:last-child { border-bottom: 0; }
.todo-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--tone-soft); color: var(--tone); }
.todo-text { flex: 1; min-width: 0; }
.todo-text b { display: block; font-weight: 600; }
.todo-text small { display: block; color: var(--text-3); font-size: 12.5px; overflow-wrap: anywhere; }
.all-clear { display: grid; justify-items: center; gap: 6px; padding: 36px 20px; text-align: center; }
.seal { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 4px; border-radius: 16px; background: var(--ok-soft); color: var(--ok); }
.seal .i { width: 24px; height: 24px; }
.all-clear b { font-weight: 650; }
.all-clear small { color: var(--text-3); }

.rank { display: grid; padding: 6px 0; }
.rank-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 20px; transition: background var(--dur-1); }
.rank-row:hover { background: var(--surface-2); }
.rank-main { display: grid; gap: 7px; min-width: 0; }
.rank-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.meter { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; width: calc(var(--w, 0) * 1%); height: 100%; border-radius: inherit; background: var(--grad-brand); }
.rank-num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-num b { display: block; font-size: 16px; font-weight: 700; line-height: 1.2; }
.rank-num small { color: var(--text-3); font-size: 11.5px; }

.feed { padding: 8px 20px 14px; }
.feed li { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; }
.feed li::before { content: ""; position: absolute; left: 5.5px; top: 26px; bottom: -8px; width: 1px; background: var(--line); }
.feed li:last-child::before { display: none; }
.feed li.feed-empty { display: block; }
.feed li.feed-empty::before { display: none; }
.dot { width: 8px; height: 8px; margin: 7px 2px 0; border-radius: 50%; background: var(--tone, var(--text-3)); box-shadow: 0 0 0 4px var(--tone-soft, var(--gray-soft)); }
.feed-text { min-width: 0; }
.feed-text b { display: block; font-weight: 550; overflow-wrap: anywhere; }
.feed-text small { display: block; overflow: hidden; color: var(--text-3); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.feed time { color: var(--text-3); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- 列表页 ---------- */

.connect {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: center;
  padding: 22px 24px;
  background: linear-gradient(120deg, var(--brand-soft), var(--surface) 58%);
}
.connect-copy { display: flex; align-items: flex-start; gap: 14px; }
.connect-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 8px 18px -8px var(--brand);
}
.connect h3 { font-size: 16px; font-weight: 650; }
.connect p { margin-top: 2px; color: var(--text-2); font-size: 13px; }
.steps { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; counter-reset: step; }
.steps li { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 12.5px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}
.connect-form { display: flex; gap: 10px; }

.log-day {
  position: sticky;
  top: var(--topbar-h);
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 650;
}
.log-day span { color: var(--text-3); font-weight: 500; }
.log-row {
  display: grid;
  grid-template-columns: 70px 12px minmax(0, 1fr) minmax(0, 240px);
  align-items: center;
  gap: 14px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
  transition: background var(--dur-1);
}
.log-row:hover { background: var(--surface-2); }
.log-row time { color: var(--text-3); font: 12px var(--font-mono); }
.log-row .dot { margin: 0 2px; }
.log-text { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.log-text b { font-weight: 550; overflow-wrap: anywhere; }
.log-group { overflow: hidden; color: var(--text-2); font-size: 13px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 反馈：批量条、提示、弹窗 ---------- */

.bulk {
  position: fixed;
  left: calc(50% + var(--rail-w) / 2);
  bottom: 24px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 20px;
  border-radius: var(--r-full);
  background: var(--ink);
  color: #e7edf6;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: var(--shadow-3);
  transform: translateX(-50%);
  animation: rise var(--dur-3) var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }
.bulk-n { margin-right: 6px; color: #a6b3c7; font-size: 13px; white-space: nowrap; }
.bulk-n b { margin-right: 2px; color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }
.bulk .btn { border-radius: var(--r-full); }
.bulk-clear { background: rgba(255, 255, 255, .08); color: #e7edf6; }
.bulk-clear:hover { background: rgba(255, 255, 255, .14); }

.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.has-bulk .toasts { bottom: 88px; }
.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  pointer-events: auto;
  animation: toast-in var(--dur-3) var(--ease);
}
.toast-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--tone-soft); color: var(--tone); }
.toast-icon .i { width: 15px; height: 15px; stroke-width: 2.2; }
.toast p { padding-top: 3px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.toast-close { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); }
.toast-close:hover { background: var(--surface-3); color: var(--text); }
.toast-close .i { width: 14px; height: 14px; }
.toast.is-out { animation: toast-out var(--dur-2) var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

.modal {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-3);
}
.modal::backdrop { background: rgba(6, 11, 22, .52); backdrop-filter: blur(4px); }
.modal[open] { animation: pop var(--dur-2) var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.modal form { display: grid; gap: 10px; padding: 24px; }
.modal-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 13px; background: var(--tone-soft); color: var(--tone); }
.modal-icon .i { width: 21px; height: 21px; }
.modal h3 { font-size: 17px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.modal p { color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ---------- 登录页 ---------- */

.auth-shell { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(440px, 1fr); min-height: 100vh; }
.auth-art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 44px clamp(32px, 5vw, 72px);
  color: #dde6f5;
  background: var(--ink-grad);
}
.auth-art::after {
  content: "";
  position: absolute;
  right: -180px;
  bottom: -220px;
  z-index: -1;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 38%, transparent), transparent 65%);
}
.auth-art .brand { padding: 0; }
.auth-panel { position: relative; }
.auth-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-lockup .brand-text b { color: var(--text); font-size: 18px; }
.auth-lockup .brand-text small { color: var(--text-2); }
.auth-theme { position: absolute; top: 22px; right: 22px; }
.auth-form .field > .i { color: var(--brand); }
.auth-art .brand-text b { font-size: 17px; }
.auth-copy h1 { margin: 14px 0 16px; color: #fff; font-size: clamp(32px, 3.6vw, 46px); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; }
.auth-copy h1 em { font-style: normal; color: var(--accent-tint); background: linear-gradient(90deg, var(--brand-tint), var(--accent-tint)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.auth-copy p { max-width: 44ch; color: #a7b5cd; font-size: 15px; }
.auth-points { display: grid; gap: 14px; margin-top: 30px; }
.auth-points li { display: flex; align-items: center; gap: 12px; color: #c9d4e6; }
.auth-points .i { width: 36px; height: 36px; padding: 9px; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); color: var(--brand-tint); }
.auth-foot { color: #6f7e98; font-size: 12px; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-form { display: grid; gap: 18px; width: min(380px, 100%); }
.auth-form h2 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.auth-form .sub { margin-top: -12px; color: var(--text-3); }
.label { display: grid; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.auth .input { height: 46px; border-radius: 12px; font-size: 15px; }
.auth .field > .i { left: 14px; }
.auth .field > .i ~ .input { padding-left: 42px; }
.field-btn {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
}
.field-btn:hover { background: var(--surface-3); color: var(--text); }
.field.has-btn .input { padding-right: 46px; }
.caps { display: flex; align-items: center; gap: 6px; margin-top: -8px; color: var(--warn); font-size: 12.5px; }
.caps .i { width: 15px; height: 15px; }
.form-error { padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 550; }
.form-error:empty { display: none; }
.auth-meta { color: var(--text-3); font-size: 12px; text-align: center; }
.shake { animation: shake .36s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- 响应式 ---------- */

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-2, .hero, .connect { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .app { display: block; }
  .rail {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    flex-direction: row;
    gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--rail-bg);
    border-right: 0;
    border-top: 1px solid var(--rail-line);
  }
  .rail .brand, .rail-foot, .nav-label { display: none; }
  .nav { width: 100%; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .nav a { flex-direction: column; justify-content: center; gap: 3px; height: 54px; padding: 0 4px; font-size: 11.5px; }
  .nav a[aria-current="page"]::before { left: 32%; right: 32%; top: -7px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .nav-count { position: absolute; top: 4px; left: calc(50% + 6px); height: 17px; min-width: 17px; margin: 0; padding: 0 5px; font-size: 10px; }
  .main { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .mobile-only { display: inline-grid !important; }
  .lang-mobile { display: block; }
  .lang-mobile .lang-btn { width: auto; min-width: 76px; height: 38px; padding: 0 10px; }
  .lang-mobile .lang-menu { top: calc(100% + 6px); bottom: auto; left: auto; right: 0; width: 220px; }
  .bot-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 11px;
    border-radius: var(--r-full);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 12px;
    white-space: nowrap;
  }
  .sync { display: none; }
  .bulk { left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toasts { right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .has-bulk .toasts { bottom: calc(144px + env(safe-area-inset-bottom)); }
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-art { gap: 20px; padding: 28px 24px 32px; }
  .auth-points, .auth-foot { display: none; }
  .auth-copy h1 { font-size: 30px; }
}

@media (max-width: 760px) {
  :root { --topbar-h: 62px; }
  .content { padding-top: 18px; }
  .crumb { display: none; }
  .topbar h1 { font-size: 17px; }
  .topbar-actions { gap: 8px; }
  #refresh { width: 38px; padding: 0; }
  #refresh span { display: none; }
  .kpis { gap: 12px; }
  .kpi { min-height: 116px; padding: 14px; gap: 10px; }
  .kpi-value { font-size: 26px; }
  .hero { padding: 22px 20px; gap: 20px; }
  .hero h2 { font-size: 22px; }
  .flow { gap: 8px; }
  .flow li { padding: 12px; }
  .flow small { display: none; }
  .panel-head { padding: 12px 16px; }
  .connect { padding: 18px 16px; }
  .connect-form, .toolbar-left { flex-wrap: wrap; }
  .panel-head.toolbar > .toolbar-left, .panel-head.toolbar > .field { flex-basis: 100%; }
  .panel-head.toolbar > .btn, .panel-head.toolbar > .select { flex: 1; }
  .connect-form .btn, .toolbar-left .select { flex: 1; }
  .select { max-width: none; }
  .grow { min-width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding: 12px 16px; scrollbar-width: none; }
  .chip { flex: none; }
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { position: relative; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table.stack tbody tr:last-child { border-bottom: 0; }
  .table.stack td { padding: 3px 0; border: 0; text-align: left; }
  .table.stack td.lead { margin-bottom: 8px; padding-right: 32px; }
  .table.stack td[data-label] { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; font-size: 13px; }
  .table.stack td[data-label]::before { content: attr(data-label); flex: none; color: var(--text-3); font-size: 12px; }
  .table.stack td[data-label] .stack-cell { justify-items: end; text-align: right; }
  .table.stack td.check { position: absolute; top: 24px; right: 16px; width: auto; }
  .table.stack .cell-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 8px; }
  .table.stack .link-btn { max-width: 60vw; }
  .who-text b { max-width: 62vw; }
  .err { max-width: none; }
  .log-row { grid-template-columns: 52px 12px minmax(0, 1fr); row-gap: 2px; padding: 11px 16px; }
  .log-group { grid-column: 3; text-align: left; font-size: 12px; color: var(--text-3); }
  .modal-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
