/* ==========================================================================
   表面活性剂知识库 · 组件层
   ========================================================================== */

/* ------------------------------------------------------------------ 按钮 --- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-border: var(--line);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 12.5px;
  font-weight: 560;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
  user-select: none;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:hover { border-color: var(--line-strong); background: var(--surface-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}
.btn-primary {
  --btn-bg: linear-gradient(180deg, #3cc3f8, #0ea5e9);
  --btn-border: transparent;
  --btn-fg: #041523;
  font-weight: 650;
  box-shadow: 0 8px 22px -12px rgba(56, 189, 248, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover { filter: brightness(1.05); background: linear-gradient(180deg, #5bccfa, #0ea5e9); }
:root[data-theme="light"] .btn-primary { --btn-bg: linear-gradient(180deg, #0ea5e9, #0284c7); --btn-fg: #ffffff; }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--text-2); }
.btn-ghost:hover { --btn-bg: var(--surface-2); --btn-border: var(--line-soft); color: var(--text); }
.btn-outline { --btn-bg: transparent; }
.btn-danger { --btn-bg: var(--rose-soft); --btn-border: color-mix(in srgb, var(--rose) 36%, transparent); --btn-fg: var(--rose); }
.btn-success { --btn-bg: var(--green-soft); --btn-border: color-mix(in srgb, var(--green) 36%, transparent); --btn-fg: var(--green); }
.btn-warn { --btn-bg: var(--amber-soft); --btn-border: color-mix(in srgb, var(--amber) 36%, transparent); --btn-fg: var(--amber); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }

.btn.is-loading { pointer-events: none; opacity: 0.75; }
.btn.is-loading::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ 徽标 --- */
.badge {
  --badge-fg: var(--text-2);
  --badge-bg: var(--surface-2);
  --badge-border: var(--line);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--badge-border);
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.badge-lg { height: 26px; padding: 0 11px; font-size: 11.5px; }
.badge-accent { --badge-fg: var(--accent); --badge-bg: var(--accent-soft); --badge-border: var(--accent-line); }
.badge-green { --badge-fg: var(--green); --badge-bg: var(--green-soft); --badge-border: color-mix(in srgb, var(--green) 30%, transparent); }
.badge-amber { --badge-fg: var(--amber); --badge-bg: var(--amber-soft); --badge-border: color-mix(in srgb, var(--amber) 30%, transparent); }
.badge-rose { --badge-fg: var(--rose); --badge-bg: var(--rose-soft); --badge-border: color-mix(in srgb, var(--rose) 30%, transparent); }
.badge-violet { --badge-fg: var(--violet); --badge-bg: var(--violet-soft); --badge-border: color-mix(in srgb, var(--violet) 30%, transparent); }
.badge-teal { --badge-fg: var(--teal); --badge-bg: var(--teal-soft); --badge-border: color-mix(in srgb, var(--teal) 30%, transparent); }
.badge-muted { --badge-fg: var(--text-3); }
.badge-solid { --badge-fg: #05111f; --badge-bg: var(--accent); --badge-border: transparent; }

/* 状态徽标语义 */
.status-badge[data-status="pending_review"] { --badge-fg: var(--amber); --badge-bg: var(--amber-soft); --badge-border: color-mix(in srgb, var(--amber) 30%, transparent); }
.status-badge[data-status="in_review"] { --badge-fg: var(--accent); --badge-bg: var(--accent-soft); --badge-border: var(--accent-line); }
.status-badge[data-status="needs_more"] { --badge-fg: var(--violet); --badge-bg: var(--violet-soft); --badge-border: color-mix(in srgb, var(--violet) 30%, transparent); }
.status-badge[data-status="approved_for_publish"] { --badge-fg: var(--green); --badge-bg: var(--green-soft); --badge-border: color-mix(in srgb, var(--green) 30%, transparent); }
.status-badge[data-status="rejected"] { --badge-fg: var(--rose); --badge-bg: var(--rose-soft); --badge-border: color-mix(in srgb, var(--rose) 30%, transparent); }
.status-badge[data-status="deferred"] { --badge-fg: var(--text-3); --badge-bg: var(--surface-2); --badge-border: var(--line); }

/* 路线徽标 */
.route-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; letter-spacing: 0.02em; color: var(--text-2); white-space: nowrap; }
.route-badge .swatch { width: 8px; height: 8px; border-radius: 2.5px; background: var(--route-color, var(--text-3)); box-shadow: 0 0 8px color-mix(in srgb, var(--route-color, var(--text-3)) 55%, transparent); }
.route-badge[data-route="R1"] { --route-color: var(--route-r1); }
.route-badge[data-route="R2"] { --route-color: var(--route-r2); }
.route-badge[data-route="R3"] { --route-color: var(--route-r3); }
.route-badge[data-route="R4"] { --route-color: var(--route-r4); }
.route-badge[data-route="M"] { --route-color: var(--route-m); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 11.5px;
  white-space: nowrap;
}
.chip svg { width: 12px; height: 12px; }
.chip.is-clickable { cursor: pointer; transition: all var(--dur) var(--ease); }
.chip.is-clickable:hover { border-color: var(--accent-line); color: var(--text); background: var(--accent-soft); }
.chip-remove { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: transparent; color: var(--text-3); }
.chip-remove:hover { background: var(--rose-soft); color: var(--rose); }
.chip-remove svg { width: 10px; height: 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }

