/* ==========================================================================
   components.css — 通用组件：按钮、标签、卡片、表格、状态、骨架、toast、消息
   ========================================================================== */

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
    color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}

.btn .icon {
  width: 14px;
  height: 14px;
}

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

.btn--primary:hover {
  background: #16294a;
}

.btn--gold {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
  font-weight: 600;
}

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

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

.btn--ghost:hover {
  border-color: var(--text-3);
  color: var(--navy);
  background: var(--surface-2);
}

.btn--quiet {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
  padding: 5px 8px;
}

.btn--quiet:hover {
  background: var(--surface-3);
  color: var(--navy);
}

.btn--danger-ghost {
  background: transparent;
  border-color: rgba(180, 69, 60, 0.35);
  color: var(--danger);
}

.btn--danger-ghost:hover {
  background: var(--danger-soft);
}

.btn--sm {
  padding: 3px 8px;
  font-size: 11.5px;
  border-radius: 6px;
  gap: 4px;
}

.btn--sm .icon {
  width: 12px;
  height: 12px;
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn[data-busy="true"] {
  opacity: 0.75;
  cursor: progress;
}

.iconbtn {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: var(--text-2);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.iconbtn:hover {
  background: var(--surface-3);
  color: var(--navy);
}

.iconbtn--sm {
  width: 22px;
  height: 22px;
}

.iconbtn--sm .icon {
  width: 13px;
  height: 13px;
}

.pane--nav .iconbtn:hover {
  background: var(--nav-hover);
  color: #fff;
}

.pane--nav .btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--nav-line-strong);
  color: var(--nav-text);
}

.pane--nav .btn--ghost:hover {
  border-color: var(--gold);
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

/* ---------- 标签 / Chip ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  line-height: 1.6;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
  vertical-align: 1px;
  font-weight: 450;
}

.chip .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.chip--verified {
  color: var(--success);
  border-color: rgba(46, 125, 91, 0.3);
  background: var(--success-soft);
}

.chip--stated {
  color: var(--info);
  border-color: rgba(43, 92, 138, 0.28);
  background: var(--info-soft);
}

.chip--computed {
  color: var(--warn);
  border-color: rgba(183, 121, 31, 0.32);
  background: var(--warn-soft);
}

.chip--inference {
  color: #6d5a8f;
  border-color: rgba(109, 90, 143, 0.3);
  background: #f1eef8;
}

.chip--insufficient,
.chip--unknown {
  color: var(--text-3);
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.chip--danger,
.chip--conflict {
  color: var(--danger);
  border-color: rgba(180, 69, 60, 0.32);
  background: var(--danger-soft);
}

.chip--gold {
  color: #7a5a17;
  border-color: rgba(200, 161, 90, 0.45);
  background: var(--gold-wash);
}

.chip--stale {
  color: #8a5a12;
  border-color: rgba(183, 121, 31, 0.35);
  background: #fbf1df;
}

.chip--high {
  color: var(--danger);
  border-color: rgba(180, 69, 60, 0.32);
  background: var(--danger-soft);
}

.chip--medium {
  color: var(--warn);
  border-color: rgba(183, 121, 31, 0.32);
  background: var(--warn-soft);
}

.chip--low {
  color: var(--text-2);
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  line-height: 1.6;
  padding: 0 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--mock {
  color: #1d1405;
  background: var(--gold);
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-transform: none;
}

.badge--outline {
  border: 1px solid var(--line-strong);
  color: var(--text-3);
  background: transparent;
  font-weight: 500;
}

.appbar .chip--status {
  font-size: 10.5px;
  padding: 1px 7px;
  border-color: var(--nav-line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--nav-text);
}

.appbar .chip--status.chip--danger {
  color: #ffc9c4;
  border-color: rgba(255, 120, 108, 0.4);
  background: rgba(180, 69, 60, 0.22);
}

.appbar .chip--status.chip--stale {
  color: #ffdca1;
  border-color: rgba(255, 196, 92, 0.35);
  background: rgba(183, 121, 31, 0.22);
}

.appbar .chip--status.chip--verified {
  color: #a9e6c9;
  border-color: rgba(96, 200, 150, 0.35);
  background: rgba(46, 125, 91, 0.22);
}

/* ---------- 卡片 ---------- */

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

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  min-height: 38px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text);
  min-width: 0;
}

