/* 声迹企业后台 · Savior 品牌视觉（VI 08 标准色 / 10 字体 / 11 气泡角）
   气泡角：三个圆角 + 左下一个方角，按钮、卡片、标签都用它。 */

@font-face {
  font-family: "Urbanist";
  src: url("/admin/fonts/Urbanist-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;
  --font-num: "Urbanist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --savior: #002C96;        /* Savior 蓝 · 品牌填充 */
  --savior-hover: #0A3BB8;
  --accent: #002C96;        /* 品牌蓝 · 文字 / 图标 */
  --night: #061544;         /* 夜航蓝 */
  --signal: #2F6BFF;        /* 信号蓝 · 点缀 / 焦点 */
  --smile: #FFC53D;         /* 笑脸黄 · 只点睛 */
  --sky: #E8EEFF;           /* 晴空蓝 */
  --sky-text: #C9D6FF;      /* 蓝底上的次要文字 */
  --mist: #F4F6FB;          /* 雾白 · 页面底 */
  --surface: #FFFFFF;
  --ink: #0C1424;           /* 墨黑 */
  --g1: #2B3448; --g2: #5B6477; --g3: #8E97A8; --g4: #C9CFDA; --g5: #E4E8EF;
  --line: #E4E8EF;
  --hover: #F2F5FD;

  --run: #16B97A; --run-text: #0A7A50; --run-tint: #E2F6EE;
  --warn: #FFB020; --warn-text: #8A5600; --warn-tint: #FFF4DC; --warn-line: #FFE2A3;
  --alarm: #F0453A; --alarm-text: #C42519; --alarm-tint: #FDEAE8;

  --chart-llm: #1E4BD2;
  --chart-asr: #3FB8C9;

  /* 说话人（文字稿里每人一个颜色；文字用深一档保证对比度） */
  --spk0: #2F6BFF; --spk0-t: #1E4BD2;
  --spk1: #16B97A; --spk1-t: #0A7A50;
  --spk2: #F08A24; --spk2-t: #A85300;
  --spk3: #8B5CF6; --spk3-t: #6A3FD0;
  --spk4: #E0457B; --spk4-t: #B4245A;
  --spk5: #14A3C7; --spk5-t: #0B7896;
  --spk6: #9AA31A; --spk6-t: #66700A;
  --spk7: #B7794B; --spk7-t: #87522C;

  --r-lg: 24px; --r: 20px; --r-md: 16px; --r-sm: 12px;
  --sq: 6px;                 /* 气泡角的方角 */
  --focus: 0 0 0 3px rgba(47, 107, 255, .28);
  --shadow-pop: 0 24px 60px rgba(6, 21, 68, .22), 0 2px 8px rgba(6, 21, 68, .08);
  --sidebar-w: 248px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --savior: #1E4BD2;
    --savior-hover: #2A58E0;
    --accent: #9DB8FF;
    --sky: #1A2A5A;
    --mist: #070D20;
    --surface: #121B36;
    --ink: #EEF2FF;
    --g1: #D3D9E6; --g2: #A9B2C5; --g3: #8590A6; --g4: #3A4766; --g5: #222C4A;
    --line: #222C4A;
    --hover: #172248;
    --run-text: #4FD8A2; --run-tint: rgba(22, 185, 122, .15);
    --warn-text: #FFC861; --warn-tint: rgba(255, 176, 32, .12); --warn-line: rgba(255, 176, 32, .3);
    --alarm-text: #FF8A80; --alarm-tint: rgba(240, 69, 58, .16);
    --chart-llm: #5B83FF;
    --chart-asr: #24A0B0;
    --spk0-t: #9DB8FF; --spk1-t: #5FD8A8; --spk2-t: #FFB26B; --spk3-t: #C3A6FF;
    --spk4-t: #FF8FB5; --spk5-t: #6FD0EE; --spk6-t: #CBD45C; --spk7-t: #E8B08A;
    --shadow-pop: 0 24px 60px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--signal); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, p { margin: 0; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--g3); }
.nowrap { white-space: nowrap; }
.num { font-family: var(--font-num); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.noscript { padding: 40px; text-align: center; }

/* ── 启动 / 加载 ─────────────────────────────────────────────────────── */

.app-loading { min-height: 100vh; display: grid; place-items: center; }
.boot { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--g3); }
.boot .eyes { font-size: 28px; color: var(--savior); }

.eyes { display: inline-flex; gap: .3em; align-items: center; line-height: 1; }
.eyes i { display: block; width: .66em; height: 1em; border-radius: 50%; background: currentColor; }
.eyes-loading i { animation: eye-blink 1.6s ease-in-out infinite; transform-origin: center; }
.eyes-loading i + i { animation-delay: .09s; }
@keyframes eye-blink {
  0%, 62%, 100% { transform: scaleY(1); }
  70% { transform: scaleY(.16); }
  78% { transform: scaleY(1); }
}

