/* 逆影控制台设计稿 — 共享样式 */

:root {
  --bg: #080a10;
  --bg-soft: #0c0f17;
  --surface: #10141e;
  --surface-2: #151a26;
  --surface-3: #1b2130;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f2f4fa;
  --muted: #9aa2b6;
  --dim: #6b7387;
  --violet: #8b5cf6;
  --violet-soft: rgba(139, 92, 246, 0.14);
  --cyan: #22d3ee;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --blue: #60a5fa;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
  color-scheme: dark;
}

[data-theme='light'] {
  --bg: #f4f5f9;
  --bg-soft: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef0f6;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.16);
  --text: #101828;
  --muted: #5b6478;
  --dim: #8a93a6;
  --violet-soft: rgba(139, 92, 246, 0.1);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

input {
  font: inherit;
}

svg {
  display: block;
}

::selection {
  background: rgba(139, 92, 246, 0.4);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============ 布局 ============ */
.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px 14px 16px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(420px 220px at 20% -10%, rgba(139, 92, 246, 0.14), transparent 70%),
    var(--bg-soft);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: url('assets/icon-64.png') center / cover no-repeat;
  color: #0b0616;
  box-shadow: 0 6px 20px rgba(255, 122, 0, 0.28);
  flex: none;
}

.brand-mark svg {
  display: none;
}

.brand-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-transform: uppercase;
}

.env-pill {
  margin-left: auto;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: var(--green);
  background: rgba(52, 211, 153, 0.08);
  white-space: nowrap;
}

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

.nav-group-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 0 10px;
  margin-bottom: 6px;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link svg {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.9;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.nav-link[aria-current='page'] {
  background: var(--violet-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.22);
}

[data-theme='light'] .nav-link:hover {
  background: rgba(15, 23, 42, 0.045);
}

.nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.14);
  color: var(--amber);
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  color: #0b0616;
  background: linear-gradient(145deg, #a78bfa, #22d3ee);
  flex: none;
}

.user-meta {
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11.5px;
  color: var(--dim);
}

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

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  place-items: center;
}

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

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

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 300px;
  height: 38px;
  padding: 0 10px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--dim);
  transition: border-color 0.15s ease;
}

.search-box:focus-within {
  border-color: rgba(139, 92, 246, 0.5);
}

.search-box svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.search-box input::placeholder {
  color: var(--dim);
}

.search-box kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--dim);
  background: var(--surface-2);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease;
  position: relative;
}

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

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.dot-badge {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--surface);
}

.theme-toggle .icon-sun,
[data-theme='light'] .theme-toggle .icon-moon {
  display: none;
}

[data-theme='light'] .theme-toggle .icon-sun {
  display: block;
}

/* ============ 页面 ============ */
.page {
  padding: 26px 28px 52px;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
}

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

.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.page-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

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

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

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #a78bfa, #8b5cf6 55%, #22d3ee);
  color: #0b0616;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #b49dfb, #9469f8 55%, #3adcf4);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

[data-theme='light'] .btn-ghost:hover {
  background: rgba(15, 23, 42, 0.04);
}

/* ============ KPI ============ */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  position: relative;
  padding: 18px 18px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  overflow: hidden;
}

.kpi::after {
  content: '';
  position: absolute;
  inset: -60% 55% 55% -20%;
  background: radial-gradient(closest-side, rgba(139, 92, 246, 0.16), transparent);
  pointer-events: none;
}

.kpi-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

.kpi-label svg {
  width: 16px;
  height: 16px;
  color: var(--dim);
}

.kpi-value {
  margin-top: 10px;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--dim);
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  color: var(--green);
}

.delta.down {
  color: var(--red);
}

.delta svg {
  width: 12px;
  height: 12px;
}

.spark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 74px;
  height: 28px;
  opacity: 0.9;
}

/* ============ 卡片 / 网格 ============ */
.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(290px, 0.85fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

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

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

.card-title {
  font-size: 14.5px;
  font-weight: 600;
}

.card-sub {
  color: var(--dim);
  font-size: 12px;
  margin-top: 2px;
}

.card-body {
  padding: 18px;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  gap: 2px;
}

.seg button {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--dim);
}

.seg button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}

.legend .ok i {
  background: var(--violet);
}

.legend .alt i {
  background: var(--cyan);
}

/* 图表 */
.chart-wrap {
  padding: 8px 6px 0;
}

.chart-wrap svg {
  width: 100%;
  height: auto;
}

