/* =========================================================
   业务口径台 · 视觉系统
   基调：公文级克制 —— 墨蓝主色、黄铜点缀、低饱和语义色、留白优先
   ========================================================= */

:root {
  /* 品牌与中性色 */
  --ink-900: #0f1b2d;
  --ink-800: #17263d;
  --ink-700: #22365a;
  --primary: #1d3a6b;
  --primary-hover: #162f58;
  --brass: #a8844e;
  --brass-soft: #faf6ee;
  --brass-line: #ece2cf;

  --canvas: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --sidebar: #fafafb;
  --line: #e5e7eb;
  --line-soft: #eef0f3;
  --line-strong: #d3d8e0;

  --text-1: #111827;
  --text-2: #4b5563;
  --text-3: #8a919c;

  /* 语义色（低饱和） */
  --path: #2f5fa7;
  --path-bg: #eef3fb;
  --caliber: #2b7a66;
  --caliber-bg: #eaf5f1;
  --judge: #b23b36;
  --judge-bg: #fbefee;
  --judge-line: #f1d5d3;
  --rag: #6a57a8;
  --rag-bg: #f2effa;
  --gap: #9a5b0c;
  --gap-bg: #fbf3e6;
  --iso: #3d6b5c;
  --iso-bg: #edf4f1;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-2: 0 1px 3px rgba(16, 24, 40, 0.05), 0 10px 28px rgba(16, 24, 40, 0.06);

  --font: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", monospace;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A919C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-1);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

.ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico-lg {
  width: 22px;
  height: 22px;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0;
}

/* =========================================================
   登录界面（公文级双栏对称设计）
   ========================================================= */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background:
    radial-gradient(circle at 16% 18%, rgba(29, 58, 107, 0.06) 0%, transparent 46%),
    radial-gradient(circle at 86% 82%, rgba(168, 132, 78, 0.08) 0%, transparent 44%),
    var(--canvas);
}

.auth-card {
  width: 100%;
  max-width: 820px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 52px rgba(15, 27, 45, 0.11);
  animation: fadeIn 0.22s ease;
}

.auth-aside {
  background: linear-gradient(160deg, #132238 0%, #1c355b 100%);
  color: #f3f5f8;
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-logo {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8d5af;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(232, 213, 175, 0.24);
}

.auth-eyebrow {
  font-size: 11.5px;
  color: #d8bf91;
  letter-spacing: 0.06em;
}

.auth-title {
  margin: 10px 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.auth-subtitle {
  margin: 0 0 28px;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(226, 232, 240, 0.8);
}

.auth-pillars {
  list-style: none;
  margin: auto 0 0;
  padding: 20px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-pillars li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.auth-pillar-ico {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8d5af;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-pillar-ico .ico {
  width: 14px;
  height: 14px;
}

.auth-pillars strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.auth-pillars span {
  display: block;
  font-size: 11.5px;
  line-height: 1.55;
  color: rgba(203, 213, 225, 0.78);
}

.auth-main {
  padding: 40px 42px 32px;
  display: flex;
  flex-direction: column;
}

.auth-form-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-900);
}

.auth-form-head p {
  margin: 6px 0 26px;
  font-size: 13px;
  color: var(--text-3);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap > .ico {
  position: absolute;
  left: 12px;
  color: var(--text-3);
  pointer-events: none;
}

.auth-input-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 14px;
  color: var(--text-1);
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 58, 107, 0.1);
}

.pwd-toggle {
  position: absolute;
  right: 6px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.pwd-toggle:hover {
  background: #f1f3f6;
  color: var(--text-1);
}

.auth-error {
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--judge-bg);
  border: 1px solid var(--judge-line);
  color: var(--judge);
  font-size: 12.5px;
  line-height: 1.5;
}

.btn-login {
  height: 42px;
  margin-top: 6px;
  border: 0;
  border-radius: 9px;
  background: var(--primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}

.btn-login:hover {
  background: var(--primary-hover);
}

.btn-login:active {
  transform: scale(0.99);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-foot {
  margin-top: auto;
  padding-top: 26px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.03em;
}

/* 左侧边栏底部当前账号条 */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 6px 0 4px;
  border-top: 1px solid var(--line-soft);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink-800);
  color: #e8d5af;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
}

.user-role {
  font-size: 11px;
  color: var(--text-3);
}

/* =========================================================
   应用骨架
   ========================================================= */
.app {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 18px 14px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 20px;
  cursor: pointer;
  user-select: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink-800);
  color: #e6d3ad;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(230, 211, 173, 0.18);
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-900);
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: #f0f1f4;
  color: var(--text-1);
}

