/* ============================================================
   濂惰洐 路 鏍″洯浜嬪姟瑙勫垯鍔╂墜
   瑙嗚鍙傝€冿細鎷惧厜锛堢孩閲?/ 鐜荤拑瀵艰埅锛夈€乽niversity-planner锛堟恫鎬佺幓鐠?/
   Mesh 鍏夋枒 / 寮规€у井浜や簰锛夈€侀潚绂炬牎鍥紙鍦嗚鍗＄墖 / 鑹插潡鍥炬爣锛夈€?   浜ゆ垜 Pay锛堟祬鑹插伐浣滃彴 / 娓呮櫚灞傜骇锛?   ============================================================ */

:root {
  --bg: #F4F7FB;
  --bg-2: #EAF1F9;
  --surface: rgba(255, 255, 255, .84);
  --surface-solid: #FFFFFF;
  --surface-soft: rgba(255, 255, 255, .56);
  --ink: #0F1B2D;
  --ink-2: #3C4A5E;
  --muted: #64748B;
  --muted-2: #8A98AC;
  --line: rgba(15, 27, 45, .10);
  --line-strong: rgba(15, 27, 45, .17);

  --brand: #003F88;
  --brand-2: #0052B4;
  --brand-bright: #00A3E0;
  --brand-soft: #E8F0FB;
  --brand-line: #CFE0F5;
  --gold: #E8A317;
  --gold-deep: #B26A00;
  --gold-soft: #FFF4E5;

  --green: #16A34A;
  --green-soft: #E6F4EA;
  --amber: #B26A00;
  --amber-soft: #FFF4E5;
  --red: #D64545;
  --red-soft: #FDECEC;
  --blue: #0052B4;
  --blue-soft: #E8F0FB;
  --purple: #4F6BED;
  --purple-soft: #EEF2FF;

  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 8px 24px -18px rgba(15, 27, 45, .38);
  --shadow-md: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 24px 50px -30px rgba(15, 27, 45, .36);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, .85) inset, 0 34px 80px -40px rgba(15, 27, 45, .48);
  --spring: cubic-bezier(.22, 1.15, .32, 1);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --num: "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB",
    system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(900px 560px at 10% -8%, rgba(0, 63, 136, .09), transparent 64%),
    radial-gradient(760px 520px at 96% 8%, rgba(0, 163, 224, .13), transparent 62%),
    radial-gradient(900px 700px at 58% 108%, rgba(47, 125, 92, .08), transparent 68%),
    linear-gradient(160deg, #F7FAFE 0%, #EEF4FB 54%, #E7EFF9 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: rgba(0, 63, 136, .16); }

/* ---------------- 鑳屾櫙鍏夋枒 ---------------- */
.app-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

/* ---------------- 閫氱敤 ---------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em; color: var(--brand);
}
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-bright); box-shadow: 0 0 0 4px rgba(176, 42, 55, .12); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; color: var(--muted); white-space: nowrap;
  background: rgba(255, 255, 255, .5); border: 1px solid var(--line);
}
.badge.full { color: var(--green); background: var(--green-soft); border-color: rgba(47, 125, 92, .22); }
.badge.lite { color: var(--amber); background: var(--amber-soft); border-color: rgba(168, 107, 18, .24); }
.btn-primary, button.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 20px;
  color: #fff; font-weight: 700; font-size: 13.5px; letter-spacing: .01em;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 14px 28px -14px rgba(0, 63, 136, .72);
  transition: transform .22s var(--spring), box-shadow .22s var(--ease), filter .2s;
}
.btn-primary:hover, button.primary:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 20px 36px -16px rgba(0, 63, 136, .76); }
.btn-primary:active, button.primary:active { transform: scale(.975) translateY(0); }
button.primary svg { width: 17px; height: 17px; }
.btn-ghost, button.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 10px 18px;
  color: var(--ink-2); font-weight: 650; font-size: 13px;
  background: rgba(255, 255, 255, .56); backdrop-filter: blur(10px);
  transition: transform .2s var(--spring), border-color .2s, color .2s, background .2s;
}
.btn-ghost:hover, button.ghost:hover { transform: translateY(-1px); color: var(--brand); border-color: var(--brand-line); background: rgba(255, 255, 255, .86); }
.ghost-btn { border: 0; background: transparent; color: var(--muted); font-size: 11.5px; padding: 2px 4px; }
.ghost-btn:hover { color: var(--brand); }
.hint { font-size: 12px; color: var(--muted); }

/* ---------------- 椤堕儴瀵艰埅 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: clamp(12px, 1.6vw, 26px);
  height: 74px; padding: 0 clamp(14px, 2.5vw, 40px);
  background: rgba(247, 250, 253, .82);
  border-bottom: 1px solid rgba(255, 255, 255, .7);
  box-shadow: inset 0 -1px 0 rgba(72, 50, 42, .06);
}
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(145deg, var(--brand-2), #002B5C);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 12px 24px -12px rgba(0, 63, 136, .7);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text b { font-size: 17px; font-weight: 850; letter-spacing: .1em; }
.brand-text small { font-size: 10px; color: var(--muted-2); letter-spacing: .12em; text-transform: uppercase; }
.top-nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.top-nav a {
  padding: 8px 13px; border-radius: 999px; font-size: 13px; color: var(--muted);
  transition: color .2s, background .2s;
}
.top-nav a:hover { color: var(--brand); background: var(--brand-soft); }
.top-nav a.active { color: var(--brand); background: rgba(255, 255, 255, .72); box-shadow: var(--shadow-sm); font-weight: 650; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.panel-toggles { display: flex; flex: none; gap: 6px; }
.panel-toggles button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap;
}
.panel-toggles button::before { content: ""; width: 11px; height: 10px; border: 1px solid currentColor; border-radius: 2px; }
.panel-toggles button[aria-expanded="true"] { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.panel-toggles button[aria-expanded="true"]::before { box-shadow: inset 3px 0 currentColor; }
.panel-toggles button:hover { border-color: var(--brand); }
.user-box {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .55);
}
.user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink-2); font-weight: 650; }
.user-role { font-size: 10px; color: var(--brand); background: var(--brand-soft); padding: 1px 7px; border-radius: 999px; }
.profile-btn {
  min-height: 32px; padding: 0 7px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--brand); font-size: 12px; font-weight: 650; white-space: nowrap;
}
.profile-btn:hover { background: var(--brand-soft); border-color: var(--brand-line); }
.profile-dialog {
  width: min(400px, calc(100% - 28px)); max-height: calc(100dvh - 28px);
  padding: 24px; border: 1px solid var(--line-strong); border-radius: var(--radius-xl);
  color: var(--ink); background: var(--surface-solid); box-shadow: var(--shadow-lg);
}
.profile-dialog::backdrop { background: rgba(15, 24, 38, .48); }
.profile-dialog h2 { margin: 0; font-size: 22px; }
.profile-account { margin: 4px 0 16px; color: var(--muted); overflow-wrap: anywhere; }
.profile-account strong { color: var(--ink-2); margin-left: 4px; }
.profile-form { display: grid; gap: 12px; }
.profile-status { min-height: 20px; margin: 0; color: var(--muted); }
.profile-status.is-error { color: var(--red); }
.profile-actions { display: flex; justify-content: flex-end; gap: 8px; }
.profile-actions .primary:disabled { cursor: wait; opacity: .65; }

/* ---------------- 主布局 ---------------- */
.app {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; gap: 14px;
  max-width: 1560px; margin: 0 auto; padding: 20px clamp(12px, 2vw, 30px) 60px;
}
.sidebar, .conv-pane { position: sticky; top: 94px; max-height: calc(100dvh - 116px); }
.sidebar {
  flex: 0 0 232px;
  overflow: auto;
  padding: 18px 16px;
  background: linear-gradient(165deg, rgba(255, 255, 255, .72), rgba(255, 252, 248, .48));
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  scrollbar-width: thin; scrollbar-color: rgba(0, 63, 136, .18) transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0, 63, 136, .16); border-radius: 9px; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 8px 12px; }
.side-head span:first-child { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: var(--muted-2); text-transform: uppercase; }
.side-count { font-family: var(--num); font-size: 12px; color: var(--brand); }
.side-search { position: relative; margin-bottom: 14px; }
.side-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.side-search input {
  width: 100%; height: 42px; padding: 0 12px 0 36px;
  border: 1px solid var(--line); border-radius: 13px;
  background: rgba(255, 255, 255, .6); color: var(--ink); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.side-search input::placeholder { color: var(--muted-2); }
.side-search input:focus { border-color: rgba(0, 63, 136, .34); background: #fff; box-shadow: 0 0 0 4px rgba(0, 63, 136, .07); }

.service-nav { display: flex; flex-direction: column; gap: 14px; }
.nav-group-title { font-size: 10.5px; font-weight: 800; letter-spacing: .15em; color: var(--muted-2); padding: 0 9px 5px; }
.nav-service {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 11px;
  color: var(--ink-2); font-size: 13px; line-height: 1.35;
  transition: background .18s, color .18s, transform .18s var(--spring);
}
.nav-service:hover { background: rgba(255, 255, 255, .7); color: var(--brand); transform: translateX(2px); }
.nav-service.active { background: linear-gradient(135deg, var(--brand-soft), rgba(255, 255, 255, .5)); color: var(--brand); font-weight: 700; box-shadow: inset 0 0 0 1px var(--brand-line); }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #c8bdb5; flex: none; }
.nav-dot.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(47, 125, 92, .12); }
.nav-dot.warn { background: var(--gold); box-shadow: 0 0 0 3px rgba(0, 163, 224, .14); }
.nav-name { flex: 1; }
.nav-tag { font-size: 9.5px; color: var(--muted-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 5px; }
.side-empty { padding: 14px 9px; color: var(--muted-2); font-size: 12px; }

.side-tools { display: flex; flex-direction: column; gap: 3px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-tools a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 9px; border-radius: 12px; color: var(--ink-2); font-size: 12.5px;
  transition: background .18s, color .18s;
}
.side-tools a:hover, .side-tools a.active { background: rgba(255, 255, 255, .66); color: var(--brand); }
.side-tools a em { margin-left: auto; font-style: normal; color: var(--muted-2); font-size: 12px; }
.tool-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); flex: none; }
.tool-ico svg { width: 16px; height: 16px; }
.account-icon { position: relative; }
.account-icon::before, .account-icon::after { content: ""; position: absolute; background: currentColor; }
.account-icon::before { width: 6px; height: 6px; top: 6px; border-radius: 50%; }
.account-icon::after { width: 13px; height: 7px; top: 14px; border-radius: 7px 7px 3px 3px; }