.card-title .icon {
  width: 14px;
  height: 14px;
  color: var(--gold-strong);
}

.card-sub {
  font-size: 10.5px;
  color: var(--text-3);
  line-height: 1.5;
}

.card-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.card-body {
  padding: 12px;
}

.card-body--tight {
  padding: 8px 10px;
}

.card-body--flush {
  padding: 0;
}

.card-foot {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-3);
}

/* ---------- 表格 ---------- */

.tbl-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.tbl {
  font-size: 11.5px;
  min-width: 100%;
  color: var(--text);
}

.tbl th {
  text-align: left;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--text-3);
  padding: 6px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.tbl td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  line-height: 1.5;
}

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

.tbl tbody tr:hover {
  background: var(--surface-2);
}

.tbl td.num,
.tbl th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tbl td.center,
.tbl th.center {
  text-align: center;
}

.tbl .row-strong td {
  font-weight: 600;
  background: var(--gold-wash);
}

.tbl .row-muted td {
  color: var(--text-3);
}

.tbl--dense td {
  padding: 5px 8px;
}

.tbl--dense th {
  padding: 5px 8px;
}

.tbl .cell-title {
  font-weight: 550;
  color: var(--text);
}

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

.tbl--matrix td,
.tbl--matrix th {
  text-align: center;
}

.tbl--matrix td:first-child,
.tbl--matrix th:first-child {
  text-align: left;
  min-width: 116px;
}

/* ---------- 进度 / 条形 ---------- */

.bar {
  height: 6px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
  min-width: 40px;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--info);
  transition: width var(--dur-2) var(--ease);
}

.bar--success > i {
  background: var(--success);
}

.bar--warn > i {
  background: var(--warn);
}

.bar--danger > i {
  background: var(--danger);
}

.bar--gold > i {
  background: var(--gold);
}

.bar--thin {
  height: 4px;
}

.meter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-2);
}

.meter .bar {
  flex: 1 1 auto;
}

.meter-value {
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  color: var(--text-2);
  min-width: 34px;
  text-align: right;
}

/* ---------- 键值 ---------- */

.kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 12px;
  font-size: 11.5px;
  line-height: 1.55;
}

.kv dt {
  color: var(--text-3);
  white-space: nowrap;
}

.kv dd {
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.kv--rows {
  display: block;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}

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

.kv-row > span:first-child {
  color: var(--text-3);
  flex: 0 0 auto;
}

.kv-row > span:last-child {
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ---------- Callout ---------- */

.callout {
  display: flex;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.6;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
}

.callout .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.callout b,
.callout strong {
  color: var(--text);
  font-weight: 600;
}

.callout--info {
  border-color: rgba(43, 92, 138, 0.25);
  background: var(--info-soft);
  color: #24496d;
}

.callout--warn {
  border-color: rgba(183, 121, 31, 0.3);
  background: var(--warn-soft);
  color: #6d4813;
}

.callout--danger {
  border-color: rgba(180, 69, 60, 0.28);
  background: var(--danger-soft);
  color: #7d2b25;
}

.callout--success {
  border-color: rgba(46, 125, 91, 0.28);
  background: var(--success-soft);
  color: #1f5a40;
}

/* ---------- 空态 / 错误态 / 骨架 ---------- */

.empty {
  padding: 26px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.65;
}

.empty .icon {
  width: 26px;
  height: 26px;
  margin: 0 auto 8px;
  color: var(--line-strong);
}

.empty-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 3px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.empty--error .icon {
  color: rgba(180, 69, 60, 0.55);
}

.empty--error .empty-title {
  color: var(--danger);
}

.skeleton {
  background: linear-gradient(90deg, #eaedf2 25%, #f5f7fa 37%, #eaedf2 63%);
  background-size: 400% 100%;
  animation: shimmer 1.6s ease infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: #eef1f5;
  }
}

.skeleton--line {
  height: 10px;
  margin-bottom: 8px;
}

.skeleton--bubble {
  height: 54px;
  margin-bottom: 12px;
  border-radius: 10px;
}

.skeleton--bubble.skeleton--right {
  margin-left: auto;
}

.skeleton--card {
  height: 148px;
  margin-bottom: 10px;
  border-radius: 10px;
}

.skeleton--kpi {
  height: 74px;
  border-radius: 10px;
}

.chat-skeleton {
  padding-top: 4px;
}

.cockpit-skeleton {
  display: flex;
  flex-direction: column;
}

/* ---------- Toast ---------- */

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--navy);
  color: #fff;
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: var(--shadow-2);
  animation: toast-in var(--dur-2) var(--ease);
}

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

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}