.nav-item.active {
  background: var(--surface);
  color: var(--ink-800);
  font-weight: 600;
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}

.nav-item.active .ico {
  color: var(--primary);
}

.nav-count {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--judge-bg);
  color: var(--judge);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.side-section {
  margin-top: 24px;
  padding: 0 4px;
}

.side-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  padding: 0 4px;
}

.side-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: 0;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 5px;
}

.side-link .ico {
  width: 13px;
  height: 13px;
}

.side-link:hover {
  background: #eef0f3;
  color: var(--text-1);
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #eceef2;
  border-radius: 8px;
  padding: 3px;
}

.seg button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.seg button .ico {
  width: 14px;
  height: 14px;
}

.seg button.active {
  background: var(--surface);
  color: var(--text-1);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

body.mode-external #roleSeg button.active {
  color: var(--iso);
}

.side-hint {
  margin: 9px 4px 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
}

.side-history {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
}

.history-item:hover {
  background: #f0f1f4;
  color: var(--text-1);
}

.history-item.active {
  background: #eceef2;
  color: var(--text-1);
  font-weight: 500;
}

.history-item .t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-empty {
  font-size: 12px;
  color: var(--text-3);
  padding: 6px 8px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-3);
}

.dot-path { background: var(--path); }
.dot-caliber { background: var(--caliber); }
.dot-judge { background: var(--judge); }
.dot-rag { background: var(--rag); }
.dot-gap { background: var(--gap); }
.dot-iso { background: var(--iso); }

.side-footer {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.engine-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  color: var(--text-3);
  transition: border-color 0.15s;
}

.engine-btn:hover {
  border-color: var(--line-strong);
  color: var(--text-1);
}

.engine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa3af;
  box-shadow: 0 0 0 3px rgba(154, 163, 175, 0.18);
  flex-shrink: 0;
}

.engine-dot.on {
  background: #2b9a6e;
  box-shadow: 0 0 0 3px rgba(43, 154, 110, 0.18);
}

.engine-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.engine-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
}

.engine-sub {
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory {
  margin-top: 9px;
  padding: 0 4px;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   内容区
   ========================================================= */
.content {
  min-width: 0;
}

.mode-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--iso-bg);
  border-bottom: 1px solid #d7e7e0;
  color: var(--iso);
  font-size: 12.5px;
}

body.mode-internal .mode-strip {
  display: none;
}

.view {
  display: none;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 40px 64px;
}

.view.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* =========================================================
   智能口径台
   ========================================================= */
.qa-top {
  transition: padding 0.2s;
}

.qa.is-empty .qa-top {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 2.5vh;
  text-align: center;
}

.qa:not(.is-empty) .hero-text {
  display: none;
}

.qa:not(.is-empty) .qa-top {
  margin-bottom: 20px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--brass);
  letter-spacing: 0.12em;
}

.hero-eyebrow span {
  width: 22px;
  height: 1px;
  background: var(--brass-line);
}

.hero-title {
  margin: 14px 0 10px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--ink-900);
}

.hero-desc {
  max-width: 600px;
  margin: 0 auto 20px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.75;
  text-wrap: balance;
}

.searchbar {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 14px 12px 10px 18px;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.searchbar:focus-within {
  border-color: #b9c3d3;
  box-shadow: 0 0 0 4px rgba(29, 58, 107, 0.07), var(--shadow-2);
}

.searchbar textarea {
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-1);
  min-height: 26px;
  max-height: 160px;
  padding: 0 6px 0 0;
}