kbd.kbd, .kbd {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 19px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--surface-2);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
}

/* ------------------------------------------------------------------ 卡片 --- */
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 82%, var(--bg)));
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card-hover { transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.card-hover:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 0;
}
.card-title { font-size: 14px; font-weight: 650; letter-spacing: -0.005em; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 15px; height: 15px; color: var(--accent); }
.card-sub { margin-top: 3px; font-size: 11.5px; color: var(--text-3); }
.card-body { padding: 16px 18px 18px; }
.card-pad { padding: 18px; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--text-3);
}
.card-flush .card-body { padding: 14px 0 0; }

.panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-inset);
  padding: 14px 16px;
}
.panel-title { font-size: 12px; font-weight: 650; color: var(--text-2); display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.panel-title svg { width: 14px; height: 14px; color: var(--text-3); }

/* ------------------------------------------------------------------ 网格 --- */
.grid { display: grid; gap: 16px; }
.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-fit, minmax(248px, 1fr)); }
.grid-dash { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 9px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--line-soft); border: 0; margin: 0; }
.vdiv { width: 1px; align-self: stretch; background: var(--line-soft); }

/* ------------------------------------------------------------- 统计数字 --- */
.stat {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 78%, var(--bg)));
  overflow: hidden;
  min-width: 0;
}
.stat::after {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at 100% 0%, var(--stat-glow, var(--accent-soft)), transparent 68%);
  pointer-events: none;
}
.stat-label { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 560; color: var(--text-3); }
.stat-label svg { width: 14px; height: 14px; color: var(--stat-color, var(--accent)); }
.stat-value {
  margin-top: 9px;
  font-size: clamp(24px, 2.4vw, 31px);
  font-weight: 720;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.stat-value .unit { font-size: 12px; font-weight: 550; color: var(--text-3); letter-spacing: 0; }
.stat-foot { margin-top: 9px; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }
.stat-accent { --stat-color: var(--accent); --stat-glow: var(--accent-soft); }
.stat-violet { --stat-color: var(--violet); --stat-glow: var(--violet-soft); }
.stat-green { --stat-color: var(--green); --stat-glow: var(--green-soft); }
.stat-amber { --stat-color: var(--amber); --stat-glow: var(--amber-soft); }
.stat-rose { --stat-color: var(--rose); --stat-glow: var(--rose-soft); }
.stat-teal { --stat-color: var(--teal); --stat-glow: var(--teal-soft); }

/* --------------------------------------------------------------- 数据表 --- */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 760px;
}
table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data thead th.sortable { cursor: pointer; user-select: none; }
table.data thead th.sortable:hover { color: var(--text-2); }
table.data thead th .sort-ind { margin-left: 4px; color: var(--accent); font-size: 10px; }
table.data tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-2);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background var(--dur) var(--ease); }
table.data tbody tr.is-clickable { cursor: pointer; }
table.data tbody tr.is-clickable:hover td { background: var(--surface-2); color: var(--text); }
table.data tbody tr.is-selected td { background: var(--accent-soft); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .cell-title { max-width: 560px; }
table.data .cell-title .t {
  color: var(--text);
  font-weight: 560;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
table.data .cell-title .m {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-4);
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  font-size: 12px;
  color: var(--text-3);
}
.pagination { display: flex; align-items: center; gap: 5px; }
.page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 550;
  display: inline-grid;
  place-items: center;
  transition: all var(--dur) var(--ease);
}
.page-btn:hover:not(:disabled) { border-color: var(--accent-line); color: var(--accent); }
.page-btn.is-active { background: var(--accent); border-color: var(--accent); color: #041523; font-weight: 700; }
:root[data-theme="light"] .page-btn.is-active { color: #fff; }
.page-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.page-btn svg { width: 13px; height: 13px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-2);
  user-select: none;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--surface-inset);
  color: transparent;
  transition: all var(--dur) var(--ease);
}
.check .box svg { width: 11px; height: 11px; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); color: #041523; }
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check:hover .box { border-color: var(--accent-line); }
.check.is-radio .box { border-radius: 50%; }
.check.is-radio input:checked + .box { background: var(--accent); }