/* ---------------- 鍐呭闈㈡澘 ---------------- */
main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.view {
  min-height: calc(100vh - 118px); padding: clamp(22px, 3.2vw, 36px);
  background: linear-gradient(160deg, rgba(255, 255, 255, .82), rgba(255, 252, 248, .62));
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.994); } to { opacity: 1; transform: none; } }

/* ---------------- 棣栭〉 Hero ---------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(290px, .72fr); gap: clamp(22px, 3vw, 42px); align-items: stretch; padding: 6px 2px 28px; border-bottom: 1px solid var(--line); }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.hero h2 { margin: 14px 0 12px; font-size: clamp(36px, 4.3vw, 58px); line-height: .98; letter-spacing: -.055em; font-weight: 850; }
.hero h2 em { font-style: normal; color: var(--brand); }
.hero p { margin: 0; max-width: 600px; color: var(--muted); font-size: 14px; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-stats { display: flex; gap: 22px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); width: 100%; }
.hero-stat b { display: block; font-family: var(--num); font-size: 24px; line-height: 1; color: var(--ink); letter-spacing: -.02em; }
.hero-stat span { display: block; margin-top: 4px; font-size: 11px; color: var(--muted-2); }
.hero-stat:nth-child(1) b { color: var(--brand); }
.hero-stat:nth-child(2) b { color: var(--gold-deep); }
.hero-stat:nth-child(3) b { color: var(--green); }

.hero-card {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px; border-radius: 26px; color: #fff;
  background:
    radial-gradient(320px 180px at 86% -8%, rgba(255, 255, 255, .26), transparent 62%),
    linear-gradient(145deg, #002B5C 0%, #003F88 54%, #0052B4 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 28px 60px -30px rgba(0, 63, 136, .8);
}
.hero-card::after { content: ""; position: absolute; width: 230px; height: 230px; right: -90px; bottom: -120px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); pointer-events: none; }
.hc-head { display: flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: .08em; color: rgba(255, 255, 255, .8); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #cfe9dc; box-shadow: 0 0 0 4px rgba(207, 233, 220, .16); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; box-shadow: 0 0 0 7px rgba(207, 233, 220, .06); } }
.hc-tag { margin-left: auto; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding: 1px 7px; font-size: 9px; letter-spacing: .12em; }
.hc-main { margin-top: auto; }
.hc-label { font-size: 11.5px; color: rgba(255, 255, 255, .72); }
.hc-main strong { display: block; margin: 5px 0 4px; font-size: 26px; line-height: 1.1; letter-spacing: -.03em; font-weight: 800; }
.hc-main p { margin: 0; font-size: 11.5px; color: rgba(255, 255, 255, .76); }
.hc-states { display: flex; flex-wrap: wrap; gap: 5px; }
.hs { font-size: 10px; padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .1); }
.hs.match { background: rgba(186, 230, 208, .18); border-color: rgba(186, 230, 208, .3); }
.hs.unknown { background: rgba(255, 226, 168, .18); border-color: rgba(255, 226, 168, .3); }
.hs.manual { background: rgba(226, 208, 255, .14); border-color: rgba(226, 208, 255, .25); }
.hc-foot { font-size: 10px; color: rgba(255, 255, 255, .54); border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 10px; }

/* ---------------- 鎻愰啋璇?/ 杈撳叆 ---------------- */
.prompt-block { margin-top: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .44); }
.prompt-block.compact { margin: 0 0 16px; }
.prompt-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 9px; }
.prompt-head strong { font-size: 13px; }
.prompt-head span { font-size: 11px; color: var(--muted-2); }
.prompt-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.prompt-bar::-webkit-scrollbar { display: none; }
.prompt-chip {
  flex: 0 0 auto; text-align: left; max-width: 246px;
  border: 1px solid var(--line); border-radius: 13px; padding: 9px 12px;
  background: rgba(255, 255, 255, .72); color: var(--ink-2);
  transition: transform .18s var(--spring), border-color .18s, box-shadow .18s, background .18s;
}
.prompt-chip:hover { transform: translateY(-2px); border-color: var(--brand-line); background: #fff; box-shadow: 0 12px 24px -18px rgba(0, 63, 136, .4); }
.prompt-chip strong { display: block; font-size: 12.5px; color: var(--ink); }
.prompt-chip span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted-2); }
.prompt-more { flex: 0 0 auto; border: 1px dashed var(--line-strong); border-radius: 13px; background: transparent; color: var(--muted); padding: 9px 12px; font-size: 11.5px; }
.prompt-more:hover { color: var(--brand); border-color: var(--brand-line); }

.chat-composer {
  display: flex; gap: 10px; align-items: flex-end; margin: 16px 0 24px;
  padding: 8px; border: 1px solid var(--line); border-radius: 20px;
  background: rgba(255, 255, 255, .62); box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.chat-composer:focus-within { border-color: rgba(0, 63, 136, .32); box-shadow: 0 0 0 4px rgba(0, 63, 136, .06), var(--shadow-sm); }
.chat-composer textarea { flex: 1; border: 0; background: transparent; padding: 10px 12px; resize: vertical; min-height: 48px; outline: none; color: var(--ink); line-height: 1.7; }
.chat-composer textarea::placeholder { color: var(--muted-2); }
.chat-composer .primary { flex: none; border-radius: 14px; padding: 12px 18px; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 12px; }
.section-head h3 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.section-head span { font-size: 11px; color: var(--muted-2); }
.service-shelf { margin-top: 8px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.42); padding: 12px 16px; }
.service-shelf summary { cursor: pointer; font-size: 12px; color: var(--muted); font-weight: 600; }
.service-shelf[open] summary { margin-bottom: 12px; }
.service-shelf .domain-grid { margin-top: 0; }
.source-disclaimer { margin: 12px 0 4px; padding: 10px 13px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 10px; background: rgba(232,240,251,.55); color: var(--muted); font-size: 11.5px; line-height: 1.7; }