.searchbar textarea::placeholder {
  color: #a3a9b3;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.search-select,
.select {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px 0 10px;
  height: 30px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
}

.search-select {
  background-color: var(--surface-2);
}

.search-select:hover,
.select:hover {
  border-color: var(--line-strong);
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--text-2);
}

.mode-pill .ico {
  width: 14px;
  height: 14px;
}

body.mode-external .mode-pill {
  background: var(--iso-bg);
  border-color: #d7e7e0;
  color: var(--iso);
}

.kbd-hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}

.btn-ask {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.btn-ask:hover {
  background: var(--primary-hover);
}

.btn-ask:active {
  transform: scale(0.96);
}

.btn-ask:disabled {
  opacity: 0.45;
  cursor: default;
}

/* 空状态：示例与分级说明 */
.qa-empty {
  max-width: 880px;
  margin: 24px auto 0;
}

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.06em;
}

.section-note {
  letter-spacing: 0;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.example {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.example:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.example-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.example-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-3);
}

.example-role .ico {
  width: 13px;
  height: 13px;
}

.example-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
}

.example-q {
  font-size: 12.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.legend-item {
  padding: 0 22px;
  border-left: 1px solid var(--line);
}

.legend-item:first-child {
  padding-left: 0;
  border-left: 0;
}

.legend-item h4 {
  margin: 10px 0 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
}

.legend-item p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}

/* 语义标签 */
.tag {
  --t-bg: #f1f3f6;
  --t-fg: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 9px;
  border-radius: 999px;
  background: var(--t-bg);
  color: var(--t-fg);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tag em {
  font-style: normal;
  font-weight: 500;
  opacity: 0.8;
  padding-left: 7px;
  margin-left: 1px;
  border-left: 1px solid currentColor;
  border-left-color: color-mix(in srgb, currentColor 30%, transparent);
}

.tag-sm {
  height: 21px;
  padding: 0 8px 0 7px;
  font-size: 11.5px;
}

.tag-path { --t-bg: var(--path-bg); --t-fg: var(--path); }
.tag-caliber { --t-bg: var(--caliber-bg); --t-fg: var(--caliber); }
.tag-judge { --t-bg: var(--judge-bg); --t-fg: var(--judge); }
.tag-rag { --t-bg: var(--rag-bg); --t-fg: var(--rag); }
.tag-gap { --t-bg: var(--gap-bg); --t-fg: var(--gap); }
.tag-iso { --t-bg: var(--iso-bg); --t-fg: var(--iso); }
.tag-plain { --t-bg: #f1f3f6; --t-fg: var(--text-2); font-weight: 500; }
.tag-done { --t-bg: var(--caliber-bg); --t-fg: var(--caliber); font-weight: 500; }

.tag-sample {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  background: var(--brass-soft);
  border: 1px solid var(--brass-line);
  color: #8a6a35;
  font-size: 11.5px;
}

.vis {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

.vis .ico {
  width: 13px;
  height: 13px;
}

.vis-public {
  color: var(--caliber);
}

/* 结果区：左结论 / 右依据 */
.qa-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.answer {
  --k: var(--line);
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 32px 22px;
  box-shadow: inset 0 3px 0 var(--k), var(--shadow-1);
  animation: fadeIn 0.22s ease;
}

.answer.k-path { --k: var(--path); }
.answer.k-caliber { --k: var(--caliber); }
.answer.k-judge { --k: var(--judge); }
.answer.k-rag { --k: var(--rag); }
.answer.k-gap { --k: var(--gap); }
.answer.k-iso { --k: var(--iso); }

.ans-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ans-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.ans-meta .sep {
  color: #c9ced6;
}

.ans-q {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
}

.q-label {
  display: inline-block;
  margin-right: 8px;
  padding: 0 6px;
  border-radius: 4px;
  background: #f1f3f6;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 20px;
}

.ans-title {
  margin: 8px 0 0;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--ink-900);
}

.ans-lead {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--brass-soft);
  border: 1px solid var(--brass-line);
  font-size: 13px;
  line-height: 1.7;
  color: #5b4a2e;
}

.lead-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-weight: 600;
  color: #8a6a35;
}