/* --------------------------------------------------------------- 表单 --- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 11.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field-label .req { color: var(--rose); }
.field-hint { font-size: 11px; color: var(--text-4); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-inset);
  color: var(--text);
  font-size: 13px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.55; cursor: not-allowed; }
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a9cb5' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.select option { background: var(--surface); color: var(--text); }
.input-group { display: flex; align-items: center; gap: 8px; }
.input-icon { position: relative; }
.input-icon > svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-4);
  pointer-events: none;
}
.input-icon .input { padding-left: 33px; }

.search-box { position: relative; flex: 1; min-width: 180px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-4); }
.search-box .input { padding-left: 34px; padding-right: 32px; }
.search-box .clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--text-4);
  border-radius: 5px;
}
.search-box .clear:hover { color: var(--text); background: var(--surface-3); }
.search-box .clear svg { position: static; transform: none; width: 12px; height: 12px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  transition: all var(--dur) var(--ease);
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-3);
  transition: all var(--dur) var(--ease);
}
.switch input:checked + .track { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + .track::after { left: 18px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-text { display: flex; flex-direction: column; line-height: 1.3; }
.switch-text b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.switch-text span { font-size: 11px; color: var(--text-4); }

/* --------------------------------------------------------------- 筛选条 --- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 14px;
}
.toolbar .search-box { flex: 1 1 260px; }
.toolbar .select { width: auto; min-width: 118px; }
.toolbar .input { width: auto; }
.toolbar-label { font-size: 11px; font-weight: 600; color: var(--text-4); letter-spacing: 0.04em; }
.toolbar-sep { width: 1px; height: 22px; background: var(--line-soft); }

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
}
.segmented button {
  height: 28px;
  padding: 0 11px;
  border-radius: 6px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented button .n { margin-left: 5px; font-family: var(--font-mono); font-size: 10.5px; opacity: 0.7; }

.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 13px;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.tab .n { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-4); background: var(--surface-2); padding: 1px 6px; border-radius: 999px; }
.tab.is-active .n { color: var(--accent); background: var(--accent-soft); }

/* --------------------------------------------------------------- 提示条 --- */
.notice {
  --notice-color: var(--accent);
  --notice-bg: var(--accent-soft);
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--notice-color) 28%, transparent);
  border-left: 3px solid var(--notice-color);
  border-radius: var(--radius-sm);
  background: var(--notice-bg);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
}
.notice svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--notice-color); }
.notice b { color: var(--text); font-weight: 650; }
.notice-warn { --notice-color: var(--amber); --notice-bg: var(--amber-soft); }
.notice-danger { --notice-color: var(--rose); --notice-bg: var(--rose-soft); }
.notice-success { --notice-color: var(--green); --notice-bg: var(--green-soft); }
.notice-info { --notice-color: var(--violet); --notice-bg: var(--violet-soft); }
.notice-title { font-weight: 650; color: var(--text); margin-bottom: 2px; }