/* ---------------- 鏈嶅姟鍩熷崱鐗?---------------- */
.domain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.domain-card {
  --accent: var(--brand); --accent-soft: var(--brand-soft);
  position: relative; overflow: hidden;
  padding: 18px; border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(155deg, var(--accent-soft), rgba(255, 255, 255, .5) 64%);
  transition: transform .24s var(--spring), box-shadow .24s, border-color .24s;
  animation: rise .5s var(--spring) both;
}
.domain-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); pointer-events: none; }
.domain-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); box-shadow: 0 26px 46px -32px rgba(15, 27, 45, .46); }
.domain-card[data-group="award"] { --accent: #003F88; --accent-soft: #f8e9eb; }
.domain-card[data-group="assessment"] { --accent: #0052B4; --accent-soft: #E8F0FB; }
.domain-card[data-group="honor"] { --accent: #a86b12; --accent-soft: #fbf1dd; }
.domain-card[data-group="academic"] { --accent: #2f7d5c; --accent-soft: #e8f4ee; }
.domain-card[data-group="credit"] { --accent: #4F6BED; --accent-soft: #EEF2FF; }
.domain-card[data-group="finance"] { --accent: #a0522d; --accent-soft: #f8ece4; }
.domain-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.domain-mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff; font-weight: 850; font-size: 15px; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 72%, #fff), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 20px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
.domain-title { font-weight: 800; font-size: 14.5px; letter-spacing: -.01em; }
.domain-sub { font-size: 10.5px; color: var(--muted-2); margin-top: 1px; }
.domain-services { display: flex; flex-direction: column; gap: 3px; margin-top: 14px; position: relative; z-index: 1; }
.domain-services a { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); padding: 4px 5px; border-radius: 7px; transition: background .16s, color .16s; }
.domain-services a::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 55%, #fff); flex: none; }
.domain-services a:hover { background: rgba(255, 255, 255, .7); color: var(--accent); }
.mini-tag { font-size: 9px; color: var(--muted-2); margin-left: 4px; }

.recent { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-item { font-size: 12px; padding: 6px 12px; border-radius: 999px; color: var(--muted); border: 1px solid var(--line); background: rgba(255, 255, 255, .5); transition: color .18s, border-color .18s, background .18s; }
.recent-item:hover { color: var(--brand); border-color: var(--brand-line); background: #fff; }

/* ---------------- 鏈嶅姟椤?---------------- */
.service-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.breadcrumb { font-size: 11px; color: var(--muted-2); margin-bottom: 5px; letter-spacing: .04em; }
.service-head h2 { margin: 0 0 5px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.03em; line-height: 1.2; }
.service-head p { margin: 0; color: var(--muted); font-size: 13px; max-width: 720px; }
.service-badges { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex: none; }
.service-badges .badge { background: rgba(255, 255, 255, .55); }
.service-badges .badge.full { background: var(--green-soft); }
.service-badges .badge.lite { background: var(--amber-soft); }
.tabs { display: inline-flex; gap: 3px; margin: 16px 0 18px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .45); }
.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-size: 12.5px; color: var(--muted); transition: color .18s, background .18s, box-shadow .18s; }
.tabs button:hover { color: var(--brand); }
.tabs button.active { background: #fff; color: var(--brand); font-weight: 700; box-shadow: var(--shadow-sm); }
.facts-form { padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 255, 255, .44); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--muted); }
.field > span { font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; background: rgba(255, 255, 255, .74); color: var(--ink); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(0, 63, 136, .38); background: #fff; box-shadow: 0 0 0 4px rgba(0, 63, 136, .07); }
.field em { font-style: normal; font-size: 10.5px; color: var(--muted-2); }
.field.wide { width: 100%; }
.facts-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
#query { resize: vertical; min-height: 66px; }
.actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.empty { padding: 34px 22px; border: 1px dashed var(--line-strong); border-radius: 18px; color: var(--muted-2); text-align: center; font-size: 12.5px; background: rgba(255, 255, 255, .28); }

.conclusion { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 18px 20px; border-radius: 20px; margin: 18px 0 16px; background: rgba(255, 255, 255, .5); border: 1px solid var(--line); border-left: 5px solid var(--muted-2); }
.conclusion.ok { background: linear-gradient(135deg, var(--green-soft), rgba(255, 255, 255, .5)); border-color: rgba(47, 125, 92, .2); border-left-color: var(--green); }
.conclusion.bad { background: linear-gradient(135deg, var(--red-soft), rgba(255, 255, 255, .5)); border-color: rgba(176, 42, 55, .2); border-left-color: var(--red); }
.conclusion.warn { background: linear-gradient(135deg, var(--amber-soft), rgba(255, 255, 255, .5)); border-color: rgba(168, 107, 18, .2); border-left-color: var(--amber); }
.conclusion.manual { background: linear-gradient(135deg, var(--purple-soft), rgba(255, 255, 255, .5)); border-color: rgba(109, 79, 147, .2); border-left-color: var(--purple); }
.conclusion strong { font-size: 19px; letter-spacing: -.02em; }
.conclusion span { font-size: 12.5px; color: var(--muted); }
.conclusion .rule { margin-left: auto; font-size: 10.5px; color: var(--muted-2); font-family: var(--mono); }

.questions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.question { border: 1px solid rgba(168, 107, 18, .2); background: linear-gradient(135deg, var(--amber-soft), rgba(255, 255, 255, .5)); border-radius: 16px; padding: 14px; }
.question p { margin: 0 0 9px; font-size: 13px; color: #6e4c14; }
.question .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.question button { border: 1px solid rgba(168, 107, 18, .28); background: rgba(255, 255, 255, .72); border-radius: 999px; padding: 6px 12px; font-size: 12px; color: #6e4c14; transition: background .16s, transform .16s; }
.question button:hover { background: #fff; transform: translateY(-1px); }

.conditions { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.cond { border: 1px solid var(--line); border-radius: 16px; padding: 13px 15px; background: rgba(255, 255, 255, .44); }
.cond-head { display: flex; align-items: center; gap: 8px; }
.cond-head strong { font-size: 13px; }
.cond-head .ref { font-size: 10.5px; color: var(--muted-2); font-family: var(--mono); }
.state { margin-left: auto; font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--muted); white-space: nowrap; }
.state.MATCH { background: var(--green-soft); color: var(--green); }
.state.MISMATCH { background: var(--red-soft); color: var(--red); }
.state.UNKNOWN { background: var(--amber-soft); color: var(--amber); }
.state.EXCEPTION { background: var(--blue-soft); color: var(--blue); }
.state.MANUAL { background: var(--purple-soft); color: var(--purple); }
.state.INFO { background: rgba(255, 255, 255, .7); color: var(--muted); }
.cond-items { margin-top: 7px; display: flex; flex-direction: column; gap: 4px; }
.cond-item { display: flex; gap: 8px; font-size: 12px; color: var(--muted); }
.cond-item .dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 7px; background: var(--muted-2); flex: none; }
.cond-item .dot.MATCH { background: var(--green); }
.cond-item .dot.MISMATCH { background: var(--red); }
.cond-item .dot.UNKNOWN { background: var(--amber); }
.cond-note { font-size: 11.5px; color: var(--blue); margin-top: 5px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.panel { border: 1px solid var(--line); border-radius: 18px; padding: 15px 16px; background: rgba(255, 255, 255, .42); }
.panel h3 { margin: 0 0 9px; font-size: 13px; letter-spacing: .01em; }
.panel ul { margin: 0; padding-left: 17px; color: var(--muted); font-size: 12px; }
.panel li { margin: 3px 0; }
.cite { font-size: 12px; color: var(--muted); padding: 7px 0; border-bottom: 1px dashed var(--line); }
.cite:last-child { border-bottom: 0; }
.cite b { color: var(--ink); }
.cite q { display: block; color: var(--muted); font-style: normal; margin-top: 2px; }
.disclaimer { margin: 16px 0 0; font-size: 11px; color: var(--muted-2); border-top: 1px solid var(--line); padding-top: 12px; }

.clause-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; background: rgba(255, 255, 255, .42); }
.clause-head { font-weight: 800; font-size: 13px; margin-bottom: 7px; }
.clause-card blockquote { margin: 0 0 9px; padding: 10px 12px; background: rgba(255, 255, 255, .56); border-left: 3px solid var(--brand-line); border-radius: 0 10px 10px 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.clause-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.panel-title { font-size: 11px; color: var(--muted-2); margin: 16px 0 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

/* ---------------- 瑙勫垯搴?---------------- */
.dropzone {
  position: relative; margin-top: 18px; padding: 26px 22px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: 20px;
  background: linear-gradient(150deg, rgba(255, 255, 255, .5), rgba(247, 239, 225, .34));
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--muted); transition: border-color .2s, background .2s, transform .2s;
}
.dropzone:hover, .dropzone.dragover { border-color: rgba(0, 63, 136, .42); background: rgba(255, 255, 255, .7); transform: translateY(-1px); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); margin-bottom: 4px; }
.dz-icon svg { width: 22px; height: 22px; }
.dropzone strong { color: var(--ink-2); font-size: 14px; }
.dropzone span { font-size: 11.5px; color: var(--muted-2); }
.atomgit { margin-top: 14px; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: rgba(255, 255, 255, .34); }
.atomgit summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.atomgit .facts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.atomgit .field.wide { grid-column: span 3; }
.list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.rule-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .46); }
.rule-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); flex: none; }
.rule-item .dot.active { background: var(--green); box-shadow: 0 0 0 3px rgba(47, 125, 92, .1); }
.rule-item .dot.review { background: var(--amber); box-shadow: 0 0 0 3px rgba(168, 107, 18, .1); }
.rule-item .meta { min-width: 0; flex: 1; }
.rule-item .meta strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-item .meta small { color: var(--muted-2); font-size: 10.5px; font-family: var(--mono); }
.rule-item .tag { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--muted); }
.rule-item .tag.active { background: var(--green-soft); color: var(--green); }
.rule-item .tag.review { background: var(--amber-soft); color: var(--amber); }
.rule-item button { border: 1px solid var(--line); background: rgba(255, 255, 255, .7); border-radius: 999px; padding: 5px 11px; font-size: 11px; color: var(--ink-2); }
.rule-item button:hover { color: var(--brand); border-color: var(--brand-line); }
.upload-log { margin-top: 12px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.upload-log .ok { color: var(--green); }
.upload-log .err { color: var(--red); }

/* ---------------- 鑷祴 / 鏉ユ簮 / 瀵煎嚭 ---------------- */
.quiz-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.quiz-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 13px; padding: 10px 13px; font-size: 12.5px; background: rgba(255, 255, 255, .42); }
.quiz-item .name { flex: 1; color: var(--ink-2); }
.quiz-item .exp { color: var(--muted-2); font-size: 11px; }
.quiz-item .res { font-weight: 800; font-size: 11.5px; }
.quiz-item .res.ok { color: var(--green); }
.quiz-item .res.bad { color: var(--red); }
.source-group { margin-bottom: 20px; }
.source-group h3 { margin: 0 0 9px; font-size: 15px; }
.source-item { border: 1px solid var(--line); border-radius: 15px; padding: 13px 15px; margin-bottom: 8px; background: rgba(255, 255, 255, .42); }
.source-top { display: flex; gap: 8px; align-items: flex-start; }
.source-top strong { flex: 1; font-size: 13px; }
.source-level { font-size: 9.5px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--muted); white-space: nowrap; }
.source-level.school { background: var(--blue-soft); color: var(--blue); }
.source-level.college { background: var(--amber-soft); color: var(--amber); }
.source-meta { font-size: 11px; color: var(--muted-2); margin-top: 4px; }
.source-note { font-size: 12px; color: var(--ink-2); margin-top: 4px; line-height: 1.7; }
.source-link { display: inline-block; margin-top: 6px; font-size: 11.5px; color: var(--brand); font-weight: 650; }
.source-link:hover { text-decoration: underline; }
.source-local { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--muted-2); }
.export-preview { margin: 16px 0 0; background: rgba(255, 255, 255, .46); border: 1px solid var(--line); border-radius: 16px; padding: 14px; font-size: 11.5px; color: var(--ink-2); max-height: 300px; overflow: auto; white-space: pre-wrap; font-family: var(--mono); line-height: 1.75; }