.lead-label .ico {
  width: 14px;
  height: 14px;
}

.ans-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--rag-bg);
  color: #4e3f86;
  font-size: 12.5px;
  line-height: 1.7;
}

.ans-notice .ico {
  margin-top: 2px;
}

.ans-body {
  margin-top: 18px;
  max-width: 74ch;
  font-size: 15px;
  line-height: 1.9;
  color: #1f2937;
  white-space: pre-wrap;
  word-break: break-word;
}

.ans-body strong {
  font-weight: 600;
  color: var(--ink-900);
}

.ans-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 14px;
  font-size: 12.5px;
  color: #8a6a35;
}

.ans-note .ico {
  width: 14px;
  height: 14px;
  margin-top: 3px;
}

/* 路径型：步骤 + 材料 */
.path-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

.sub-title {
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.08em;
}

.stepper {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stepper li {
  position: relative;
  padding: 0 0 18px 36px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
}

.stepper li::before {
  content: "";
  position: absolute;
  left: 11.5px;
  top: 26px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}

.stepper li:last-child {
  padding-bottom: 0;
}

.stepper li:last-child::before {
  display: none;
}

.step-no {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid #cfdcf1;
  color: var(--path);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.step-label {
  display: block;
  font-weight: 600;
  color: var(--text-1);
}

.panel-soft {
  align-self: start;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.checklist li {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
}

.checklist .ico {
  width: 15px;
  height: 15px;
  margin-top: 3px;
  color: var(--caliber);
  stroke-width: 2.2;
}

.contact {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.contact .ico {
  margin-top: 3px;
  color: var(--text-3);
}

.contact-k {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
}

.contact-v {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

/* 判断型拦截 / 未收录 */
.block-panel,
.empty-panel {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
  margin-top: 20px;
  padding: 20px;
  border-radius: 12px;
}

.block-panel {
  background: var(--judge-bg);
  border: 1px solid var(--judge-line);
}

.block-icon,
.empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--surface);
  display: grid;
  place-items: center;
}

.block-icon {
  color: var(--judge);
  border: 1px solid var(--judge-line);
}

.block-panel h3 {
  margin: 2px 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #7f1d1d;
}

.block-panel p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.85;
  color: #5f2a27;
}

.kv {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 16px 0 18px;
  padding-top: 14px;
  border-top: 1px solid var(--judge-line);
  font-size: 13px;
  line-height: 1.7;
}

.kv dt {
  color: #a0605b;
}

.kv dd {
  margin: 0;
  color: #3f1a18;
}

.empty-panel {
  background: var(--gap-bg);
  border: 1px solid #f0e0c4;
}

.empty-panel .empty-icon {
  color: var(--gap);
  border: 1px solid #f0e0c4;
}

.empty-panel.is-iso {
  background: var(--iso-bg);
  border-color: #d7e7e0;
}

.empty-panel.is-iso .empty-icon {
  color: var(--iso);
  border-color: #d7e7e0;
}

.empty-panel p {
  margin: 2px 0 16px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-1);
}

/* 反馈与相关口径 */
.ans-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.foot-q {
  margin-right: 4px;
  font-size: 12.5px;
  color: var(--text-3);
}

.btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-chip .ico {
  width: 14px;
  height: 14px;
}

.btn-chip:hover {
  border-color: var(--line-strong);
  color: var(--text-1);
}

.btn-chip.done {
  background: var(--caliber-bg);
  border-color: #cbe6dc;
  color: var(--caliber);
}

.btn-chip:disabled {
  cursor: default;
}

.fb-status {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}

.related {
  margin-top: 20px;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 2px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: none;
  font-size: 13.5px;
  color: var(--text-1);
  text-align: left;
  cursor: pointer;
}

.related-item .ico {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  transition: transform 0.15s, color 0.15s;
}

.related-item:hover .r-q {
  color: var(--primary);
}

.related-item:hover .ico {
  color: var(--primary);
  transform: translateX(2px);
}

.r-q {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.r-mod {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

/* 右侧依据栏 */
.rail {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  animation: fadeIn 0.24s ease;
}

.rail-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

.rail-title .ico {
  width: 15px;
  height: 15px;
  color: var(--text-3);
}

.rail-title .count {
  margin-left: auto;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
}

.src-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.src-list dt {
  font-size: 11.5px;
  color: var(--text-3);
}

.src-list dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-1);
}

.btn-pano-jump {
  width: 100%;
  margin-top: 16px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--brass-line);
  border-radius: 9px;
  background: var(--brass-soft);
  color: #6b5023;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.btn-pano-jump:hover {
  background: #f5ecdc;
  border-color: #d6be92;
  color: var(--ink-900);
}