.toast--success {
  border-left-color: var(--success);
}

.toast--error {
  border-left-color: var(--danger);
}

.toast--warn {
  border-left-color: var(--warn);
}

.toast span {
  flex: 1 1 auto;
}

.toast .iconbtn {
  color: var(--gold-soft);
  width: 20px;
  height: 20px;
}

.toast .iconbtn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ---------- 对话消息 ---------- */

.msg {
  display: flex;
  gap: 8px;
  margin-bottom: 13px;
  align-items: flex-start;
}

.msg-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.msg--advisor .msg-avatar {
  background: var(--navy);
  color: var(--gold);
  border: 1px solid var(--navy);
}

.msg-body {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.4;
  flex-wrap: wrap;
}

.msg-meta .who {
  font-weight: 600;
  color: var(--text-2);
}

.msg-bubble {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.68;
  color: var(--text);
  box-shadow: var(--shadow-1);
  overflow-wrap: anywhere;
}

.msg-bubble p + p {
  margin-top: 7px;
}

.msg-bubble ul {
  margin: 6px 0 0;
  padding-left: 0;
}

.msg-bubble li {
  position: relative;
  padding-left: 13px;
  margin-top: 3px;
}

.msg-bubble li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.72em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-strong);
}

.msg-bubble strong {
  font-weight: 650;
  color: var(--navy);
}

.msg-bubble .msg-why {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.msg-bubble .msg-why b {
  color: var(--gold-strong);
  font-weight: 600;
}

/* 顾问提问 */
.msg--question .msg-bubble {
  border-left: 2px solid var(--gold);
  background: linear-gradient(180deg, #fffdf8 0%, #fff 60%);
}

/* 用户回答 */
.msg--user {
  flex-direction: row-reverse;
}

.msg--user .msg-avatar {
  background: var(--surface-3);
  color: var(--info);
  border: 1px solid var(--line-strong);
}

.msg--user .msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.msg--user .msg-meta {
  justify-content: flex-end;
}

.msg--user .msg-bubble {
  background: var(--navy);
  border-color: var(--navy);
  color: #f3f6fb;
  border-radius: 10px 10px 3px 10px;
  max-width: 92%;
}

.msg--user .msg-bubble strong {
  color: var(--gold-soft);
}

/* 分析 / 小结 */
.msg--analysis .msg-bubble {
  border-left: 2px solid var(--info);
  background: var(--surface-2);
}

.msg--summary .msg-bubble {
  border: 1px solid rgba(200, 161, 90, 0.5);
  background: linear-gradient(180deg, #fffdf7, #fff);
  border-left-width: 3px;
  border-left-color: var(--gold);
}

.msg--summary .msg-bubble h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

/* 系统提示 */
.msg--system {
  justify-content: center;
  margin-bottom: 12px;
}

.msg--system .msg-bubble {
  background: transparent;
  border: 1px dashed var(--line-strong);
  box-shadow: none;
  font-size: 10.5px;
  color: var(--text-3);
  padding: 3px 9px;
  border-radius: 999px;
}

.msg--system .msg-avatar,
.msg--system .msg-meta {
  display: none;
}

.msg--system .msg-body {
  display: flex;
  justify-content: center;
  flex: 0 0 auto;
}

/* 打字指示 */
.typing {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  padding: 2px 0;
}

.typing i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-3);
  animation: typing 1.1s infinite ease-in-out;
}

.typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: none;
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .typing i {
    animation: none;
    opacity: 0.6;
  }
}

/* 小结确认卡 */
.summary-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  margin-bottom: 8px;
  overflow: hidden;
}

.summary-card[hidden] {
  display: none;
}

.summary-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  background: var(--surface-3);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}

.summary-head .icon {
  width: 13px;
  height: 13px;
  color: var(--gold-strong);
}

.summary-head .chip {
  margin-left: auto;
}

.summary-body {
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.62;
  max-height: 168px;
  overflow-y: auto;
}