/* 系统状态 */
.status-list {
  display: flex;
  flex-direction: column;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

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

.status-left {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

.status-dot.warn {
  background: var(--amber);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.status-val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

/* 待办 */
.todo {
  display: flex;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.todo:last-child {
  border-bottom: 0;
}

.todo-icon {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(251, 191, 36, 0.1);
  color: var(--amber);
}

.todo-icon.red {
  background: rgba(251, 113, 133, 0.1);
  color: var(--red);
}

.todo-icon svg {
  width: 15px;
  height: 15px;
}

.todo h4 {
  margin: 0;
  font-size: 12.8px;
  font-weight: 550;
}

.todo p {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 11.8px;
}

/* ============ 表格 ============ */
.table-card {
  margin-top: 14px;
}

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

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

thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--dim);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface-2);
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: middle;
  white-space: nowrap;
}

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

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

[data-theme='light'] tbody tr:hover td {
  background: rgba(15, 23, 42, 0.025);
}

td strong,
td .strong {
  color: var(--text);
  font-weight: 550;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 550;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.pill.ok {
  color: var(--green);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.2);
}

.pill.warn {
  color: var(--amber);
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}

.pill.bad {
  color: var(--red);
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.2);
}

.pill.info {
  color: var(--blue);
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.2);
}

.pill.neutral {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--line);
}

.app-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.app-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 650;
  color: #fff;
  flex: none;
}

.app-icon.violet {
  background: linear-gradient(145deg, #8b5cf6, #6d28d9);
}

.app-icon.cyan {
  background: linear-gradient(145deg, #22d3ee, #0891b2);
}

.app-icon.pink {
  background: linear-gradient(145deg, #f472b6, #be185d);
}

.check {
  width: 15px;
  height: 15px;
  accent-color: var(--violet);
  cursor: pointer;
}

.row-actions {
  display: flex;
  gap: 4px;
}

.mini-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--dim);
  border: 1px solid transparent;
}

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

.mini-btn svg {
  width: 15px;
  height: 15px;
}

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
  flex-wrap: wrap;
}

.pager {
  display: flex;
  gap: 4px;
}

.pager button {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.pager button.active {
  background: var(--violet-soft);
  border-color: rgba(139, 92, 246, 0.35);
  color: var(--text);
}

.pager button:hover {
  border-color: var(--line-strong);
}

/* ============ 应用页 ============ */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-mini {
  padding: 14px 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-mini .icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--violet-soft);
  color: #a78bfa;
  flex: none;
}

.stat-mini .icon-wrap.cyan {
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
}

.stat-mini .icon-wrap.green {
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
}

.stat-mini .icon-wrap.amber {
  background: rgba(251, 191, 36, 0.1);
  color: var(--amber);
}

.stat-mini svg {
  width: 18px;
  height: 18px;
}

.stat-mini .label {
  font-size: 11.8px;
  color: var(--dim);
}

.stat-mini .value {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

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

.app-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-align: left;
}

.app-card:hover {
  border-color: var(--line-strong);
}

.app-card.selected {
  border-color: rgba(139, 92, 246, 0.45);
  background:
    radial-gradient(260px 120px at 0% 0%, rgba(139, 92, 246, 0.14), transparent 70%),
    var(--surface);
}

.app-card .info {
  min-width: 0;
  flex: 1;
}

.app-card .name {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-card .meta {
  font-size: 11.8px;
  color: var(--dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-card .icon-big {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

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

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.filter-tabs {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.filter-tabs button {
  padding: 6px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.filter-tabs button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.filter-tabs button.active {
  background: var(--violet-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.25);
}

.filter-tabs .count {
  font-size: 10.5px;
  color: var(--dim);
  margin-left: 4px;
}

.toolbar-search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--dim);
  min-width: 200px;
}

.toolbar-search svg {
  width: 14px;
  height: 14px;
}

.toolbar-search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  width: 100%;
}

.toolbar-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.app-key-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.key-field {
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.key-field .label {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--mono);
}

.key-field .val {
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.copy-btn {
  color: var(--dim);
  display: grid;
  place-items: center;
}

.copy-btn:hover {
  color: var(--cyan);
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

/* ============ 提示 ============ */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .kpis,
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .search-box {
    width: 220px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
  }

  .menu-btn {
    display: grid;
  }

  .topbar {
    padding: 12px 16px;
  }

  .page {
    padding: 20px 16px 44px;
  }

  .search-box {
    display: none;
  }

  .crumb {
    font-size: 12.5px;
  }

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

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

@media (max-width: 620px) {
  .kpis,
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi {
    padding: 14px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .kpi-foot {
    font-size: 11px;
    gap: 5px;
  }

  .spark {
    display: none;
  }

  .stat-mini {
    padding: 12px;
    gap: 9px;
  }

  .stat-mini .value {
    font-size: 16px;
  }

  .stat-mini .label {
    font-size: 11px;
  }

  .page-title {
    font-size: 20px;
  }

  .topbar-right .icon-btn:not(.theme-toggle) {
    display: none;
  }

  .table-scroll table {
    min-width: 760px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