.btn-pano-jump .left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.btn-pano-jump .left span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-pano-jump .ico {
  width: 15px;
  height: 15px;
  color: var(--brass);
}

/* =========================================================
   知识全景（文档站级双栏百科）
   ========================================================= */
.pano-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.pano-tree {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 12px;
  box-shadow: var(--shadow-1);
}

.pano-sec + .pano-sec {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.pano-sec-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.pano-sec-num {
  color: var(--brass);
  font-family: var(--mono);
  font-size: 11px;
}

.pano-topic-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.pano-topic-btn:hover {
  background: #f3f5f8;
  color: var(--text-1);
}

.pano-topic-btn.active {
  background: #eef3fb;
  color: var(--primary);
  font-weight: 600;
}

.pano-topic-btn.is-empty {
  color: var(--text-3);
}

.pano-topic-cnt {
  flex-shrink: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f3f6;
}

.pano-topic-btn.active .pano-topic-cnt {
  background: rgba(29, 58, 107, 0.12);
  color: var(--primary);
}

.pano-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pano-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 26px 20px;
  box-shadow: inset 0 3px 0 var(--primary), var(--shadow-1);
}

.pano-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pano-crumb {
  font-size: 12px;
  color: var(--brass);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pano-hero h3 {
  margin: 6px 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-900);
}

.pano-summary {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
  max-width: 72ch;
}

.pano-docs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--text-3);
}

.doc-pill {
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 9px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  color: var(--text-2);
  font-size: 11.5px;
}

.pano-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.pano-hl {
  padding: 11px 14px;
  border-radius: 9px;
  background: #f8f9fb;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--brass);
}

.pano-hl-k {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
}

.pano-hl-v {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
}

.pano-anchors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pano-anchor-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.14s, color 0.14s;
}

.pano-anchor-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pano-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pano-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-800);
  border-bottom: 1px solid var(--line);
}

.pano-group-title span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}

.pano-entry {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 18px 20px 15px;
  box-shadow: var(--shadow-1);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.pano-entry.is-focused {
  border-color: var(--brass);
  background: #fffdf8;
  box-shadow: 0 0 0 3px rgba(168, 132, 78, 0.22), var(--shadow-2);
  animation: panoPulse 1.6s ease;
}

@keyframes panoPulse {
  0% { box-shadow: 0 0 0 0 rgba(168, 132, 78, 0.45); }
  50% { box-shadow: 0 0 0 7px rgba(168, 132, 78, 0.14); }
  100% { box-shadow: 0 0 0 3px rgba(168, 132, 78, 0.22); }
}

.pano-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.pano-entry-tags {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brass);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
}

.pin-badge .ico {
  width: 12px;
  height: 12px;
}

.pano-entry-title {
  margin: 10px 0 8px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.5;
}

.pano-entry-body {
  font-size: 13.8px;
  line-height: 1.82;
  color: #1f2937;
  white-space: pre-wrap;
  word-break: break-word;
}

.pano-entry-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--text-3);
}

.pano-pending-card {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  color: var(--text-2);
}

.pano-pending-card p {
  margin: 0 0 14px;
  font-size: 13.5px;
}

.pano-chunks-details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.pano-chunks-details summary {
  cursor: pointer;
  padding: 13px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-800);
  background: #fafbfc;
}

.pano-chunks-list {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pano-search-results {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}

.pano-sr-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-2);
}

.pano-sr-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.pano-sr-item:hover {
  background: #f8fafc;
}

.pano-sr-q {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-900);
}

