/* ============================================================
   建筑报价 Agent · 商业化设计系统
   深蓝 / 青色科技风（企业级 SaaS 视觉规范）
   注意：--muted / --accent / --panel-2 等变量名被 JS 内联样式引用，
   以及 tag/alert/flow/price/cap/audit 等类由 JS 动态生成，均不可更名。
   ============================================================ */

:root {
  /* 基础色板 */
  --bg: #081120;
  --bg-soft: #0b1a30;
  --panel: #10233f;
  --panel-2: #15304f;
  --panel-3: #1b3b5e;
  --line: rgba(110, 170, 230, 0.14);
  --line-strong: rgba(110, 170, 230, 0.30);
  --accent: #2dd4f0;
  --accent-2: #2f8fe0;
  --accent-soft: rgba(45, 212, 240, 0.12);
  --ok: #2ecc8f;
  --warn: #f5a623;
  --danger: #f2545b;
  --text: #e8f1fb;
  --muted: #8fa9c4;

  /* 形状与层次 */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 10px 30px rgba(2, 12, 28, 0.35);
  --shadow-sm: 0 4px 14px rgba(2, 12, 28, 0.25);
  --glow: 0 0 0 3px rgba(45, 212, 240, 0.18);

  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(47, 143, 224, 0.14), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(45, 212, 240, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(110, 170, 230, 0.22); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(45, 212, 240, 0.4); }

::selection { background: rgba(45, 212, 240, 0.28); }

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

/* ============ 整体骨架 ============ */
.layout { display: flex; min-height: 100vh; }

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

/* ============ 侧边栏 ============ */
.sidebar {
  width: 232px;
  background: linear-gradient(185deg, #0c1e36 0%, #091729 100%);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #05263c;
  font-size: 15px;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 16px rgba(45, 212, 240, 0.35);
  flex-shrink: 0;
}

.brand-text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.brand-sub {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.4px;
}

.nav { flex: 1; }

.nav-group-title {
  font-size: 10.5px;
  letter-spacing: 1.5px;
  color: rgba(143, 169, 196, 0.65);
  padding: 12px 10px 6px;
  user-select: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  margin-bottom: 3px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item:hover { background: rgba(45, 212, 240, 0.08); color: var(--text); }

.nav-item.active {
  background: linear-gradient(90deg, rgba(45, 212, 240, 0.16), rgba(45, 212, 240, 0.06));
  color: var(--accent);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.nav-label { flex: 1; }

.nav-badge {
  background: var(--danger);
  color: #fff;
  border-radius: 9px;
  padding: 1px 7px;
  font-size: 11px;
  line-height: 1.5;
}

.sidebar-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.foot-chip {
  display: inline-block;
  font-size: 10.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(45, 212, 240, 0.28);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 8px;
}

.foot-ver { font-size: 10.5px; color: rgba(143, 169, 196, 0.6); }

/* ============ 顶栏 ============ */
.topbar {
  height: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  background: rgba(9, 22, 40, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.top-crumb {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.top-org {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.top-sep { color: rgba(143, 169, 196, 0.45); font-size: 12px; }

.top-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.top-chip {
  font-size: 11px;
  border-radius: 20px;
  padding: 3px 11px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}

.top-chip.chip-ok {
  color: var(--ok);
  background: rgba(46, 204, 143, 0.12);
  border-color: rgba(46, 204, 143, 0.35);
}

.top-chip.chip-warn {
  color: var(--warn);
  background: rgba(245, 166, 35, 0.12);
  border-color: rgba(245, 166, 35, 0.35);
}

.top-user {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: default;
}

.top-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #05263c;
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.top-who { display: flex; flex-direction: column; line-height: 1.3; }
.top-who b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.top-who i { font-style: normal; font-size: 10.5px; color: var(--muted); }

/* ============ 主区 ============ */
.main {
  flex: 1;
  padding: 24px 28px 40px;
  overflow-x: hidden;
  max-width: 1440px;
  width: 100%;
}

.page-head { margin-bottom: 22px; }
.page-title { font-size: 21px; font-weight: 600; margin: 0 0 6px; letter-spacing: 0.2px; }
.page-desc { font-size: 12.5px; color: var(--muted); margin: 0; max-width: 860px; line-height: 1.75; }

/* ============ 卡片 ============ */
.card {
  background: linear-gradient(180deg, rgba(21, 48, 79, 0.55), rgba(16, 35, 63, 0.55));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}

.card-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1180px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ============ 统计卡 ============ */
.stat {
  background: linear-gradient(160deg, rgba(27, 59, 94, 0.6), rgba(16, 35, 63, 0.6));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 240, 0.14), transparent 70%);
}

.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.3px; }
.stat-value { font-size: 25px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat-value.warn { color: var(--warn); }
.stat-value.ok { color: var(--ok); }

/* ============ 表单 ============ */
label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }

input[type="text"], input[type="number"], input[type="password"], textarea, select {
  width: 100%;
  background: rgba(8, 20, 37, 0.65);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder, textarea::placeholder { color: rgba(143, 169, 196, 0.55); }

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: var(--glow);
}

input[type="file"] {
  width: 100%;
  color: var(--muted);
  font-size: 12.5px;
  padding: 7px 0;
}

input[type="file"]::file-selector-button {
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 13px;
  margin-right: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}

input[type="file"]::file-selector-button:hover { border-color: var(--accent); }

textarea { resize: vertical; min-height: 80px; }

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% + 1px), calc(100% - 11px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

select option { background: var(--panel); color: var(--text); }

/* ============ 按钮 ============ */
.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04263c;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(45, 212, 240, 0.22);
  white-space: nowrap;
}

.btn:hover { opacity: 0.92; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  box-shadow: none;
}
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger {
  background: linear-gradient(135deg, #f2545b, #d63c48);
  color: #fff;
  box-shadow: 0 4px 12px rgba(242, 84, 91, 0.25);
}
.btn-ok {
  background: linear-gradient(135deg, #2ecc8f, #1fae76);
  color: #04231a;
  box-shadow: 0 4px 12px rgba(46, 204, 143, 0.25);
}

.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 160px; }

/* 列宽工具类（替代旧内联 flex 写法） */
.col-auto { flex: 0 0 auto !important; min-width: 0 !important; }
.col-3 { flex: 3 !important; }
.col-2 { flex: 2 !important; }
.col-180 { flex: 0 0 180px !important; min-width: 0 !important; }
.col-190 { flex: 0 0 190px !important; min-width: 0 !important; }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }

/* ============ 表格 ============ */
table { width: 100%; border-collapse: collapse; font-size: 13px; }

th {
  text-align: left;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(110, 170, 230, 0.08);
  vertical-align: middle;
}

tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: rgba(45, 212, 240, 0.05); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============ 交付物导出 ============ */
.export-row { display: flex; flex-wrap: wrap; gap: 10px; }
.export-row .btn { min-width: 138px; text-align: center; }

/* ============ 标签 ============ */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  line-height: 1.7;
  white-space: nowrap;
}

.tag-ok {
  background: rgba(46, 204, 143, 0.13);
  color: var(--ok);
  border-color: rgba(46, 204, 143, 0.35);
}

.tag-warn {
  background: rgba(245, 166, 35, 0.13);
  color: var(--warn);
  border-color: rgba(245, 166, 35, 0.35);
}

.tag-danger {
  background: rgba(242, 84, 91, 0.13);
  color: var(--danger);
  border-color: rgba(242, 84, 91, 0.35);
}

.tag-info {
  background: rgba(45, 212, 240, 0.13);
  color: var(--accent);
  border-color: rgba(45, 212, 240, 0.35);
}

/* ============ 工作流轨迹 ============ */
.flow { display: flex; flex-direction: column; gap: 0; }

.flow-step {
  display: flex;
  gap: 13px;
  padding: 11px 0;
  position: relative;
}

.flow-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 34px;
  bottom: -11px;
  width: 1px;
  background: var(--line-strong);
}

.flow-dot {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 11px;
  flex-shrink: 0;
  z-index: 1;
}

.flow-step.done .flow-dot { background: var(--ok); border-color: var(--ok); color: #052; }
.flow-step.blocked .flow-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.flow-step.paused .flow-dot { background: var(--warn); border-color: var(--warn); color: #421; }

.flow-body { flex: 1; padding-top: 2px; }
.flow-name { font-size: 13px; font-weight: 600; }
.flow-msg { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; line-height: 1.7; }

/* 轮次分隔：自治引擎是多轮回环的，平铺 26 条读不出因果 */
.flow-round {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--accent);
  margin: 14px 0 4px;
  padding-left: 8px;
  border-left: 2px solid rgba(45, 212, 240, 0.45);
}

/* ============ 推理过程（逐轮 CoT）============ */
.cot-round {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(11, 26, 48, 0.55);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.cot-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cot-head .hint { margin: 0; }
.cot-no { font-size: 13px; font-weight: 700; color: var(--text); }
.cot-why {
  font-size: 13px;
  line-height: 1.75;
  margin-top: 9px;
  color: var(--text);
}
.cot-k { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.cot-critique, .cot-issues, .cot-acts, .cot-revisions {
  font-size: 12px;
  line-height: 1.7;
  margin-top: 9px;
  color: var(--muted);
}
.cot-critique ul { margin: 4px 0 0 18px; padding: 0; }
.cot-issues { color: var(--warn); }
.cot-revisions { border-top: 1px dashed var(--line-strong); padding-top: 10px; }
.cot-steps { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.cot-step-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cot-step {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(45, 212, 240, 0.3);
  border-radius: 6px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.cot-step-why { font-size: 12px; color: var(--muted); line-height: 1.7; }
/* 入参占整行：它比 tool 名长得多，挤在同行会把 why 顶到下一行去 */
.cot-step-args {
  flex: 1 1 100%;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--panel-3);
  border-radius: 6px;
  padding: 5px 8px;
  word-break: break-all;
}
.cot-acts div { margin-top: 3px; }
.cot-act-node {
  font-size: 11px;
  color: var(--text);
  background: var(--panel-3);
  border-radius: 5px;
  padding: 1px 6px;
  margin-right: 4px;
}

/* ============ 报价文档 ============ */
.quote-doc {
  background: rgba(8, 20, 37, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-x: auto;
  color: #cfe4f5;
}

/* ============ 知识库条目 ============ */
.kb-hit {
  background: rgba(27, 59, 94, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.kb-hit:hover { border-color: rgba(45, 212, 240, 0.35); }

.kb-hit-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 7px;
}

.kb-hit-text { font-size: 12.5px; line-height: 1.7; }

/* ============ 提示条 ============ */
.alert {
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  font-size: 12.5px;
  margin-bottom: 14px;
  border: 1px solid;
  line-height: 1.75;
}

.alert-warn {
  background: rgba(245, 166, 35, 0.1);
  border-color: rgba(245, 166, 35, 0.35);
  color: #f5c26b;
}

.alert-info {
  background: rgba(45, 212, 240, 0.09);
  border-color: rgba(45, 212, 240, 0.3);
  color: #8fd8f5;
}

.alert-ok {
  background: rgba(46, 204, 143, 0.1);
  border-color: rgba(46, 204, 143, 0.3);
  color: #7ee2b8;
}

.alert-danger {
  background: rgba(242, 84, 91, 0.1);
  border-color: rgba(242, 84, 91, 0.35);
  color: #f79499;
}

/* 横幅（价格库报价状态口径） */
.banner {
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.75;
}

.banner:empty { display: none; }

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 22px;
  text-align: center;
}

/* ============ 价格库 ============ */
.chk {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 0;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
}

.chk input { width: auto; margin: 0; accent-color: var(--accent); }

.price-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-bottom: 11px;
  background: rgba(27, 59, 94, 0.4);
  transition: border-color 0.15s;
}

.price-item:hover { border-color: rgba(45, 212, 240, 0.28); }

.price-head { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.price-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 180px; }
.price-val { font-size: 15px; color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 600; }
.price-meta { font-size: 11.5px; color: var(--muted); margin-top: 7px; line-height: 1.7; }
.price-warn { font-size: 11.5px; color: var(--warn); margin-top: 5px; }
.price-edit { display: none; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.price-item.editing .price-edit { display: block; }

.mono { font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* ============ 能力卡片 ============ */
.hint { font-size: 12px; color: var(--muted); margin: 0 0 10px; line-height: 1.8; }

.caps { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 15px; }

.cap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 12px;
  background: rgba(27, 59, 94, 0.4);
  max-width: 260px;
  line-height: 1.65;
}

.cap.on { border-color: rgba(46, 204, 143, 0.45); }
.cap.off { border-color: rgba(242, 84, 91, 0.4); opacity: 0.85; }
.cap-name { font-weight: 600; }
.cap-on { color: var(--ok); }
.cap-off { color: var(--danger); }
.cap-why { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.cap-fix { color: var(--warn); font-size: 11.5px; margin-top: 4px; font-family: var(--mono); }

/* ============ 审计 ============ */
.audit-row td { vertical-align: top; font-size: 12.5px; }

.audit-actor-type {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.at-ai { color: #b98cff; border-color: rgba(185, 140, 255, 0.45); }
.at-user { color: var(--accent); }
.at-anonymous { color: var(--warn); }
.at-system { color: var(--muted); }

.audit-detail { color: var(--muted); font-size: 11.5px; margin-top: 4px; word-break: break-all; }

/* ============ 工具态 ============ */
.hidden { display: none !important; }

.toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  background: var(--panel-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  z-index: 99;
  box-shadow: var(--shadow);
  animation: toast-in 0.22s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   独立登录页
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
}

.login-hero {
  flex: 1.15;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(700px 380px at 18% 18%, rgba(45, 212, 240, 0.16), transparent 60%),
    radial-gradient(620px 420px at 82% 88%, rgba(47, 143, 224, 0.18), transparent 58%),
    linear-gradient(160deg, #0c2138 0%, #081120 100%);
  position: relative;
  overflow: hidden;
}

.login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(45, 212, 240, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 212, 240, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(75% 75% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(75% 75% at 50% 40%, #000 30%, transparent 100%);
  pointer-events: none;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 44px;
  position: relative;
  z-index: 1;
}

.hero-brand .brand-mark { width: 42px; height: 42px; font-size: 17px; }
.hero-brand .brand-text { font-size: 16px; }

.hero-title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 18px;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}

.hero-title .grad {
  background: linear-gradient(90deg, var(--accent), #7ce0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 38px;
  letter-spacing: 0.4px;
  position: relative;
  z-index: 1;
}

.hero-points {
  list-style: none;
  padding: 0;
  margin: 0 0 44px;
  position: relative;
  z-index: 1;
}

.hero-points li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: #c3d6e8;
  line-height: 1.7;
}

.hero-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-soft);
  border: 1px solid rgba(45, 212, 240, 0.3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 13px;
}

.hero-points b { color: var(--text); font-weight: 600; }

.hero-foot {
  font-size: 11.5px;
  color: rgba(143, 169, 196, 0.7);
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}

.login-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg);
  position: relative;
}

/* 语言切换按钮（i18n.js 注入）：登录页钉在面板右上角（页面右上角），
   不再被 flex 挤到卡片左侧 */
.login-panel > .lang-toggle {
  position: absolute;
  top: 24px;
  right: 28px;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-title { font-size: 23px; font-weight: 700; margin: 0 0 8px; }

.login-sub { font-size: 13px; color: var(--muted); margin: 0 0 26px; line-height: 1.7; }

.login-form label { margin-bottom: 7px; }

.login-form .field { margin-bottom: 16px; }

.login-btn {
  width: 100%;
  padding: 12px 18px;
  font-size: 14px;
  margin-top: 6px;
}

.login-row2 { display: flex; gap: 12px; }
.login-row2 .field { flex: 1; }

.login-alt {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
}

.login-alt a, .link-btn {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  border: 0;
  background: none;
  font: inherit;
  padding: 0;
}

.login-alt a:hover, .link-btn:hover { text-decoration: underline; }

.login-note {
  font-size: 11.5px;
  color: rgba(143, 169, 196, 0.75);
  line-height: 1.8;
  margin-top: 14px;
}

@media (max-width: 960px) {
  .login-wrap { flex-direction: column; }
  .login-hero { padding: 36px 28px; }
  .hero-title { font-size: 26px; }
  .hero-points { margin-bottom: 24px; }
  .login-panel { padding: 28px; }
}

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .sidebar { width: 196px; }
  .main { padding: 20px 18px 32px; }
  .topbar { padding: 0 18px; }
}

@media (max-width: 860px) {
  .sidebar { width: 64px; padding: 16px 8px; }
  .brand { padding: 4px 4px 14px; justify-content: center; }
  .brand-text, .brand-sub, .nav-group-title, .nav-label, .sidebar-foot { display: none; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .nav-item.active::before { left: -8px; }
  .nav-badge { position: absolute; top: 2px; right: 2px; float: none; padding: 0 5px; }
  .top-org, .top-sep { display: none; }
}