.state-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 96px 0; color: var(--g3); }
.state-loading .eyes { font-size: 20px; color: var(--savior); }

.state-empty, .state-error { text-align: center; padding: 44px 20px 48px; }
.state-error { display: flex; gap: 24px; align-items: center; justify-content: center; text-align: left; }
.state-buddy { width: 112px; --buddy-bar: var(--g4); --buddy-face: var(--surface); margin-bottom: 14px; }
.state-error .state-buddy { margin: 0; flex: none; }
.state-title { font-size: 16px; font-weight: 650; }
.state-text { color: var(--g2); font-size: 14px; margin: 4px auto 14px; max-width: 42ch; }
.state-error .state-text { margin-left: 0; }

/* ── 角色 ────────────────────────────────────────────────────────────── */

.buddy { display: block; overflow: visible; --buddy-bar: var(--savior); --buddy-face: #fff; }
.buddy-bar { fill: var(--buddy-bar); }
.buddy-face { fill: var(--buddy-face); stroke: var(--buddy-face); stroke-width: 0; }
.buddy-face [fill="none"] { stroke: var(--buddy-face); }
.buddy.is-animated .buddy-h { animation: buddy-float 3s ease-in-out infinite; }
.buddy.is-animated .buddy-m { animation: buddy-float 3s ease-in-out infinite reverse; }
.buddy.is-animated .buddy-eye { transform-box: fill-box; transform-origin: center; animation: buddy-blink 4.5s infinite; }
.buddy.is-animated .buddy-m .buddy-eye { animation-delay: .09s; }
@keyframes buddy-float { 0%, 100% { transform: translateY(-7px); } 50% { transform: translateY(7px); } }
@keyframes buddy-blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.12); } }

/* ── 外壳 ────────────────────────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--night); color: #fff;
  padding: 22px 14px 18px;
  overflow-y: auto;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand:hover { color: #fff; }
.brand-buddy { width: 46px; --buddy-bar: #fff; --buddy-face: var(--night); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-size: 18px; font-weight: 800; letter-spacing: .04em; }
.brand-text span { font-size: 12px; color: var(--sky-text); }
.sidebar-org {
  margin: 22px 8px 14px; padding: 10px 12px;
  background: rgba(255, 255, 255, .06); border-radius: 12px 12px 12px 4px;
  font-size: 13px; color: var(--sky-text); overflow-wrap: anywhere;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 14px;
  border-radius: 14px 14px 14px 4px;
  color: rgba(255, 255, 255, .72); text-decoration: none; font-weight: 550;
  transition: background-color .15s, color .15s;
}
.nav-item .icon { width: 20px; height: 20px; flex: none; }
.nav-item > span:not(.eyes) { flex: 1; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-item.is-active { color: #fff; background: #002C96; }
.nav-eyes { font-size: 10px; color: var(--smile); opacity: 0; transition: opacity .15s; }
.nav-item.is-active .nav-eyes { opacity: 1; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; font-size: 12px; color: rgba(201, 214, 255, .5); }
.sidebar .sidebar-close { display: none; color: #fff; }
.scrim { display: none; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 40px;
  background: color-mix(in srgb, var(--mist) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.topbar-title { display: none; font-weight: 650; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 12px 0 6px;
  border: 0; background: transparent; border-radius: 14px 14px 14px 4px; cursor: pointer;
}
.user-btn:hover { background: var(--surface); }
.user-name { font-weight: 600; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; background: transparent; border-radius: 12px 12px 12px 4px; cursor: pointer; color: var(--g1);
}
.icon-btn:hover { background: rgba(127, 140, 170, .14); }
.icon-btn .icon { width: 22px; height: 22px; }
.nav-toggle { display: none; }

.view { padding: 8px 40px 72px; width: 100%; max-width: 1240px; outline: none; }
.icon { width: 18px; height: 18px; flex: none; }

/* ── 页头 ────────────────────────────────────────────────────────────── */