.pano-sr-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.quote {
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--brass-line);
}

.quote + .quote {
  margin-top: 16px;
}

.quote-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
}

.quote-head span:last-child {
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.quote-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 1px;
}

.quote-body {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-2);
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quote.open .quote-body {
  display: block;
}

.quote-toggle {
  border: 0;
  background: none;
  padding: 4px 0 0;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
}

.trace {
  list-style: none;
  margin: 0;
  padding: 0;
}

.trace li {
  position: relative;
  padding: 0 0 14px 20px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-2);
}

.trace li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid #10b981;
}

.trace li::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 18px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.trace li:last-child {
  padding-bottom: 0;
}

.trace li:last-child::after {
  display: none;
}

.trace li.t-warn::before { border-color: #d99a2b; }
.trace li.t-blocked::before { border-color: var(--judge); }

.trace-step {
  display: block;
  font-weight: 600;
  color: var(--text-1);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.stat {
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
}

.stat:first-child {
  padding-left: 0;
  border-left: 0;
}

.stat b {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

.stat b small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 1px;
}

.stat span {
  font-size: 11.5px;
  color: var(--text-3);
}

/* 加载骨架 */
.loading-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 18px 0 24px;
}

.ls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-3);
  transition: color 0.2s;
}

.ls-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d6dae1;
  transition: background 0.2s;
}

.ls.active {
  color: var(--text-1);
}

.ls.active .ls-dot {
  background: var(--primary);
  animation: pulse 1s ease-in-out infinite;
}

.ls.done {
  color: var(--text-2);
}

.ls.done .ls-dot {
  background: var(--caliber);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29, 58, 107, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(29, 58, 107, 0); }
}

.sk {
  height: 12px;
  margin-top: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef0f3 0%, #f6f7f9 50%, #eef0f3 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.sk-title {
  height: 20px;
  width: 62%;
  margin-bottom: 20px;
}

.sk-short {
  width: 45%;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* =========================================================
   通用：按钮 / 表单 / 卡片 / 表格
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn .ico {
  width: 15px;
  height: 15px;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-danger {
  background: var(--judge);
  border-color: var(--judge);
  color: #fff;
}

.btn-danger:hover {
  background: #9b302c;
  border-color: #9b302c;
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: #f1f3f6;
  color: var(--text-1);
}

.icon-btn.danger:hover {
  background: var(--judge-bg);
  color: var(--judge);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-900);
}

.page-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.seg-inline {
  display: inline-grid;
  grid-auto-flow: column;
  grid-template-columns: none;
}

.seg-inline button {
  padding: 5px 14px;
}

.input-search {
  position: relative;
}

.input-search .ico {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--text-3);
}

.input {
  height: 34px;
  width: 260px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  border-color: #b9c3d3;
  box-shadow: 0 0 0 3px rgba(29, 58, 107, 0.07);
}

.filterbar .select {
  height: 34px;
  font-size: 13px;
  color: var(--text-1);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.card + .card,
.stack-gap {
  margin-top: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.card-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-1);
}

.card-head p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-3);
}

.card-body {
  padding: 16px 20px;
}

.table-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--text-3);
}

.table-meta span:first-child {
  color: var(--text-2);
  font-weight: 500;
}

.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 13px;
}

.td-nowrap {
  white-space: nowrap;
}

.table th {
  padding: 10px 16px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--text-1);
  line-height: 1.6;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: #fbfcfd;
}

.td-strong {
  font-weight: 600;
  color: var(--text-1);
}

.cell-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-3);
}

.td-empty {
  padding: 40px 16px !important;
  text-align: center;
  color: var(--text-3) !important;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  opacity: 0.55;
  transition: opacity 0.15s;
}

.table tbody tr:hover .row-actions {
  opacity: 1;
}

.chunk-cell {
  max-height: 96px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* =========================================================
   看板
   ========================================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-1);
}

.kpi-label {
  font-size: 12.5px;
  color: var(--text-2);
}

.kpi-value {
  margin: 10px 0 2px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

.kpi-value small {
  margin-left: 2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
}

.kpi-value.is-pending {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-3);
  padding: 7px 0 2px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-3);
}