/* --------------------------------------------------------------- 时间线 --- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding-bottom: 17px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 22px;
  bottom: 0;
  width: 1px;
  background: var(--line-soft);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-3);
  z-index: 1;
}
.timeline-dot svg { width: 12px; height: 12px; }
.timeline-dot[data-tone="accent"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.timeline-dot[data-tone="green"] { color: var(--green); border-color: color-mix(in srgb, var(--green) 36%, transparent); background: var(--green-soft); }
.timeline-dot[data-tone="amber"] { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 36%, transparent); background: var(--amber-soft); }
.timeline-dot[data-tone="rose"] { color: var(--rose); border-color: color-mix(in srgb, var(--rose) 36%, transparent); background: var(--rose-soft); }
.timeline-dot[data-tone="violet"] { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 36%, transparent); background: var(--violet-soft); }
.timeline-body { min-width: 0; padding-top: 1px; }
.timeline-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.timeline-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.timeline-time { font-size: 10.5px; color: var(--text-4); font-family: var(--font-mono); }
.timeline-desc { margin-top: 2px; font-size: 11.5px; color: var(--text-3); line-height: 1.55; overflow-wrap: anywhere; }

/* --------------------------------------------------------------- 空/加载 --- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 54px 24px;
  text-align: center;
  color: var(--text-3);
}
.empty-art {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-4);
  margin-bottom: 2px;
}
.empty-art svg { width: 27px; height: 27px; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-2); }
.empty-desc { max-width: 440px; font-size: 12px; line-height: 1.65; }
.empty .btn { margin-top: 4px; }

.error-state { border-color: color-mix(in srgb, var(--rose) 30%, transparent); background: linear-gradient(180deg, var(--surface), var(--rose-soft)); }
.error-state .empty-art { color: var(--rose); border-color: color-mix(in srgb, var(--rose) 30%, transparent); background: var(--rose-soft); }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 6px; }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 6%, transparent), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-line { height: 12px; margin: 8px 0; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-card { height: 110px; border-radius: var(--radius); }
.skeleton-tile { height: 96px; border-radius: var(--radius); }
.skeleton-row { height: 42px; border-radius: 6px; margin-bottom: 8px; }

.loading-bar { position: relative; height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.loading-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36%;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: slide 1.1s var(--ease) infinite;
}
@keyframes slide { from { left: -36%; } to { left: 100%; } }

.progress { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--line-soft); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); transition: width 0.4s var(--ease); }
.progress.is-done > span { background: linear-gradient(90deg, #059669, var(--green)); }
.progress.is-failed > span { background: linear-gradient(90deg, #be123c, var(--rose)); }

/* --------------------------------------------------------------- 抽屉 --- */
.drawer-backdrop, .modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(3, 7, 15, 0.58);
  backdrop-filter: blur(4px);
  animation: fade-in 0.18s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 121;
  width: min(620px, 94vw);
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  animation: drawer-in 0.24s var(--ease);
}
@keyframes drawer-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }
.drawer-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.drawer-close { margin-left: auto; flex: none; }

.modal {
  position: fixed;
  z-index: 121;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); } to { opacity: 1; transform: translate(-50%, -50%); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 15px; font-weight: 650; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); }
body.no-scroll { overflow: hidden; }