.page-head { margin: 8px 0 24px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px -4px; color: var(--g2); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--accent); }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-title { font-size: 28px; line-height: 1.25; font-weight: 750; letter-spacing: -.01em; overflow-wrap: anywhere; }
.page-desc { margin-top: 6px; color: var(--g2); max-width: 62ch; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page-foot { margin-top: 28px; color: var(--g3); font-size: 13px; }

/* ── 卡片 ────────────────────────────────────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r) var(--r) var(--r) var(--sq);
  padding: 24px;
  margin-bottom: 20px;
}
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-flush > .panel-head { padding: 20px 24px 4px; margin: 0; }
.panel-title { font-size: 17px; font-weight: 680; margin-bottom: 12px; }
.panel-head .panel-title { margin: 0; }
.panel-title .count { margin-left: 6px; color: var(--g3); font-weight: 600; font-size: 14px; }
.panel-title-gap { margin-top: 26px; }
.panel-text { color: var(--g2); font-size: 14px; margin-bottom: 14px; }
.panel-pad { padding: 8px 24px 24px; }
.panel-aside { color: var(--g3); font-size: 13px; }

/* ── 按钮 ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border: 0; border-radius: 14px 14px 14px 4px;
  font-size: 15px; font-weight: 650; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, color .15s, transform .12s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.is-busy { cursor: progress; }
.btn-primary { background: var(--savior); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--savior-hover); color: #fff; }
.btn-secondary { background: var(--sky); color: var(--accent); }
.btn-secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--sky) 80%, var(--signal)); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--g1); }
.btn-ghost:hover:not(:disabled) { background: rgba(127, 140, 170, .14); color: var(--ink); }
.btn-danger { background: var(--alarm-tint); color: var(--alarm-text); }
.btn-danger:hover:not(:disabled) { background: var(--alarm); color: #fff; }
.btn-danger-text { color: var(--alarm-text); }
.btn-danger-text:hover:not(:disabled) { background: var(--alarm-tint); color: var(--alarm-text); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 11px 11px 11px 3px; gap: 6px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { height: 50px; font-size: 16px; border-radius: 16px 16px 16px 5px; }
.btn-block { width: 100%; }
.btn-on-blue { background: #fff; color: #002C96; }
.btn-on-blue:hover { background: var(--sky); color: #002C96; }
.btn-ghost-on-blue { background: rgba(255, 255, 255, .14); color: #fff; }
.btn-ghost-on-blue:hover { background: rgba(255, 255, 255, .22); color: #fff; }

/* ── 表单 ────────────────────────────────────────────────────────────── */

:where(input:not([type=checkbox], [type=radio])), select, textarea {
  width: 100%; height: 42px; padding: 0 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--g4); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--g3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--signal); box-shadow: var(--focus); }
input:disabled, select:disabled { background: var(--mist); color: var(--g3); cursor: not-allowed; }
input[type=date] { min-width: 150px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E97A8' 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 12px center; background-size: 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 620; color: var(--g1); }
.field-label em { font-style: normal; font-weight: 400; color: var(--g3); margin-left: 6px; }
.field-hint { font-size: 12.5px; color: var(--g3); line-height: 1.5; }
.field-static { min-height: 42px; display: flex; align-items: center; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-stack + .field, .field + .field { margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid > .field + .field, .form-stack > .field + .field { margin-top: 0; }
.field-full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.input-row { display: flex; gap: 10px; align-items: center; }
.input-row input { flex: 1; }

.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 14px; background: var(--mist); border-radius: 14px 14px 14px 4px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--alarm); flex: none; }
.check small { display: block; color: var(--g3); font-size: 12.5px; margin-top: 2px; }

/* 分段选择 */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--g5); border-radius: 13px 13px 13px 4px; width: max-content; max-width: 100%; }
.seg-item {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 16px; border: 0; background: transparent;
  border-radius: 10px 10px 10px 3px; font-size: 14px; font-weight: 600; color: var(--g2); cursor: pointer; white-space: nowrap;
}
.seg-item:hover:not(:disabled) { color: var(--ink); }
.seg-item.is-on, .seg-item:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(12, 20, 36, .1); }
.seg-item:disabled, .seg-item.is-disabled { opacity: .45; cursor: not-allowed; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 1px; }
.seg-sm .seg-item { height: 28px; padding: 0 12px; font-size: 13px; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 550; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--g4); transition: background-color .2s; flex: none; }
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
.switch input:checked + .switch-track { background: var(--savior); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--signal); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; }
.switch-row { display: flex; margin-bottom: 8px; }
.switch-text { font-size: 15px; }

/* 搜索框 */
.search { position: relative; display: block; width: 340px; max-width: 100%; }
.search .icon { position: absolute; z-index: 1; left: 13px; top: 50%; transform: translateY(-50%); color: var(--g3); pointer-events: none; }
.search input[type=search] { padding-left: 40px; }