.kpi-bar {
  height: 4px;
  margin-top: 14px;
  border-radius: 2px;
  background: #eef0f3;
  overflow: hidden;
}

.kpi-bar span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--ink-700);
  transition: width 0.5s ease;
}

.kpi-bar.k-path span { background: var(--path); }
.kpi-bar.k-caliber span { background: var(--caliber); }
.kpi-bar.k-gap span { background: #c58a2c; }

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
}

.dash-grid .card + .card {
  margin-top: 0;
}

.legend-inline {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-3);
}

.legend-inline span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sw {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.sw-pub { background: var(--path); }
.sw-int { background: #b9c4d6; }

.cov-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 12.5px;
  color: var(--text-2);
}

.cov-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cov-track {
  display: flex;
  height: 8px;
  border-radius: 4px;
  background: #f1f3f6;
  overflow: hidden;
}

.cov-pub { background: var(--path); }
.cov-int { background: #b9c4d6; }

.cov-num {
  text-align: right;
  font-weight: 600;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

.log-list {
  max-height: 318px;
  overflow-y: auto;
  padding-top: 4px;
  padding-bottom: 14px;
  mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
}

.log-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.log-row:last-child {
  border-bottom: 0;
}

.log-row .dot {
  margin-top: 8px;
}

.log-main {
  min-width: 0;
  flex: 1;
}

.log-q {
  font-size: 13px;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-meta {
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.empty-note {
  padding: 24px 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
}

/* =========================================================
   弹窗
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 27, 45, 0.42);
  backdrop-filter: blur(3px);
  animation: fadeBg 0.15s ease;
}

@keyframes fadeBg {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 27, 45, 0.24);
  animation: pop 0.18s ease;
}

.modal-lg {
  max-width: 820px;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 4px;
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900);
}

.modal-head p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 22px 20px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft);
  background: #fafbfc;
  border-radius: 0 0 14px 14px;
}

.spacer {
  flex: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 11px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-1);
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field select {
  height: 37px;
  padding-right: 10px;
  background-color: var(--surface);
  cursor: pointer;
}

.field textarea {
  resize: vertical;
  line-height: 1.65;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #b9c3d3;
  box-shadow: 0 0 0 3px rgba(29, 58, 107, 0.07);
}

.field input[readonly] {
  background: var(--surface-2);
  color: var(--text-2);
}

.field-hint {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-3);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d5dae1;
  transition: background 0.18s;
}

.track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s;
}

.switch input:checked + .track {
  background: var(--caliber);
}

.switch input:checked + .track::after {
  transform: translateX(16px);
}

.switch-text b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
}

.switch-text small {
  font-size: 12px;
  color: var(--text-3);
}

.callout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--brass-soft);
  border: 1px solid var(--brass-line);
  font-size: 12.5px;
  line-height: 1.65;
  color: #6b5532;
}

.callout .ico {
  margin-top: 2px;
  width: 14px;
  height: 14px;
}

.test-result {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--surface-2);
  color: var(--text-2);
}

.test-result.ok {
  background: var(--caliber-bg);
  color: #1f5d4d;
}

.test-result.err {
  background: var(--judge-bg);
  color: #7f1d1d;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  max-width: min(560px, calc(100vw - 40px));
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--ink-900);
  color: #f3f4f6;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(15, 27, 45, 0.28);
  transform: translateX(-50%);
  animation: toastIn 0.2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #d5dae1;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #b9c0cb;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1200px) {
  .qa-result {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .auth-card {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .auth-aside {
    padding: 26px 24px;
  }

  .auth-pillars {
    display: none;
  }

  .auth-main {
    padding: 28px 24px 24px;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-history {
    display: none;
  }

  .view {
    padding: 24px 20px 48px;
  }

  .dash-grid,
  .path-wrap,
  .example-grid,
  .legend,
  .pano-layout,
  .pano-highlights {
    grid-template-columns: 1fr;
  }

  .pano-tree {
    position: static;
    max-height: none;
  }

  .legend-item {
    padding: 12px 0;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }

  .kbd-hint {
    display: none;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