.summary-body h5 {
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 3px;
  margin-top: 8px;
}

.summary-body h5:first-child {
  margin-top: 0;
}

.summary-body ul {
  padding-left: 0;
}

.summary-body li {
  position: relative;
  padding-left: 12px;
  margin-top: 2px;
}

.summary-body li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

.summary-actions {
  display: flex;
  gap: 6px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
  align-items: center;
}

.summary-card[data-collapsed="true"] .summary-body,
.summary-card[data-collapsed="true"] .summary-actions {
  display: none;
}

.summary-empty {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.6;
}

/* ---------- 左栏面板（导航内容） ---------- */

.np-section + .np-section {
  margin-top: 14px;
}

.np-title {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

.np-title .spacer {
  flex: 1;
}

.np-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--nav-line);
  font-size: 11.5px;
  line-height: 1.5;
}

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

.np-row > span:first-child {
  color: var(--nav-text-dim);
  flex: 0 0 auto;
}

.np-row > span:last-child {
  color: var(--nav-text);
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.np-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border-radius: 7px;
  border: 1px solid transparent;
  color: var(--nav-text);
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}

.np-item + .np-item {
  margin-top: 2px;
}

.np-item:hover {
  background: var(--nav-hover);
}

.np-item[aria-current="true"] {
  background: var(--nav-active);
  border-color: rgba(200, 161, 90, 0.35);
}

.np-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.4;
}

.np-item-title {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.np-item-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 10px;
  color: var(--nav-text-dim);
  flex-wrap: wrap;
}

.np-item--report {
  border: 1px solid var(--nav-line);
  background: rgba(255, 255, 255, 0.02);
}

.np-item--report .np-item-head {
  justify-content: space-between;
}

.np-actions {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.np-btn {
  font-size: 10.5px;
  line-height: 1.5;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--nav-line-strong);
  color: var(--nav-text);
  background: rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
    background var(--dur-1) var(--ease);
}

.np-btn:hover {
  border-color: var(--gold);
  color: #fff;
  background: rgba(200, 161, 90, 0.14);
}

.np-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.np-empty {
  font-size: 11px;
  color: var(--nav-text-dim);
  padding: 8px 2px;
  line-height: 1.6;
}

.np-note {
  font-size: 10px;
  color: var(--nav-text-dim);
  line-height: 1.6;
  margin-top: 6px;
}

.np-list {
  margin: 0;
}

.np-upload {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  padding: 6px 0;
  border-bottom: 1px dashed var(--nav-line);
  font-size: 11px;
}

.np-upload:last-child {
  border-bottom: 0;
}

.np-upload .icon {
  width: 13px;
  height: 13px;
  margin-top: 2px;
  color: var(--nav-text-dim);
}

.np-upload-name {
  color: var(--nav-text);
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.np-upload-meta {
  font-size: 9.5px;
  color: var(--nav-text-dim);
  margin-top: 2px;
}

/* 设置开关 */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--nav-line);
  font-size: 11.5px;
}

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

.switch {
  position: relative;
  width: 32px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--nav-line-strong);
  transition: background var(--dur-1) var(--ease);
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--nav-text-dim);
  transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}

.switch[aria-checked="true"] {
  background: rgba(200, 161, 90, 0.35);
  border-color: rgba(200, 161, 90, 0.6);
}

.switch[aria-checked="true"]::after {
  transform: translateX(15px);
  background: var(--gold);
}

/* ---------- 通用区块标题 ---------- */

.sec {
  margin-bottom: 12px;
}

.sec:last-child {
  margin-bottom: 0;
}

.sec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  min-height: 20px;
}

.sec-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

.sec-title::before {
  content: "";
  width: 3px;
  height: 11px;
  border-radius: 2px;
  background: var(--gold);
}

.sec-note {
  font-size: 10.5px;
  color: var(--text-3);
}

.sec-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.grid {
  display: grid;
  gap: 10px;
}

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

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

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

.grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