/* ── 标签 / 徽标 / 头像 ──────────────────────────────────────────────── */

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 8px 8px 8px 2px; font-size: 12px; font-weight: 650; white-space: nowrap; vertical-align: middle;
}
.tag-role-owner { background: var(--savior); color: #fff; }
.tag-role-admin { background: var(--sky); color: var(--accent); }
.tag-role-member { background: var(--g5); color: var(--g1); }
.tag-self { background: var(--smile); color: #0C1424; margin-left: 8px; }
.tag-plain { background: var(--g5); color: var(--g1); }
.tag-alarm { background: var(--alarm-tint); color: var(--alarm-text); }

.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--g1); white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--g4); flex: none; }
.badge-ok .dot { background: var(--run); }
.badge-warn .dot { background: var(--warn); }
.badge-warn { color: var(--warn-text); }
.badge-alarm .dot { background: var(--alarm); }
.badge-alarm { color: var(--alarm-text); }
.badge-info .dot { background: var(--signal); }
.badge-muted { color: var(--g3); }
.conv-top .badge-info { background: var(--sky); color: var(--accent); padding: 1px 8px; border-radius: 8px 8px 8px 2px; font-size: 12px; font-weight: 650; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 14px 14px 14px 4px;
  background: var(--sky); color: var(--accent); font-weight: 750; font-size: 15px;
}
.avatar-sm { width: 30px; height: 30px; font-size: 13px; border-radius: 11px 11px 11px 3px; }
.avatar-lg { width: 68px; height: 68px; font-size: 28px; border-radius: 22px 22px 22px 6px; background: var(--savior); color: #fff; }

/* ── 提示条 ──────────────────────────────────────────────────────────── */

.notice { padding: 12px 16px; border-radius: 14px 14px 14px 4px; font-size: 14px; margin-bottom: 20px; }
.notice-info { background: var(--sky); color: var(--g1); }
.notice-warn { background: var(--warn-tint); color: var(--warn-text); border: 1px solid var(--warn-line); }
.notice-error { background: var(--alarm-tint); color: var(--alarm-text); }
.notice a { margin-left: 8px; color: inherit; font-weight: 650; }
.notice-lock { display: flex; gap: 10px; align-items: flex-start; }
.notice-lock .icon { color: var(--accent); margin-top: 2px; }

/* ── 概览 ────────────────────────────────────────────────────────────── */

.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: center; gap: 24px;
  margin: 8px 0 20px; padding: 36px 40px;
  background: var(--savior); color: #fff;
  border-radius: 28px 28px 28px 8px;
}
.hero-kicker { color: var(--sky-text); font-size: 14px; margin-bottom: 6px; }
.hero-title { font-size: 34px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.hero-line { margin-top: 12px; font-size: 16px; color: rgba(255, 255, 255, .86); max-width: 40em; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.hero-buddy { width: 100%; max-width: 300px; justify-self: end; --buddy-bar: #fff; --buddy-face: var(--savior); }

.panel-attention {
  display: flex; gap: 28px; align-items: center;
  background: var(--warn-tint); border-color: var(--warn-line);
}
.attention-buddy { width: 150px; flex: none; --buddy-bar: var(--savior); --buddy-face: #fff; }
.attention-title { font-size: 20px; font-weight: 750; margin-bottom: 6px; }
.attention-text { color: var(--g1); max-width: 56ch; }
.attention-meta { color: var(--g2); font-size: 13.5px; margin: 8px 0 16px; }

.ai-status { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; padding: 18px 24px; }
.ai-status-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ai-status-row:nth-child(2) { flex: 1 1 280px; }
.ai-status-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px 12px 12px 3px; flex: none; }
.ai-status-icon.is-ok { background: var(--run-tint); color: var(--run-text); }
.ai-status-icon.is-off { background: var(--g5); color: var(--g2); }
.ai-status-label { font-size: 12.5px; color: var(--g3); }
.ai-status-value { font-weight: 620; }

.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r) var(--r) var(--r) var(--sq);
  overflow: hidden; margin-bottom: 20px;
}
.stat {
  display: flex; flex-direction: column; gap: 4px; padding: 20px 22px 22px;
  background: var(--surface); color: inherit; text-decoration: none;
}
a.stat:hover { background: var(--hover); color: inherit; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--g2); font-weight: 550; }
.stat-num { font-size: 40px; line-height: 1.1; color: var(--ink); margin-top: 6px; }
.stat-num small { font-size: 20px; color: var(--g3); margin-left: 2px; }
.stat-sub { font-size: 12.5px; color: var(--g3); }
.stat-meter { display: block; height: 6px; border-radius: 3px; background: var(--sky); overflow: hidden; margin: 6px 0 2px; }
.stat-meter i { display: block; height: 100%; background: var(--savior); border-radius: 3px; }
.stat-pending .stat-label::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--smile); }
.stat-bad .stat-num { color: var(--alarm-text); }
.stats-usage { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ── 表格 ────────────────────────────────────────────────────────────── */

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12.5px; font-weight: 620; color: var(--g3);
  padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--hover); }