/* ---------------- 绠＄悊鍛?---------------- */
.admin-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.admin-item { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: rgba(255, 255, 255, .42); }
.admin-top { display: flex; align-items: center; gap: 8px; }
.admin-top strong { flex: 1; font-size: 13px; }
.admin-meta { font-size: 11px; color: var(--muted-2); margin-top: 4px; }
.admin-note { font-size: 12px; color: var(--muted); margin-top: 4px; }
.admin-note.err { color: var(--red); }
.admin-note.ok { color: var(--green); }
#adminUserSearch { flex: 1 1 240px; min-width: 180px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 13px; color: inherit; }
#adminUserSearch:focus { outline: none; border-color: var(--brand-line); box-shadow: 0 0 0 3px rgba(47, 125, 92, .08); }
.user-row { border: 1px solid var(--line); border-radius: 16px; padding: 13px 16px; background: rgba(255, 255, 255, .42); }
.user-row.self { border-color: var(--brand-line); background: rgba(47, 125, 92, .05); }
.user-row .user-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-row .user-head strong { font-size: 13.5px; }
.user-row .user-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }
.user-row .user-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.user-row .user-actions button { font-size: 11.5px; padding: 5px 11px; border-radius: 10px; }
.user-row .user-sub { overflow-wrap: anywhere; }
.user-actions .account-delete, .account-status.is-error { color: var(--red); }
.user-actions button:disabled { opacity: .55; cursor: default; }
.account-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.account-toolbar .field { flex: 1 1 240px; }
.account-status:empty { display: none; }
.tag { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: rgba(255, 255, 255, .7); }
.tag.admin { color: var(--brand); border-color: var(--brand-line); background: var(--green-soft); }
.tag.off { color: var(--red); border-color: rgba(190, 60, 60, .25); background: rgba(190, 60, 60, .07); }
.tag.me { color: var(--amber); border-color: rgba(168, 107, 18, .24); background: var(--amber-soft); }
.submission-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; background: rgba(255, 255, 255, .42); font-size: 12px; flex-wrap: wrap; }.submission-row strong { min-width: 120px; }
.sub-status { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--muted); white-space: nowrap; }
.sub-status.pending { background: var(--amber-soft); color: var(--amber); }
.sub-status.approved { background: var(--blue-soft); color: var(--blue); }
.sub-status.published { background: var(--green-soft); color: var(--green); }
.sub-status.rejected { background: var(--red-soft); color: var(--red); }
.sub-status.processing { background: var(--purple-soft); color: var(--purple); }
.site-notice {
  width: min(calc(100% - 32px), 1400px);
  margin: 0 auto 24px;
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface-solid);
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.site-notice strong { color: var(--ink); }
.site-notice p { margin: 4px 0 0; }
#appShell, .auth-screen { flex: 1; }