@media (max-width: 1280px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 数据缺失说明 */
.missing-note {
  font-size: 10.5px;
  color: var(--text-3);
  line-height: 1.5;
  display: flex;
  gap: 5px;
  align-items: flex-start;
}

.missing-note .icon {
  width: 12px;
  height: 12px;
  margin-top: 2px;
  color: var(--warn);
  flex: 0 0 auto;
}

/* ==========================================================================
   兼容性补充（真实后端字段 / 紧凑布局）
   ========================================================================== */

.kpi-source {
  font-size: 9.5px;
  color: var(--text-3);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

html[data-sources="off"] .kpi-source,
html[data-sources="off"] .fact-key {
  display: none;
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 1ms !important;
  scroll-behavior: auto !important;
}

/* 左栏（深色）里的通用组件配色 */
.pane--nav .chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--nav-line-strong);
  color: var(--nav-text);
}

.pane--nav .chip .dot {
  opacity: 0.9;
}

.pane--nav .chip--gold {
  color: var(--gold-soft);
  border-color: rgba(200, 161, 90, 0.45);
  background: rgba(200, 161, 90, 0.14);
}

.pane--nav .chip--verified {
  color: #a9e6c9;
  border-color: rgba(96, 200, 150, 0.32);
  background: rgba(46, 125, 91, 0.18);
}

.pane--nav .chip--stated {
  color: #bcd7f2;
  border-color: rgba(96, 148, 200, 0.32);
  background: rgba(43, 92, 138, 0.2);
}

.pane--nav .chip--insufficient {
  color: #b7c2d6;
  border-color: var(--nav-line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.pane--nav .bar {
  background: rgba(255, 255, 255, 0.12);
}

.pane--nav .bar > i {
  background: var(--gold);
}

.pane--nav .empty {
  color: var(--nav-text-dim);
}

.pane--nav .empty-title {
  color: var(--nav-text);
}

.pane--nav .meter-value {
  color: var(--gold-soft);
}

/* 上传提示卡（对话流内） */
.upload-notice {
  border: 1px dashed rgba(200, 161, 90, 0.5);
  background: #fffdf8;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  text-align: left;
  color: var(--text-2);
  line-height: 1.55;
  max-width: 100%;
}

.upload-notice .icon {
  width: 13px;
  height: 13px;
  color: var(--gold-strong);
}

.upload-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.upload-suggest .quick-chip {
  font-size: 10.5px;
}

/* 报告预览弹窗 */
.report-dialog {
  width: min(880px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}

.report-dialog::backdrop {
  background: rgba(11, 26, 51, 0.55);
  backdrop-filter: blur(2px);
}

.report-head {
  background: var(--navy);
  color: var(--nav-text);
  padding: 16px 20px 14px;
  border-bottom: 3px solid var(--gold);
}

.report-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-org {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.report-kicker {
  font-size: 11px;
  color: var(--gold-soft);
  margin-top: 1px;
}

.report-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
  font-size: 10.5px;
  color: var(--nav-text-dim);
}

.report-meta-line .chip {
  margin-left: 2px;
}

.report-body {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: calc(100vh - 240px);
  font-size: 12px;
  line-height: 1.7;
}

.report-body h3 {
  font-size: 12.5px;
  font-weight: 650;
  margin: 16px 0 6px;
  padding-left: 8px;
  border-left: 3px solid var(--gold);
  color: var(--navy);
}

.report-body h3:first-child {
  margin-top: 0;
}

.report-body .kv {
  grid-template-columns: 84px minmax(0, 1fr);
  font-size: 11.5px;
}

.report-body ul {
  padding-left: 16px;
  list-style: disc;
  margin: 4px 0;
}

.report-body li {
  margin-top: 3px;
}

.report-body .tbl-wrap {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 6px 0;
}

.report-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.report-foot .btn:last-child {
  margin-left: auto;
}

/* 打印：报告弹窗时只打印报告 */
@media print {
  body[data-dialog="report"] .app {
    display: none !important;
  }

  body[data-dialog="report"] .report-dialog {
    position: static;
    width: 100%;
    max-height: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
  }

  body[data-dialog="report"] .report-dialog::backdrop {
    display: none;
  }

  body[data-dialog="report"] .report-body {
    max-height: none;
    overflow: visible;
  }

  body[data-dialog="report"] .report-head {
    background: #fff !important;
    color: var(--navy) !important;
    border-bottom: 2px solid var(--navy);
  }

  body[data-dialog="report"] .report-kicker,
  body[data-dialog="report"] .report-meta-line {
    color: var(--text-2) !important;
  }

  .gateway {
    display: none !important;
  }
}