.is-dim td { color: var(--g3); }
.is-dim .person-name { color: var(--g2); }
.person-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.person-line { display: flex; align-items: center; min-width: 0; }
.person { display: flex; flex-direction: column; min-width: 0; }
.person-name { color: var(--ink); font-weight: 620; text-decoration: none; }
.person-name:hover { color: var(--accent); text-decoration: underline; }
.person-email { color: var(--g3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { display: block; color: var(--g3); font-size: 12.5px; }
.table-invites td:nth-child(7) .cell-sub { white-space: nowrap; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .btn + .btn { margin-left: 4px; }
.code-text { font-size: 15px; letter-spacing: .06em; white-space: nowrap; }
.table-note { padding: 14px 24px 20px; color: var(--g3); font-size: 12.5px; border-top: 1px solid var(--line); }
.table-compact td, .table-compact th { padding-top: 8px; padding-bottom: 8px; }
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-count { color: var(--g3); font-size: 13px; }

/* ── 成员详情 ────────────────────────────────────────────────────────── */

.profile { display: flex; align-items: center; gap: 20px; margin: -8px 0 22px; }
.profile-email { color: var(--g2); }
.profile-tags { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.profile-tags .tag-self { margin-left: 0; }
.profile-meta { color: var(--g3); font-size: 13.5px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.detail-grid > .panel { margin: 0; }
.detail-wide { grid-column: 1 / -1; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin: 0; }
.kv-grid dt { font-size: 12.5px; color: var(--g3); }
.kv-grid dd { margin: 2px 0 0; font-size: 15px; }
.kv-grid .num { font-size: 22px; }
.device-list { list-style: none; margin: 0; padding: 0; }
.device { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.device:first-child { border-top: 0; padding-top: 4px; }
.device-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px 12px 12px 3px; background: var(--mist); color: var(--g2); flex: none; }
.device-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.device-name { font-weight: 600; overflow-wrap: anywhere; }
.device-meta { font-size: 13px; color: var(--g3); }
.panel-danger { border-color: color-mix(in srgb, var(--alarm) 22%, var(--line)); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.panel-danger .panel-title + .danger-row { border-top: 0; padding-top: 4px; }
.danger-row .panel-text { margin: 2px 0 0; max-width: 60ch; }
.danger-title { font-weight: 620; }
.secret-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 16px 0 12px; padding: 18px 20px; background: var(--sky); border-radius: 16px 16px 16px 4px; }
.secret-code { font-size: 26px; letter-spacing: .06em; user-select: all; -webkit-user-select: all; color: var(--ink); }

/* ── 邀请 ────────────────────────────────────────────────────────────── */

.invite-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 20px; align-items: start; }
.invite-form > .field:first-child { grid-column: 1 / -1; }
.invite-form .form-actions { align-self: end; margin: 0 0 22px; }
.invite-form .field + .field { margin-top: 0; }

.invite-result {
  position: relative; margin-bottom: 20px; padding: 28px 32px 30px;
  background: var(--savior); color: #fff;
  border-radius: 28px 28px 28px 8px;
  animation: pop-in .35s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.invite-result-title { font-size: 20px; font-weight: 750; padding-right: 44px; }
.invite-result-sub { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 8px; font-size: 14px; color: var(--sky-text); }
.invite-result .tag-role-member, .invite-result .tag-role-admin { background: rgba(255, 255, 255, .16); color: #fff; }
.invite-code-block { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 22px 0 14px; }
.invite-code-label { font-size: 13px; color: var(--sky-text); }
.invite-code { font-size: 46px; line-height: 1; letter-spacing: .08em; user-select: all; -webkit-user-select: all; }
.invite-facts { display: grid; gap: 8px; margin: 0 0 22px; }
.invite-facts div { display: grid; grid-template-columns: 6em minmax(0, 1fr); gap: 12px; }
.invite-facts dt { color: var(--sky-text); font-size: 13.5px; }
.invite-facts dd { margin: 0; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.invite-facts a { color: #fff; }
.invite-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.invite-result .btn-primary { background: #fff; color: #002C96; }
.invite-result .btn-primary:hover { background: var(--sky); color: #002C96; }
.invite-result .btn-secondary { background: rgba(255, 255, 255, .14); color: #fff; }
.invite-result .btn-secondary:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.invite-preview {
  margin: 18px 0 0; padding: 14px 18px;
  background: rgba(6, 21, 68, .32); border-radius: 14px 14px 14px 4px;
  font-size: 14px; color: rgba(255, 255, 255, .88); overflow-wrap: anywhere;
}
.invite-close { position: absolute; top: 18px; right: 18px; color: #fff; }
.invite-close:hover { background: rgba(255, 255, 255, .14); }

/* ── AI 配置 ─────────────────────────────────────────────────────────── */

.ai-summary { display: flex; gap: 12px 32px; flex-wrap: wrap; margin-bottom: 20px; padding: 0 4px; }
.ai-summary-item { display: flex; align-items: center; gap: 12px; }
.ai-summary-label { font-size: 13px; color: var(--g2); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.preset {
  height: 36px; padding: 0 16px; border: 1px solid var(--g4); background: var(--surface);
  border-radius: 12px 12px 12px 3px; font-size: 14px; font-weight: 600; color: var(--g1); cursor: pointer;
}
.preset:hover { border-color: var(--savior); color: var(--accent); }
.preset.is-on { border-color: var(--savior); background: var(--sky); color: var(--accent); }
.secret-state { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 13px; color: var(--g2); }
.secret-state .icon { width: 16px; height: 16px; color: var(--run-text); }
.secret-now { display: inline-flex; align-items: center; gap: 6px; }
.hint-code { font-family: var(--font-num); font-weight: 800; letter-spacing: .06em; color: var(--ink); }
.test-result { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.test-result.is-ok { color: var(--run-text); }
.test-result.is-bad { color: var(--alarm-text); }
.engine-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.engine {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 16px 18px; border: 1.5px solid var(--line); background: var(--surface);
  border-radius: 16px 16px 16px 4px; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.engine:hover { border-color: var(--g4); }
.engine.is-on { border-color: var(--savior); background: var(--sky); }
.engine input { position: absolute; opacity: 0; pointer-events: none; }
.engine:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }
.engine-title { font-weight: 680; font-size: 15px; }
.engine-title::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin: 0 8px -1px 0; border-radius: 50%;
  border: 2px solid var(--g4); background: var(--surface); box-sizing: border-box; vertical-align: baseline;
}
.engine.is-on .engine-title::before { border: 4px solid var(--savior); }
.engine-text { font-size: 12.5px; color: var(--g2); line-height: 1.5; }
.engine-tag { display: inline-flex; align-items: center; height: 20px; margin-left: 8px; padding: 0 7px; border-radius: 7px 7px 7px 2px; background: var(--run-tint); color: var(--run-text); font-size: 11.5px; font-weight: 650; vertical-align: 1px; }
.engine-fields { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
#asr-form > .form-actions { margin-top: 22px; }

/* ── 内容 ────────────────────────────────────────────────────────────── */

.filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; padding: 16px 18px; }
.filters .search { flex: 1 1 260px; width: auto; }
.field-inline { flex: 0 1 auto; }
.field-inline select { min-width: 150px; }
.filters-actions { display: flex; gap: 8px; }
.list-count { color: var(--g3); font-size: 13px; margin: 4px 4px 10px; }
.conv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.conv {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 18px 5px;
  color: inherit; text-decoration: none; transition: border-color .15s;
}
.conv:hover { color: inherit; border-color: color-mix(in srgb, var(--savior) 40%, var(--line)); }
.conv:hover .conv-title { color: var(--accent); }
.conv-top { display: flex; align-items: center; gap: 10px; }
.conv-title { font-size: 16.5px; font-weight: 680; overflow-wrap: anywhere; }
.conv-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 13px; color: var(--g2); }
.conv-excerpt {
  font-size: 14px; color: var(--g1); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px;
  background: var(--mist); border-radius: 8px 8px 8px 2px; font-size: 12.5px; color: var(--g1);
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--g3)); }
.chip-more { color: var(--g3); }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 22px 0 0; }
.pager-text { font-size: 14px; color: var(--g2); }

.spk-0 { --c: var(--spk0); --ct: var(--spk0-t); }
.spk-1 { --c: var(--spk1); --ct: var(--spk1-t); }
.spk-2 { --c: var(--spk2); --ct: var(--spk2-t); }
.spk-3 { --c: var(--spk3); --ct: var(--spk3-t); }
.spk-4 { --c: var(--spk4); --ct: var(--spk4-t); }
.spk-5 { --c: var(--spk5); --ct: var(--spk5-t); }
.spk-6 { --c: var(--spk6); --ct: var(--spk6-t); }
.spk-7 { --c: var(--spk7); --ct: var(--spk7-t); }
.spk-none { --c: var(--g4); --ct: var(--g2); }

.conv-facts { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: -8px 0 16px; }
.conv-facts dt { font-size: 12.5px; color: var(--g3); }
.conv-facts dd { margin: 0; font-weight: 550; }
.conv-speakers { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.conv-speakers .chips { margin: 0; }
.conv-speakers .chip { background: var(--surface); border: 1px solid var(--line); }
.conv-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: start; }
.conv-body > .panel { margin: 0; }
.minutes { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }

.md { font-size: 15px; line-height: 1.75; color: var(--ink); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h3, .md h4, .md h5, .md h6 { line-height: 1.4; margin: 1.3em 0 .4em; }
.md .md-h1 { font-size: 19px; font-weight: 750; }
.md .md-h2 { font-size: 17px; font-weight: 720; }
.md .md-h3, .md .md-h4, .md .md-h5, .md .md-h6 { font-size: 15px; font-weight: 700; }
.md p { margin: .55em 0; }
.md ul, .md ol { margin: .45em 0; padding-left: 1.4em; }
.md li { margin: .22em 0; }
.md li::marker { color: var(--accent); }
.md strong { font-weight: 700; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.md pre { background: var(--mist); padding: 12px 14px; border-radius: 12px; overflow: auto; font-size: 13px; }
.md-check { color: var(--g3); }
.md-check.is-done { color: var(--run-text); }

.transcript { list-style: none; margin: 0; padding: 0; }
.tline { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; padding-top: 14px; }
.tline:first-child { padding-top: 0; }
.tline.is-cont { padding-top: 4px; }
.tline-time { font-size: 12.5px; color: var(--g3); padding-top: 3px; text-align: right; }
.tline-body { display: flex; flex-direction: column; border-left: 3px solid var(--c); padding-left: 14px; }
.tline-speaker { font-size: 13px; font-weight: 700; color: var(--ct); margin-bottom: 1px; }
.tline-text { line-height: 1.7; overflow-wrap: anywhere; }

/* ── 用量 ────────────────────────────────────────────────────────────── */

.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.swatch-llm { background: var(--chart-llm); }
.swatch-asr { background: var(--chart-asr); }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--g2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }

.chart { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 220px; font-size: 12px; color: var(--g3); text-align: right; }
.chart-y span { line-height: 1; transform: translateY(-50%); }
.chart-y span:last-child { transform: translateY(50%); }
.chart-y span:first-child { transform: translateY(0); }
.chart-plot { position: relative; height: 248px; }
.chart-grid { position: absolute; left: 0; right: 0; top: 0; height: 220px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid i { display: block; border-top: 1px solid var(--line); }
.chart-grid i:last-child { border-top-color: var(--g4); }
.chart-bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; }
.bar-col { position: relative; display: flex; flex-direction: column; height: 100%; border-radius: 6px 6px 0 0; outline-offset: 0; }
.bar-stack { height: 220px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; border-radius: 6px 6px 0 0; }
.bar { display: block; flex: none; width: min(24px, 72%); min-height: 2px; }
.bar.is-top { border-radius: 4px 4px 0 0; }
.bar-llm { background: var(--chart-llm); }
.bar-asr { background: var(--chart-asr); }
.bar-col.is-hover .bar-stack { background: color-mix(in srgb, var(--signal) 8%, transparent); }
.bar-x { height: 28px; line-height: 28px; font-size: 11.5px; color: var(--g3); text-align: center; white-space: nowrap; overflow: visible; display: flex; justify-content: center; }
.bar-x.is-hidden { visibility: hidden; }
.chart-tip {
  position: absolute; top: 0; z-index: 3; pointer-events: none;
  display: flex; flex-direction: column; gap: 3px; padding: 10px 14px;
  background: var(--ink); color: var(--mist); font-size: 13px; white-space: nowrap;
  border-radius: 12px 12px 12px 3px; box-shadow: var(--shadow-pop);
}
.chart-tip span { display: inline-flex; align-items: center; gap: 7px; }
.chart-tip .tip-bad { color: #FF8A80; }
.day-table { margin-top: 16px; }
.day-table summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 600; width: max-content; }
.day-table .table { margin-top: 10px; }
.day-table .table td:first-child, .day-table .table th:first-child { padding-left: 0; }

/* ── 审计 ────────────────────────────────────────────────────────────── */

.audit { list-style: none; margin: 0; padding: 0; }
.audit-day { font-size: 13px; font-weight: 700; color: var(--g2); padding: 18px 0 4px; }
.audit-day:first-child { padding-top: 0; }
.audit-item { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.audit-time { font-size: 14px; color: var(--g3); padding-top: 1px; }
.audit-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.audit-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.audit-line b { font-weight: 650; }
.audit-text { color: var(--g1); font-size: 14px; overflow-wrap: anywhere; }
.audit-more { padding-top: 16px; text-align: center; }

/* ── 弹窗 / 提示 ─────────────────────────────────────────────────────── */

.modal {
  width: min(500px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 0; background: var(--surface); color: var(--ink);
  border-radius: 26px 26px 26px 7px; box-shadow: var(--shadow-pop);
}
.modal[open] { animation: modal-in .22s cubic-bezier(.34, 1.4, .64, 1); }
.modal::backdrop { background: rgba(6, 21, 68, .45); backdrop-filter: blur(3px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-inner { padding: 26px 26px 22px; }
.modal-title { font-size: 19px; font-weight: 750; margin-bottom: 10px; }
.modal-text { color: var(--g1); }
.modal-body .form-grid { margin-top: 16px; grid-template-columns: 1fr; gap: 14px; }
.modal-body .field-hint { margin-top: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  padding: 12px 18px; border-radius: 14px 14px 14px 4px; font-size: 14px; font-weight: 550;
  background: var(--ink); color: var(--mist); box-shadow: var(--shadow-pop);
  animation: toast-in .28s cubic-bezier(.34, 1.56, .64, 1);
  transition: opacity .3s, transform .3s;
}
.toast-error { background: var(--alarm-text); color: #fff; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── 登录 ────────────────────────────────────────────────────────────── */

.login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.login-hero { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--night); color: #fff; }
.login-hero-inner { max-width: 420px; }
.login-buddy { width: 300px; max-width: 80%; margin-bottom: 44px; --buddy-bar: #fff; --buddy-face: var(--night); }
.login-hero-title { font-size: 32px; font-weight: 800; letter-spacing: .02em; }
.login-hero-text { margin-top: 10px; color: var(--sky-text); font-size: 16px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-tabs { margin-bottom: 28px; }
.login-title { font-size: 26px; font-weight: 750; }
.login-sub { color: var(--g2); margin: 8px 0 24px; font-size: 14.5px; }
.login-card .notice { margin-bottom: 18px; }
.login-card .form-stack .btn { margin-top: 8px; }
.login-foot { margin-top: 22px; color: var(--g3); font-size: 13px; }

/* ── 窄屏 ────────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .engine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invite-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conv-body { grid-template-columns: minmax(0, 1fr); }
  .minutes { position: static; max-height: none; }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; width: min(280px, 84vw);
    transform: translateX(-102%); transition: transform .25s cubic-bezier(.65, 0, .35, 1);
  }
  .nav-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .sidebar .sidebar-close { display: inline-grid; }
  .scrim { position: fixed; inset: 0; z-index: 40; background: rgba(6, 21, 68, .4); }
  .nav-open .scrim { display: block; }
  .nav-toggle { display: inline-grid; margin-left: -8px; }
  .topbar { padding: 0 20px; height: 58px; }
  .topbar-title { display: block; }
  .view { padding: 4px 20px 56px; }
  .hero { grid-template-columns: minmax(0, 1fr) 160px; padding: 28px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-wide { grid-column: auto; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-hero { padding: 36px 24px 28px; justify-content: flex-start; }
  .login-hero-inner { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 18px; align-items: center; max-width: none; }
  .login-buddy { width: 96px; max-width: none; margin: 0; grid-row: span 2; }
  .login-hero-title { font-size: 22px; }
  .login-hero-text { margin: 0; font-size: 14px; }
}

@media (max-width: 680px) {
  body { font-size: 15px; }
  .page-title { font-size: 24px; }
  .user-name, .topbar-user .btn span { display: none; }
  .topbar-user .btn { width: 36px; padding: 0; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 26px 22px 24px; }
  .hero-buddy { position: absolute; right: -24px; top: 18px; width: 128px; opacity: .22; }
  .hero-title { font-size: 28px; }
  .panel { padding: 20px 18px; }
  .panel-flush { padding: 0; }
  .ai-status { flex-direction: column; align-items: flex-start; gap: 14px; }
  .ai-status-row:nth-child(2) { flex: none; }
  .panel-flush > .panel-head { padding: 18px 18px 4px; }
  .panel-attention { flex-direction: column; align-items: flex-start; gap: 16px; }
  .attention-buddy { width: 110px; }
  .stats, .stats-usage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 16px; }
  .stat-num { font-size: 32px; }
  .form-grid, .invite-form, .kv-grid { grid-template-columns: minmax(0, 1fr); }
  .invite-form .form-actions { margin: 0; }
  .engine-grid { grid-template-columns: minmax(0, 1fr); }
  .invite-result { padding: 24px 20px; }
  .invite-code { font-size: 34px; }
  .invite-facts div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .danger-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .search { width: 100%; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .search { flex: none; }
  .field-inline select, input[type=date] { min-width: 0; }
  .profile { align-items: flex-start; }
  .avatar-lg { width: 56px; height: 56px; font-size: 22px; }
  .state-error { flex-direction: column; text-align: center; }
  .state-error .state-text { margin-left: auto; }

  /* 表格变卡片 */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 18px; border-bottom: 1px solid var(--line); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td, .table th:first-child, .table td:first-child, .table td:last-child { padding: 4px 0; border: 0; }
  .table td[data-label] { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 4px 10px; text-align: right; }
  .table td[data-label]::before { content: attr(data-label); color: var(--g3); font-size: 13px; text-align: left; flex: none; margin-right: auto; }
  .table td[data-label] .cell-sub { display: inline; }
  .table td.cell-person { display: block; text-align: left; padding-bottom: 8px; }
  .table td.cell-person::before { display: none; }
  .table .num-cell { text-align: right; }
  .cell-actions { text-align: left; padding-top: 8px !important; }
  .day-table .table tr { padding: 8px 0; }
  .chart { grid-template-columns: 34px minmax(0, 1fr); }
}

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