/* ---------------- 鐧诲綍椤?---------------- */
.auth-screen {
  min-height: 0; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
  background:
    radial-gradient(760px 520px at 10% 4%, rgba(0, 63, 136, .10), transparent 62%),
    radial-gradient(700px 520px at 96% 90%, rgba(0, 163, 224, .16), transparent 65%),
    linear-gradient(150deg, #F7FAFE 0%, #EEF4FB 58%, #E7EFF9 100%);
  overflow-x: hidden;
  overflow-y: auto;
}
.auth-story { position: relative; display: flex; flex-direction: column; padding: clamp(28px, 5vw, 74px); overflow: hidden; }
.auth-story::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(72, 50, 42, .055) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(70% 60% at 44% 44%, rgba(0, 0, 0, .5), transparent 78%);
  -webkit-mask-image: radial-gradient(70% 60% at 44% 44%, rgba(0, 0, 0, .5), transparent 78%);
}
.auth-brand, .auth-copy, .auth-meter { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 11px; }
.auth-brand .brand-mark { width: 44px; height: 44px; border-radius: 14px; }
.auth-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.auth-brand-text b { font-size: 18px; letter-spacing: .12em; }
.auth-brand-text small { font-size: 9.5px; letter-spacing: .18em; color: var(--muted-2); }
.auth-copy { margin: auto 0; max-width: 620px; padding: 48px 0 24px; }
.auth-copy h1 { margin: 18px 0 14px; font-size: clamp(42px, 5.4vw, 76px); line-height: .96; letter-spacing: -.06em; font-weight: 850; }
.auth-copy h1 em { font-style: normal; color: var(--brand); }
.auth-lead { margin: 0; max-width: 470px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.auth-points { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-width: 470px; }
.auth-points li { display: flex; gap: 12px; align-items: baseline; padding-top: 11px; border-top: 1px solid var(--line); }
.auth-points b { flex: none; width: 78px; font-size: 12px; color: var(--brand); }
.auth-points span { font-size: 12px; color: var(--muted); }
.auth-meter {
  width: min(420px, 100%); padding: 18px 20px; border-radius: 22px;
  color: #fff; background: linear-gradient(145deg, #002B5C, #003F88 58%, #0052B4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26), 0 28px 60px -34px rgba(0, 63, 136, .8);
}
.meter-head { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: rgba(255, 255, 255, .8); letter-spacing: .08em; }
.meter-tag { margin-left: auto; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding: 1px 6px; font-size: 8.5px; }
.meter-title { margin-top: 12px; font-size: 11.5px; color: rgba(255, 255, 255, .72); }
.meter-state { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.meter-state b { font-size: 25px; letter-spacing: -.03em; }
.meter-state span { font-size: 10.5px; color: rgba(255, 255, 255, .7); }
.meter-bars { display: flex; gap: 5px; margin-top: 13px; }
.meter-bars i { display: block; height: 5px; width: var(--w); border-radius: 999px; background: var(--c); opacity: .85; }
.meter-foot { margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 9.5px; color: rgba(255, 255, 255, .54); }
.auth-panel { display: grid; place-items: center; padding: clamp(22px, 4vw, 54px); }
.auth-card {
  width: min(430px, 100%); padding: 30px 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .86), rgba(255, 252, 248, .68));
  border: 1px solid rgba(255, 255, 255, .86); border-radius: 28px;
  box-shadow: var(--shadow-lg); backdrop-filter: blur(24px) saturate(150%);
  animation: rise .5s var(--spring) both;
}
.auth-head { margin-bottom: 18px; }
.auth-head h2 { margin: 7px 0 4px; font-size: 27px; letter-spacing: -.035em; }
.auth-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.auth-tabs { display: flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .45); margin-bottom: 20px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 999px; color: var(--muted); font-size: 12.5px; transition: color .18s, background .18s, box-shadow .18s; }
.auth-tabs button.active { background: #fff; color: var(--brand); font-weight: 700; box-shadow: var(--shadow-sm); }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row input { flex: 1 1 auto; min-width: 0; letter-spacing: 2px; }
.code-row button { flex: 0 0 auto; white-space: nowrap; padding: 0 14px; border-radius: 12px; font-size: 12px; }
.code-row button:disabled { opacity: .55; cursor: default; transform: none; }
.auth-form .primary { margin-top: 3px; width: 100%; border-radius: 14px; padding: 13px 18px; font-size: 14px; }
.auth-msg { min-height: 16px; font-size: 11.5px; color: var(--red); margin: 0; }
.auth-note { font-size: 10.5px; color: var(--muted-2); line-height: 1.7; margin: 2px 0 0; }

/* ---------------- 鍝嶅簲寮?---------------- */
@media (max-width: 1180px) {
  .facts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 980px) {
  .top-nav { display: none; }
  .app { flex-direction: column; padding-top: 16px; }
  .app > * { width: 100%; scroll-margin-top: 104px; }
  .app > aside { position: static; flex: none; max-height: min(58dvh, 460px); }
  .service-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
  .side-tools { display: grid; grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-card { max-width: 520px; }
  .domain-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-story { padding: 30px 26px 10px; }
  .auth-copy { padding: 26px 0 16px; }
  .auth-points { display: none; }
  .auth-meter { max-width: 100%; }
  .auth-panel { padding: 10px 20px 30px; }
}
@media (max-width: 680px) {
  .topbar { min-height: 66px; height: auto; padding: 8px 12px; gap: 6px 10px; flex-wrap: wrap; }
  .top-actions { margin-left: 0; flex-wrap: wrap; gap: 6px; }
  .brand-text small { display: none; }
  .top-actions .badge { display: none; }
  .app { padding: 12px 12px 44px; }
  .view { padding: 20px 16px; border-radius: 24px; }
  .hero h2 { font-size: 39px; }
  .hero-stats { gap: 16px; flex-wrap: wrap; }
  .hero-stat b { font-size: 21px; }
  .service-nav, .side-tools { grid-template-columns: 1fr; }
  .facts-grid { grid-template-columns: 1fr 1fr; }
  .service-head { flex-direction: column; }
  .service-badges { flex-direction: row; align-items: center; }
  .auth-copy h1 { font-size: 42px; }
  .auth-card { padding: 24px 20px; border-radius: 24px; }
  .user-box { padding: 0; gap: 6px; border: 0; background: transparent; }
  .user-name, .user-role { display: none; }
  .profile-btn { min-height: 36px; border-color: var(--line-strong); background: var(--surface); }
  .atomgit .facts-grid { grid-template-columns: 1fr; }
  .atomgit .field.wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}




/* ---------------- Agent 对话工作台 ---------------- */
.agent-head {
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  padding: 24px 26px; border-radius: 24px; color: #fff;
  background: radial-gradient(360px 180px at 88% -10%, rgba(255,255,255,.20), transparent 62%), linear-gradient(135deg, #003F88 0%, #0052B4 56%, #0078D4 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 24px 50px -30px rgba(0,63,136,.58);
  margin-bottom: 18px; position: relative; overflow: hidden;
}
.agent-head::after { content: ""; position: absolute; width: 220px; height: 220px; right: -70px; bottom: -140px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); pointer-events: none; }
.agent-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.agent-avatar {
  width: 54px; height: 54px; border-radius: 17px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
}
.agent-avatar svg { width: 30px; height: 30px; }
.agent-meta { min-width: 0; }
.agent-meta h2, .agent-meta h3 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.agent-meta h2 em, .agent-meta h3 em { font-style: normal; color: #8FD8FF; font-size: .58em; font-weight: 600; letter-spacing: .08em; vertical-align: middle; }
.agent-meta p { margin: 4px 0 0; font-size: 12.5px; color: rgba(255,255,255,.72); }
.agent-online {
  display: inline-flex; align-items: center; gap: 5px; flex: none; margin-left: 2px;
  font-size: 11px; color: #7BE495; background: rgba(123,228,149,.10);
  border: 1px solid rgba(123,228,149,.28); border-radius: 999px; padding: 3px 9px;
}
.agent-online i { width: 6px; height: 6px; border-radius: 50%; background: #7BE495; box-shadow: 0 0 8px #7BE495; }
.agent-head .hero-stats { width: auto; margin: 0; padding: 0; border: 0; gap: 20px; }
.agent-head .hero-stat b { color: #fff; font-size: 20px; }
.agent-head .hero-stat span { color: rgba(255,255,255,.64); }

.agent-thread {
  display: flex; flex-direction: column; gap: 18px;
  min-height: 200px; max-height: 46dvh; overflow-y: auto;
  padding: 22px 20px; border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(248,251,255,.45));
  margin-bottom: 14px; scrollbar-width: thin; scrollbar-color: rgba(0,63,136,.18) transparent;
}
.agent-thread::-webkit-scrollbar { width: 5px; }
.agent-thread::-webkit-scrollbar-thumb { background: rgba(0,63,136,.16); border-radius: 9px; }
.agent-msg { display: flex; flex: none; gap: 10px; align-items: flex-start; max-width: 88%; }
.agent-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-bright));
  box-shadow: 0 6px 14px -8px rgba(0,63,136,.55);
}
.agent-msg.user .msg-avatar { background: linear-gradient(135deg, #5B8DEF, #8B5CF6); }
.msg-bubble {
  padding: 12px 15px; border-radius: 4px 16px 16px 16px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2);
  font-size: 13.5px; line-height: 1.8; white-space: pre-wrap; word-break: break-word;
  box-shadow: 0 8px 22px -20px rgba(15,27,45,.35);
}
.agent-msg.user .msg-bubble {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  border-color: transparent; border-radius: 16px 4px 16px 16px;
}
.msg-bubble.is-typing { color: var(--muted); font-style: italic; }
.agent-wait-label::after { content: " ···"; letter-spacing: 2px; animation: breathe 1.4s ease-in-out infinite; }
.agent-activity { list-style: none; margin: 8px 0 0; padding: 0; font-style: normal; }
.agent-activity-step { display: flex; align-items: baseline; gap: 6px; color: var(--ink-2); font-size: 12px; }
.agent-activity-step + .agent-activity-step { margin-top: 5px; }
.agent-activity-step::before {
  content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--line-strong); align-self: center;
}
.agent-activity-step[data-state="ok"]::before { background: var(--green); border-color: var(--green); }
.agent-activity-step[data-state="error"]::before, .agent-activity-step[data-state="warn"]::before { background: var(--amber); border-color: var(--amber); }
.agent-activity-step[data-state="running"]::before { border-color: var(--brand); border-right-color: transparent; animation: agent-step-spin .85s linear infinite; }
.agent-activity-state { margin-left: auto; color: var(--muted); white-space: nowrap; }
.agent-activity-label { margin-right: 8px; }
@keyframes agent-step-spin { to { transform: rotate(360deg); } }

/* ================= 执行演示：阶段条 / 执行树 / 折叠摘要 =================
   配色沿用现设计（品牌蓝 + 细线 + 极淡底），不再用早期的整块蓝卡片。 */
.agent-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 9px; padding: 7px 10px; border: 1px solid var(--brand-line); border-radius: 10px; background: rgba(255, 255, 255, .66); font-size: 12px; color: var(--muted); }
.agent-log-body .agent-steps { margin-top: 6px; }
.agent-step { display: inline-flex; align-items: center; gap: 5px; color: var(--muted-2); white-space: nowrap; }
.agent-step-dot { width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; }
.agent-step.is-active { color: var(--brand); font-weight: 600; }
.agent-step.is-active .agent-step-dot { border-color: var(--brand); border-right-color: transparent; animation: agent-step-spin .85s linear infinite; }
.agent-step.is-done { color: var(--ink-2); }
.agent-step.is-done .agent-step-dot { background: var(--green); border-color: var(--green); }
.agent-step.is-skipped { opacity: .45; }
.agent-step.is-skipped .agent-step-dot { border-style: dashed; }
.agent-step.is-warn { color: var(--amber); }
.agent-step.is-warn .agent-step-dot { background: var(--amber); border-color: var(--amber); }
.agent-step-conclusion { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.agent-step-conclusion.is-ok { color: var(--green); }
.agent-step-conclusion.is-bad { color: var(--red); }

.agent-tree { list-style: none; margin: 8px 0 4px; padding: 0 0 0 12px; position: relative; }
.agent-tree::before { content: ''; position: absolute; left: 3px; top: 10px; bottom: 10px; width: 1px; background: var(--line); }
.agent-node { position: relative; padding: 3px 8px 5px 9px; border-radius: 8px; transition: background .25s; }
.agent-node::before { content: ''; position: absolute; left: -9px; top: 11px; width: 7px; height: 1px; background: var(--line-strong); }
.agent-node-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.agent-node-icon { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--line-strong); background: transparent; display: inline-block; flex: none; }
.agent-node-title { font-weight: 600; color: inherit; }
.agent-node-ms { margin-left: auto; font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.agent-node-why { font-size: 11.5px; color: var(--muted-2); margin: 2px 0 0 16px; line-height: 1.5; }
.agent-node-summary { font-size: 12px; color: var(--ink-2); margin: 2px 0 0 16px; line-height: 1.5; }
.agent-node-summary:empty, .agent-node-ms:empty { display: none; }
.agent-node.is-pending { opacity: .5; }
.agent-node.is-running { background: var(--brand-soft); }
.agent-node.is-running .agent-node-head { color: var(--brand); }
.agent-node.is-running .agent-node-icon { border-color: var(--brand); border-top-color: transparent; animation: agent-step-spin .8s linear infinite; }
.agent-node.is-running .agent-node-why::after { content: '…'; }
.agent-node.is-done .agent-node-head { color: var(--ink); }
.agent-node.is-done .agent-node-icon { border-color: var(--green); background: var(--green); animation: agent-node-flash .5s ease-out; }
.agent-node.is-skipped { opacity: .45; }
.agent-node.is-skipped .agent-node-icon { border-style: dashed; }
.agent-node.is-error .agent-node-head, .agent-node.is-warn .agent-node-head { color: var(--amber); }
.agent-node.is-error .agent-node-icon, .agent-node.is-warn .agent-node-icon { border-color: var(--amber); background: var(--amber-soft); animation: agent-node-flash .5s ease-out; }
.agent-node.is-error .agent-node-summary, .agent-node.is-warn .agent-node-summary { color: var(--amber); }
@keyframes agent-node-flash { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .38); } 100% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } }

/* 折叠摘要：一行说完「跑了几个动作、全绿没有」，点开再看细节 */
.agent-log { margin: 8px 0 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .55); overflow: hidden; overflow-anchor: none; }
.agent-log-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 11px; border: 0; background: var(--brand-soft); color: var(--brand); font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.agent-log-head:hover { background: var(--brand-line); }
.agent-log-title { font-weight: 600; white-space: nowrap; }
.agent-log-dots { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.agent-log-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.agent-log-dot.is-done { background: var(--green); }
.agent-log-dot.is-skipped { background: var(--line-strong); }
.agent-log-dot.is-warn { background: var(--amber); }
.agent-log-dot.is-running { background: var(--brand); animation: agent-dot-pulse 1.2s ease-in-out infinite; }
@keyframes agent-dot-pulse { 50% { opacity: .3; } }
.agent-log-hint { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.agent-log-caret { color: var(--brand); font-size: 11px; }
.agent-log-body { padding: 2px 12px 10px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.agent-log.is-collapsed .agent-log-body { display: none; }
.agent-log .agent-tree { margin-top: 4px; }
/* 展开执行过程时把对话区临时加高，46dvh 装不下整棵树 */
.agent-thread:has(.agent-log.is-open) { max-height: 74dvh; }
@media (prefers-reduced-motion: reduce) {
  .agent-step-dot, .agent-node-icon, .agent-log-dot { animation: none !important; }
}
@media (prefers-reduced-motion: reduce) { .agent-wait-label::after, .agent-activity-step::before { animation: none; } }

.chat-markdown { white-space: normal; overflow-wrap: anywhere; }
.chat-markdown > :first-child { margin-top: 0; }
.chat-markdown > :last-child { margin-bottom: 0; }
.chat-markdown p, .chat-markdown ul, .chat-markdown ol,
.chat-markdown blockquote, .chat-markdown pre, .chat-markdown-table { margin: .6em 0; }
.chat-markdown h1, .chat-markdown h2, .chat-markdown h3,
.chat-markdown h4, .chat-markdown h5, .chat-markdown h6 {
  margin: .9em 0 .35em; line-height: 1.4; color: var(--ink);
}
.chat-markdown h1 { font-size: 1.35em; }
.chat-markdown h2 { font-size: 1.22em; }
.chat-markdown h3 { font-size: 1.1em; }
.chat-markdown h4, .chat-markdown h5, .chat-markdown h6 { font-size: 1em; }
.chat-markdown ul, .chat-markdown ol { padding-inline-start: 1.65em; }
.chat-markdown li > ul, .chat-markdown li > ol { margin-block: .2em; }
.chat-markdown blockquote {
  padding-inline-start: .85em; border-inline-start: 3px solid var(--line-strong); color: var(--muted);
}
.chat-markdown a[href] { color: var(--brand); text-decoration: underline; }
.chat-markdown code { border-radius: 4px; padding: .1em .3em; background: #f0f5fa; }
.chat-markdown pre {
  overflow-x: auto; white-space: pre; word-break: normal; padding: .6em .85em;
  border-radius: 8px; background: #f0f5fa;
}
.chat-markdown pre code { padding: 0; }
.chat-markdown-table { overflow-x: auto; }
.chat-math-display { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.chat-math-display > .katex-display { margin: .65em 0; padding: .15em 0; }
.chat-math-display > .katex-display > .katex { min-width: max-content; }
.chat-markdown table { border-collapse: collapse; font-size: inherit; }
.chat-markdown th, .chat-markdown td { border: 1px solid var(--line-strong); padding: .25em .6em; }
.chat-markdown th { text-align: start; background: #f0f5fa; }
.chat-markdown hr { border: 0; border-top: 1px solid var(--line); margin: .8em 0; }
.agent-msg.assistant .msg-bubble { min-width: 0; }

.agent-prompts { margin: 0 0 10px; padding: 0; border: 0; background: transparent; }
.agent-prompts .prompt-head { margin-bottom: 8px; }
.agent-prompts .prompt-chip { border-radius: 12px; background: rgba(255,255,255,.82); }
.agent-composer {
  margin: 0 0 14px; border-radius: 18px; padding: 8px;
  background: #fff; border: 1.5px solid var(--line-strong);
  box-shadow: 0 12px 30px -24px rgba(15,27,45,.38);
}
.agent-composer textarea { min-height: 52px; }
.chat-attach-btn { flex: none; align-self: flex-end; border-radius: 13px; padding: 12px 14px; white-space: nowrap; }
.chat-attach-btn.is-busy { opacity: .6; pointer-events: none; }
.chat-attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.chat-attach-list[hidden] { display: none; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); background: var(--brand-soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.attach-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.attach-chip.is-fail { background: var(--amber-soft); color: var(--amber); }
.msg-bubble .attach-chip { margin-top: 6px; }
.agent-composer .primary { border-radius: 13px; padding: 12px 20px; }
.agent-composer .primary:disabled { opacity: .55; cursor: wait; transform: none; }
.agent-composer .primary svg { width: 16px; height: 16px; }

.agent-service-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.62);
}
.agent-identity.small .agent-avatar { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-bright)); border: 0; }
.agent-identity.small .agent-avatar svg { width: 22px; height: 22px; }
.agent-service-bar .agent-meta h3 { font-size: 15px; color: var(--ink); }
.agent-service-bar .agent-meta h3 em { color: var(--brand); font-size: .66em; }
.agent-service-bar .agent-meta p { color: var(--muted); font-size: 11.5px; }
.agent-service-bar .agent-online { color: var(--green); background: var(--green-soft); border-color: rgba(22,163,74,.24); margin: 0; }
.agent-service-bar .agent-online i { background: var(--green); box-shadow: 0 0 6px rgba(22,163,74,.5); }
.small-btn { padding: 7px 12px; font-size: 12px; }
.precheck-tools {
  margin: 4px 0 14px; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 14px; background: rgba(255,255,255,.46);
}
.precheck-tools summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.precheck-tools .facts-form { margin-top: 12px; padding: 0; border: 0; background: transparent; }

@media (max-width: 900px) {
  .agent-head { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
  .agent-head .hero-stats { gap: 18px; flex-wrap: wrap; }
  .agent-thread { max-height: 42vh; min-height: 220px; }
  .agent-msg { max-width: 94%; }
}
@media (max-width: 620px) {
  .agent-identity { flex-wrap: wrap; }
  .agent-meta h2 { font-size: 19px; }
  .agent-head .hero-stat b { font-size: 19px; }
  .agent-service-bar { flex-direction: column; align-items: flex-start; }
}

.chat-basis { margin-top: .5rem; white-space: normal; }
.chat-basis summary, .admin-rule-review summary { cursor: pointer; }
.chat-basis p { margin: .55rem 0; }
.admin-rule-review { display: grid; gap: .8rem; margin-top: 1rem; }
.admin-rule-review[hidden] { display: none; }
.admin-rule-review fieldset { border: 1px solid var(--line); border-radius: 8px; }
.admin-rule-review fieldset label { display: inline-block; margin: .3rem .75rem .3rem 0; }
.rule-item .tag.reference { background: var(--brand-soft); color: var(--brand); }
[data-admin-filter].active { border-color: var(--brand); color: var(--brand); }
.import-comparison { margin-top: 12px; }
.import-comparison summary { cursor: pointer; color: var(--brand); }
.import-comparison-panel { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.import-comparison-panel pre { max-height: 26rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .import-comparison-panel { grid-template-columns: minmax(0, 1fr); }
}
.admin-rule-review .review-original { max-height: 20rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-rule-review textarea { font-family: monospace; width: 100%; }
.admin-confirm { display: block; }

.source-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 12px; margin: 1rem 0; }
.source-more, .source-attachments { margin-top: .75rem; }
.source-more > summary, .source-attachments > summary { cursor: pointer; }
.source-attachments a { display: block; margin: .4rem 0; overflow-wrap: anywhere; }
.chat-source { padding: .5rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.chat-source-quote { max-height: 8rem; overflow: auto; white-space: pre-line; }
@media (max-width: 640px) {
  .source-filters { grid-template-columns: 1fr 1fr; }
  .source-filters > label:first-child { grid-column: 1 / -1; }
}

.competition-directory { margin-bottom: 1rem; }
.competition-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: .8rem; }
.competition-results { display: grid; gap: .5rem; margin: .75rem 0; }
.competition-row { padding: .7rem .85rem; border: 1px solid var(--line); border-radius: .65rem; }
.competition-row .source-link { display: inline-block; margin-right: .9rem; margin-top: .2rem; }
@media (max-width: 650px) {
  .competition-filters { grid-template-columns: 1fr; }
}

.agent-trace-quote { margin: .3rem 0; padding: 6px 10px; border-left: 3px solid var(--brand-line); background: var(--brand-soft); border-radius: 6px; font-size: 12.5px; white-space: pre-line; overflow-wrap: anywhere; }
.agent-ask, .agent-next { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.agent-ask-option { border: 1px solid var(--brand-line); border-radius: 999px; padding: 6px 13px; background: #fff; color: var(--brand); font-size: 12.5px; font-weight: 650; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.agent-ask-option:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand); transform: translateY(-1px); }
.agent-ask-option:disabled { opacity: .5; cursor: default; }
.agent-ask-option.is-selected:disabled { opacity: 1; background: var(--brand-soft); border-color: var(--brand); }
/* ---------------- 会话栏 ---------------- */
.conv-pane {
  flex: 0 0 256px;
  padding: 14px 12px;
  background: linear-gradient(165deg, rgba(255, 255, 255, .72), rgba(255, 252, 248, .48));
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; min-height: 0;
}
.conv-pane-inner { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.conv-head { display: block; }
.conv-new {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 13px; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), #0a56a8);
  color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 63, 136, .22);
  transition: transform .16s, box-shadow .16s, filter .16s;
}
.conv-new:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0, 63, 136, .26); filter: brightness(1.04); }
.conv-new span:first-child { font-size: 15px; line-height: 1; }
.conv-list { display: flex; flex-direction: column; gap: 3px; overflow: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(0, 63, 136, .18) transparent; }
.conv-group { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; color: var(--muted-2); padding: 8px 8px 4px; text-transform: uppercase; }
.conv-item {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 9px;
  width: 100%; box-sizing: border-box;
  padding: 9px 8px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent;
  transition: background .16s, border-color .16s;
}
.conv-list { align-items: stretch; }
.conv-item:hover { background: rgba(0, 63, 136, .055); border-color: rgba(0, 63, 136, .1); }
.conv-item.active { background: var(--brand-soft); border-color: var(--brand-line); }
.conv-item.active .conv-title { color: var(--brand); }
.conv-main { min-width: 0; }
.conv-title { font-size: 12.8px; font-weight: 640; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.conv-more {
  flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 15px; line-height: 1; opacity: 0;
  transition: opacity .16s, background .16s, color .16s;
}
.conv-item:hover .conv-more, .conv-item.active .conv-more { opacity: 1; }
.conv-more:hover { background: rgba(0, 63, 136, .1); color: var(--brand); }
.conv-menu {
  position: absolute; right: 8px; top: 34px; z-index: 6;
  display: flex; flex-direction: column; gap: 2px; min-width: 108px; padding: 5px;
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 12px 28px rgba(12, 28, 54, .16);
}
.conv-menu[hidden] { display: none; }
.conv-menu-item { border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.conv-menu-item:hover { background: var(--brand-soft); color: var(--brand); }
.conv-menu-item.danger:hover { background: rgba(193, 58, 58, .1); color: var(--red, #c13a3a); }
.conv-rename {
  width: 100%; height: 26px; padding: 0 8px; font-size: 12.6px; color: var(--ink);
  border: 1px solid var(--brand-line); border-radius: 8px; background: #fff; outline: none;
  box-shadow: 0 0 0 3px rgba(0, 63, 136, .08);
}
.conv-empty { margin: 6px 8px 2px; font-size: 11.8px; line-height: 1.6; color: var(--muted-2); }

/* 附件入口与文件 chip：图标按钮 + 紧凑标签，不再撑高输入区 */
.chat-attach-btn {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-end; flex: none;
  height: 38px; padding: 0 12px; border-radius: 11px;
  border: 1px solid var(--brand-line); background: rgba(255, 255, 255, .72);
  color: var(--brand); font-size: 12.5px; font-weight: 650; white-space: nowrap; cursor: pointer;
  transition: background .16s, border-color .16s, transform .16s;
}
.chat-attach-btn svg { width: 15px; height: 15px; }
.chat-attach-btn:hover { background: var(--brand-soft); border-color: var(--brand); transform: translateY(-1px); }
.chat-attach-btn.is-busy { opacity: .55; pointer-events: none; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 260px;
  font-size: 11.8px; color: var(--brand); background: var(--brand-soft);
  border: 1px solid rgba(0, 63, 136, .14); border-radius: 10px; padding: 5px 9px;
}
.attach-chip .attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.attach-chip .attach-size { color: var(--muted-2); font-size: 10.5px; }
.attach-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; border-radius: 6px; }
.attach-chip button:hover { color: var(--red, #c13a3a); background: rgba(193, 58, 58, .1); }
.attach-chip.is-loading { opacity: .7; }
.attach-chip.is-fail { background: var(--amber-soft); color: var(--amber); border-color: rgba(190, 130, 20, .22); }

@media (prefers-reduced-motion: reduce) { .conv-new, .chat-attach-btn { transition: none; } }

/* 判定依据 / 依据原文 折叠 */
.verdict-fold { margin: 8px 0; border-left: 3px solid #dfeaf7; padding-left: 10px; }
.verdict-fold > summary { cursor: pointer; list-style: none; color: #1c4f8a; font-size: 13px; font-weight: 600; outline: none; }
.verdict-fold > summary::-webkit-details-marker { display: none; }
.verdict-fold > summary::before { content: '▸ '; }
.verdict-fold[open] > summary::before { content: '▾ '; }
.verdict-fold p, .verdict-fold li { font-size: 13px; line-height: 1.65; color: #4a5a6a; }

.composer-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 4px 0; min-height: 26px; }
.model-select { position: relative; }
.model-select-btn {
  display: inline-flex; align-items: center; gap: 7px; max-width: 240px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--ink); padding: 5px 10px; font-size: 12px; cursor: pointer;
}
.model-select-btn:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.model-dot { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.12); flex: none; }
.model-dot.is-loading { background: var(--brand); box-shadow: 0 0 0 3px rgba(0,63,136,.10); }
.model-caret { color: var(--muted-2); font-size: 12px; }
.model-menu {
  position: absolute; z-index: 40; left: 0; bottom: calc(100% + 8px);
  width: 330px; max-width: min(82vw, 330px); max-height: 320px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 44px -22px rgba(15,27,45,.42); padding: 6px;
}
.model-menu[hidden] { display: none; }
.model-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 6px; font-size: 11px; color: var(--muted-2); }
.model-refresh { border: 0; background: transparent; color: var(--brand); font-size: 11px; cursor: pointer; padding: 0; }
.model-refresh:hover { text-decoration: underline; }
.model-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; border-radius: 10px; background: transparent; padding: 9px 10px;
  color: var(--ink); text-align: left; cursor: pointer; font-size: 12.5px;
}
.model-item:hover, .model-item.is-selected { background: var(--brand-soft); }
.model-item:disabled { opacity: .55; cursor: wait; }
.model-item-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.model-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.model-item-sub { font-size: 10.5px; color: var(--muted-2); }
.model-badge { flex: none; border-radius: 999px; padding: 2px 7px; background: var(--brand-soft); color: var(--brand); font-size: 10px; }
.model-meta { margin-left: auto; flex: none; color: var(--muted-2); font-size: 10.5px; }
.model-check { color: var(--brand); font-weight: 700; }
.model-note { color: var(--muted-2); font-size: 10.5px; white-space: nowrap; }

/* ---------- 回答反馈：点「回答不行」送进后台工单库 ---------- */
.agent-feedback-bar { margin: 10px 0 2px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.agent-feedback-btn { border: 1px solid var(--line-strong); background: var(--surface-solid); color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; transition: border-color .15s, color .15s; }
.agent-feedback-btn:hover { border-color: var(--brand-line); color: var(--brand); }
.agent-feedback-btn.is-open { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }
.agent-feedback-btn:disabled { color: var(--muted); background: var(--bg); cursor: default; }
.agent-feedback-panel { width: 100%; max-width: 460px; border: 1px solid var(--line); background: var(--surface-solid); border-radius: 12px; padding: 12px 14px; box-shadow: 0 6px 18px rgba(15, 27, 45, .06); }
.agent-feedback-tip { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.agent-feedback-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.agent-feedback-chip { border: 1px solid var(--line-strong); background: var(--surface-solid); border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer; color: var(--ink); }
.agent-feedback-chip.is-on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.agent-feedback-note { width: 100%; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 9px; font-size: 12px; margin-bottom: 10px; color: var(--ink); background: var(--bg); }
.agent-feedback-note:focus { outline: none; border-color: var(--brand-line); background: var(--surface-solid); }
.agent-feedback-send { border: 0; background: var(--brand); color: #fff; border-radius: 8px; padding: 6px 14px; font-size: 12px; cursor: pointer; }
.agent-feedback-send:disabled { background: var(--brand-line); cursor: default; }
.agent-feedback-msg { margin: 8px 0 0; font-size: 12px; color: var(--muted); min-height: 14px; }
.admin-feedback-block { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.admin-feedback-block .admin-item { margin-bottom: 10px; }

/* ---------- 规则自修：工单卡里的诊断结果 ---------- */
.repair-box { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e2e4e8; }
/* 修复说明：哪种修、影响哪、要人做什么。三段都短，别做成大块 */
.repair-cause .repair-type { margin-left: 8px; font-weight: 500; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: #f1f2f4; color: #6b7078; }
.repair-cause .repair-type.is-auto { background: #e8f6ee; color: #18794e; }
.repair-fix { margin: 6px 0 8px; padding: 8px 10px; background: #fbfaf7; border: 1px solid #eee7dc; border-radius: 8px; }
.repair-fix .repair-kind { font-weight: 600; color: #8a5a00; margin: 0 0 4px; font-size: 13px; }
.repair-fix .repair-what { margin: 0 0 4px; font-size: 13px; line-height: 1.6; color: #33363b; }
.repair-fix .repair-meta { margin: 0; font-size: 12px; line-height: 1.6; color: #6b7078; }
.repair-need { margin: 2px 0 0 18px; padding: 0; font-size: 12px; line-height: 1.7; color: #6b7078; }
.repair-need li { margin: 0; }
.repair-cause { font-weight: 600; color: #b45309; margin: 0 0 6px; }
.repair-code { background: #f6f7f9; border: 1px solid #ebedf0; border-radius: 8px; padding: 10px; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow: auto; margin: 6px 0; }

/* ---------- 条款页：wiki 形态（条款 + 双链 + 修订历史 + 讨论） ----------
 * 用新设计的变量与细边风格，不做卡片阴影堆叠——这一屏信息密度高，
 * 阴影多了会让人分不清「块」和「条」，反而看不清层级。
 * 唯一的视觉强调留给「改动」：加号绿 / 减号红，其余一律灰阶。
 */
.clause-panel { margin: 14px 0 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-solid); padding: 14px 16px; }
.clause-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.clause-head strong { font-size: 15px; color: var(--ink); }
.clause-head .crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.clause-head button { flex: 0 0 auto; }
.clause-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; max-height: 420px; overflow: auto; }
.clause-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: baseline; text-align: left; background: none; border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; font: inherit; }
.clause-row:hover { background: var(--brand-soft); }
.clause-id { font-size: 12px; color: var(--brand-2); font-variant-numeric: tabular-nums; }
.clause-title { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clause-snip { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clause-body { padding-top: 10px; }
.clause-text { font-size: 14px; line-height: 1.85; color: var(--ink); white-space: pre-wrap; margin: 0 0 10px; }
.clause-block { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.clause-block-title { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.clause-cond { font-size: 12px; color: var(--ink-2); line-height: 1.8; }
.clause-link-label { font-size: 11px; color: var(--muted-2); margin: 6px 0 2px; }
.clause-link { display: block; text-align: left; background: none; border: 0; padding: 3px 0; font: inherit; font-size: 12px; color: var(--brand-2); cursor: pointer; }
.clause-link:hover { text-decoration: underline; }
.clause-ver { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 3px 0; color: var(--ink-2); }
.clause-ver-no { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 48px; }
.clause-ver-tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--bg-2); color: var(--muted); }
.clause-ver-tag.changed { background: var(--gold-soft); color: var(--gold-deep); }
.clause-diff { margin: 4px 0 8px 56px; font-size: 12px; line-height: 1.7; }
.diff-add { color: #15803d; }
.diff-del { color: #b91c1c; }
.clause-talk { padding: 6px 0; border-bottom: 1px solid var(--line); }
.clause-talk-meta { font-size: 11px; color: var(--muted-2); margin-bottom: 2px; }
.clause-talk-reply { margin-top: 4px; font-size: 12px; color: var(--brand-2); background: var(--brand-soft); border-radius: 8px; padding: 6px 8px; }
.clause-talk-input { width: 100%; margin-top: 8px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; resize: vertical; }
.clause-talk-kind { margin-top: 8px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(15,27,45,.92); color: #fff; font-size: 13px; padding: 8px 14px; border-radius: 10px; z-index: 9999; opacity: 1; transition: opacity .5s; }
.toast.out { opacity: 0; }

/* 规则体检 / 后台巡检面板：沿用审核卡片的密度，只区分「可自动修 / 需人工 / 待办紧急」三种状态 */
.admin-repair { display: grid; gap: 10px; margin-top: 12px; }
.repair-card { border: 1px solid var(--line, #e3e6ea); border-radius: 12px; padding: 10px 12px; background: #fff; display: grid; gap: 4px; }
.repair-card.is-manual { background: #fbfbfc; border-style: dashed; }
.repair-card.is-urgent { border-left: 3px solid #d9534f; }
.repair-top { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.repair-clause { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.repair-type, .repair-conf { font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 999px; background: #eef3ff; color: #3457a8; }
.repair-conf { background: #f1f6ee; color: #4b7a3a; }
.repair-why { font-size: 13px; color: #444; line-height: 1.6; }
.repair-diff { font-size: 12.5px; color: #666; background: #f7f8fa; border-radius: 8px; padding: 6px 8px; word-break: break-all; }

/* 模型 API 调度条：后台要一眼看出哪一路被谁占着、有没有在排队 */
.api-pool-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.api-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 999px; border: 1px solid #e2e4e8; background: rgba(255, 255, 255, .7);
  font-size: 12px; color: #4b5563;
}
.api-chip b { font-weight: 600; color: #111827; }
.api-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; }
.api-chip.idle .dot { background: #2f7d5c; }
.api-chip.busy { border-color: rgba(180, 83, 9, .35); background: #fff7ed; color: #b45309; }
.api-chip.busy .dot { background: #d97706; }
.api-chip.cool { border-color: rgba(156, 163, 175, .5); background: #f3f4f6; color: #6b7280; }
.api-chip.cool .dot { background: #9ca3af; }
.api-pool-note { font-size: 12px; color: #6b7280; }

/* 深度搜索开关：发送键左边的常驻小按钮，打开后底色变深，一眼能看出这条会慢 */
.chat-deep-btn {
  display: inline-flex; align-items: center; gap: 5px;
  align-self: flex-end; flex: none;
  height: 38px; padding: 0 11px; border-radius: 11px;
  border: 1px solid var(--brand-line); background: rgba(255, 255, 255, .72);
  color: var(--muted); font-size: 12.5px; font-weight: 650; white-space: nowrap; cursor: pointer;
  transition: background .16s, border-color .16s, color .16s;
}
.chat-deep-btn .deep-dot { width: 6px; height: 6px; border-radius: 50%; background: #c9ced8; transition: background .16s; }
.chat-deep-btn:hover { border-color: var(--brand); color: var(--brand); }
.chat-deep-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chat-deep-btn.on .deep-dot { background: #fff; }
.chat-deep-btn:disabled { opacity: .55; cursor: wait; }
/* 答复底部那行深度搜索痕迹：比正文小两号，不当正文读 */
.deep-note { margin-top: 8px; font-size: 12px; color: var(--muted); border-left: 2px solid var(--brand-line); padding-left: 8px; }