/* --------------------------------------------------------------- Toast --- */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(370px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  --toast-color: var(--accent);
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--toast-color) 32%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, var(--toast-color));
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.24s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.toast.is-out { animation: toast-out 0.2s var(--ease) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
.toast svg { width: 16px; height: 16px; flex: none; color: var(--toast-color); margin-top: 2px; }
.toast-body { min-width: 0; flex: 1; }
.toast-title { font-size: 12.5px; font-weight: 650; color: var(--text); }
.toast-msg { margin-top: 1px; font-size: 11.5px; color: var(--text-3); line-height: 1.5; overflow-wrap: anywhere; }
.toast-close { color: var(--text-4); flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; }
.toast-close:hover { color: var(--text); background: var(--surface-3); }
.toast-close svg { width: 12px; height: 12px; margin: 0; }
.toast-success { --toast-color: var(--green); }
.toast-error { --toast-color: var(--rose); }
.toast-warn { --toast-color: var(--amber); }

/* --------------------------------------------------------------- 列表 --- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
}
.list-item:last-child { border-bottom: 0; }
.list-item svg { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--text-4); }
.list-item b { color: var(--text); font-weight: 600; }
.list-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-4); flex: none; margin-top: 8px; }

.kv { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 8px 14px; font-size: 12.5px; }
.kv dt { color: var(--text-4); font-size: 11.5px; padding-top: 1px; }
.kv dd { color: var(--text-2); min-width: 0; overflow-wrap: anywhere; }
.kv-dd-strong { color: var(--text); font-weight: 550; }

.quote {
  padding: 11px 14px;
  border-left: 2px solid var(--accent-line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-inset);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.quote-mark { color: var(--text-4); font-family: Georgia, serif; font-size: 17px; line-height: 1; }

.code-block {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-inset);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--text-2);
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hash {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  background: var(--surface-inset);
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-soft);
  overflow-wrap: anywhere;
}

.hover-tip {
  position: fixed;
  z-index: 300;
  max-width: 340px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-lg);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-2);
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.hover-tip b { color: var(--text); display: block; font-size: 12px; margin-bottom: 3px; }
.hover-tip .tip-meta { color: var(--text-4); font-size: 10.5px; margin-top: 4px; }

/* --------------------------------------------------------------- 图表 --- */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap svg { width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--text-3); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 9px; height: 9px; border-radius: 2.5px; background: var(--c, var(--accent)); }
.chart-grid-line { stroke: var(--line-soft); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis-text { fill: var(--text-4); font-size: 9.5px; font-family: var(--font-sans); }
.chart-bar { transition: opacity var(--dur) var(--ease), filter var(--dur) var(--ease); cursor: pointer; }
.chart-bar:hover { filter: brightness(1.25); }
.chart-tip {
  position: absolute;
  z-index: 5;
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 11px;
  color: var(--text);
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -130%);
}

.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 46px; align-items: center; gap: 10px; font-size: 11.5px; }
.bar-row .bl { color: var(--text-2); display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.bar-row .bl .sw { width: 7px; height: 7px; border-radius: 2px; flex: none; background: var(--c, var(--accent)); }
.bar-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--c, var(--accent)); opacity: 0.9; transition: width 0.5s var(--ease); }
.bar-row .bv { text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

.donut-center { text-align: center; }
.donut-center .n { font-size: 22px; font-weight: 720; color: var(--text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.donut-center .l { font-size: 10.5px; color: var(--text-4); }

/* --------------------------------------------------------------- 详情 --- */
.detail-hero { display: flex; flex-direction: column; gap: 10px; }
.detail-title { font-size: 20px; font-weight: 680; line-height: 1.4; letter-spacing: -0.015em; }
.detail-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.detail-section { margin-top: 20px; }
.detail-section > .sec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-4);
}
.detail-section > .sec-head::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.detail-section > .sec-head svg { width: 13px; height: 13px; color: var(--accent); }

.split-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.split-left { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - var(--topbar-h) - 40px); }
.split-left .card { display: flex; flex-direction: column; min-height: 0; }
.split-left .card-body { overflow-y: auto; }

.queue-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--dur) var(--ease);
}
.queue-item:hover { background: var(--surface-2); border-color: var(--line-soft); }
.queue-item.is-active { background: var(--accent-soft); border-color: var(--accent-line); }
.queue-item .qt { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.queue-item .qm { margin-top: 5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 10.5px; color: var(--text-4); }

.step-list { display: flex; flex-direction: column; gap: 0; counter-reset: step; }
.step {
  position: relative;
  padding: 0 0 18px 32px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
}
.step:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 26px; bottom: 4px; width: 1px; background: var(--line-soft); }
.step b { color: var(--text); }

/* --------------------------------------------------------------- 响应式 --- */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-dash { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .span-3, .span-4, .span-5 { grid-column: span 3; }
  .span-6, .span-7, .span-8, .span-9 { grid-column: span 6; }
}

@media (max-width: 1024px) {
  .split-layout { grid-template-columns: minmax(0, 1fr); }
  .split-left { position: static; max-height: none; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .toolbar .select { flex: 1 1 140px; }
}

@media (max-width: 720px) {
  .grid-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-12 { grid-column: span 2; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: 104px minmax(0, 1fr); }
  .bar-row { grid-template-columns: 82px minmax(0, 1fr) 38px; }
  .drawer { width: 100vw; }
  .table-foot { justify-content: center; }
}
