/* ================= TG Hub 设计系统 ================= */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --line: #eaecf0;
  --line-strong: #dfe2e8;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;

  --accent: #1e96d6;
  --accent-strong: #0b72aa;
  --accent-hover: #1a86bf;
  --accent-tint: #eff8fe;
  --accent-ring: rgba(30, 150, 214, .16);

  --ok: #067647;    --ok-bg: #ecfdf3;    --ok-line: #abefc6;
  --warn: #b54708;  --warn-bg: #fffaeb;  --warn-line: #fedf89;
  --err: #b42318;   --err-bg: #fef3f2;   --err-line: #fecdca;

  --radius: 12px;
  --radius-sm: 7px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-hover: 0 2px 6px rgba(16, 24, 40, .08);
  --shadow-pop: 0 24px 64px rgba(16, 24, 40, .18);
  --shadow-toast: 0 10px 28px rgba(16, 24, 40, .13);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(30, 150, 214, .18); }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: inline-block; vertical-align: middle; flex: 0 0 auto; }

/* ================= 布局骨架 ================= */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px 12px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
  margin-bottom: 8px;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(150deg, #2aa6e0, #1479b5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(20, 121, 181, .28);
}
.brand-mark svg { width: 17px; height: 17px; }
.brand-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .01em;
  color: var(--text);
}

#nav { flex: 1; }
.nav-group {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: .1em;
  padding: 14px 10px 6px;
  user-select: none;
}
.nav-group:first-child { padding-top: 0; }

#nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 450;
  position: relative;
  transition: background .14s, color .14s;
}
#nav a svg { width: 17px; height: 17px; color: var(--faint); transition: color .14s; }
#nav a:hover { background: #f4f5f7; color: var(--text); }
#nav a:hover svg { color: var(--text-2); }
#nav a.active {
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-weight: 600;
}
#nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
#nav a.active svg { color: var(--accent-strong); }

.side-foot {
  margin-top: 10px;
  padding: 12px 10px 0;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.ver-chip {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

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

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -.02em;
}
.topbar-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  font-size: 12.5px;
  color: var(--text-2);
}
.user-chip .avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-size: 11.5px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#view { padding: 26px 28px 64px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ================= 卡片 ================= */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}
.card > h2 {
  font-size: 15px;
  font-weight: 660;
  color: var(--text);
  margin: -20px -20px 16px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--line);
  letter-spacing: -.01em;
}
.card .hint { color: var(--muted); font-size: 12.5px; margin: -4px 0 16px; line-height: 1.75; }
.card > label.field { max-width: 460px; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: -20px -20px 16px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.section-title h2 { margin: 0; font-size: 15px; font-weight: 660; letter-spacing: -.01em; }
.section-title .mono { color: var(--muted); font-size: 12px; }

/* ================= 网格与统计卡 ================= */
.grid { display: grid; gap: 16px; align-items: stretch; }
.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: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-card);
  transition: border-color .16s, box-shadow .16s;
}
.stat:hover { border-color: var(--line-strong); box-shadow: var(--shadow-hover); }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .value {
  font-size: 28px;
  font-weight: 680;
  margin-top: 10px;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--text);
}
.stat .sub { color: var(--faint); font-size: 12px; margin-top: 6px; line-height: 1.5; }
.stat-ic {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--accent-tint);
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.stat-ic svg { width: 16px; height: 16px; }
.stat-ic.green { background: var(--ok-bg); color: var(--ok); }
.stat-ic.amber { background: var(--warn-bg); color: var(--warn); }
.stat-ic.violet { background: #f2f0fe; color: #6941c6; }

/* 快速上手步骤 */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 10px 0 10px 34px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 12px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--accent-tint);
  border: 1px solid #cfe6f5;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.steps li + li { border-top: 1px solid var(--line); }
/* 撑满卡片高度的表格（用于概览任务列表，空状态垂直居中） */
.card.fill { display: flex; flex-direction: column; }
.card.fill > table { flex: 1 1 auto; }

/* ================= 表格 ================= */
table { width: 100%; border-collapse: collapse; }
/* 卡片内表格贴边铺满，表头随宽度拉伸 */
.card > table {
  width: calc(100% + 40px);
  margin-left: -20px;
  margin-right: -20px;
}
.card > table:last-child { margin-bottom: -20px; }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 550;
  font-size: 11.5px;
  letter-spacing: .02em;
  padding: 9px 10px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-2);
  vertical-align: middle;
}
td strong { color: var(--text); font-weight: 600; }
td:last-child { white-space: nowrap; }
td .actions { flex-wrap: nowrap; }
.card > table th:first-child,
.card > table td:first-child { padding-left: 20px; }
.card > table th:last-child,
.card > table td:last-child { padding-right: 20px; }
.card > table td:first-child strong {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 操作列固定在右侧，横向滚动时始终可见 */
.card > table th:last-child,
.card > table td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--panel);
  box-shadow: -1px 0 0 var(--line), -14px 0 14px -14px rgba(16, 24, 40, .16);
}
.card > table th:last-child { background: var(--panel); z-index: 2; }
.card > table tbody tr:hover td:last-child { background: #f8fafc; }
.card::-webkit-scrollbar { height: 8px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8fafc; }
tr:last-child td { border-bottom: none; }
td .mono, .mono {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ================= 徽标 ================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.55;
  background: #f2f4f7;
  color: var(--muted);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
}
.badge.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.badge.info { color: var(--accent-strong); background: var(--accent-tint); border-color: #c8e8f8; }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.badge.err { color: var(--err); background: var(--err-bg); border-color: var(--err-line); }
label.badge { cursor: pointer; user-select: none; }
label.badge::before { display: none; }
label.badge:hover { border-color: var(--line-strong); background: #fff; }
label.badge input { margin: 0 0 0 2px; }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text-2);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  transition: background .13s, border-color .13s, color .13s, box-shadow .13s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn svg { width: 15px; height: 15px; opacity: .85; }
.btn:hover { background: var(--panel-soft); border-color: #cfd5dd; color: var(--text); }
.btn:active { background: #f2f3f5; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(20, 121, 181, .28);
}
.btn.primary svg { opacity: .95; }
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(20, 121, 181, .3);
  color: #fff;
}
.btn.primary:active { background: var(--accent-strong); box-shadow: none; }
.btn.danger { color: var(--err); border-color: var(--err-line); background: var(--panel); }
.btn.danger:hover { background: var(--err-bg); border-color: #f2b3ad; color: var(--err); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #f2f4f7; border-color: transparent; color: var(--text); }
.btn.small { height: 28px; padding: 0 7px; font-size: 11.5px; border-radius: 6px; }
td .actions { gap: 5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }

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

/* ================= 表单 ================= */
input, select, textarea {
  width: 100%;
  height: 34px;
  background: #fcfcfd;
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0 11px;
  font-size: 13px;
  outline: none;
  transition: border-color .13s, box-shadow .13s, background .13s;
}
textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 96px; line-height: 1.65; }
input:hover, select:hover, textarea:hover { border-color: #cfd5dd; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: #fff;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"] { width: auto; height: auto; accent-color: var(--accent); }
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}

label.field { display: block; margin-bottom: 15px; }
label.field > span {
  display: block;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 6px;
}

/* 表单双列：宽屏时充分利用卡片宽度 */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  max-width: 760px;
}
.field-grid > * { margin-bottom: 15px; }

.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 130px; }
.row .shrink { flex: 0 0 auto; min-width: 0; }

/* ================= 进度条 ================= */
.progress {
  height: 5px;
  border-radius: 4px;
  background: #eef1f4;
  overflow: hidden;
  margin-top: 7px;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width .3s ease;
}

/* ================= 资源库网格 ================= */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
.media-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 12px;
  transition: box-shadow .15s, border-color .15s;
}
.media-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-hover); }
.media-item .thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-soft);
  color: var(--faint);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.media-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item .meta { padding: 10px 12px; }
.media-item .meta .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; color: var(--text); }
.media-item .meta .sub { color: var(--faint); margin-top: 3px; font-size: 11px; }

/* ================= 空状态 / 分页 ================= */
.empty {
  text-align: center;
  color: var(--faint);
  padding: 34px 16px;
  font-size: 13px;
  line-height: 1.6;
}
.empty::before {
  content: "";
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background-color: #f2f4f7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 16 12 14 15 10 15 8 12 2 12'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px;
}

.pager {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

/* ================= 弹窗 ================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fade-in .16s ease;
}
.modal {
  background: var(--panel);
  border-radius: 14px;
  width: min(640px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-pop);
  animation: pop-in .18s ease;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--panel-soft);
  border-radius: 0 0 14px 14px;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--faint);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
}
.icon-btn:hover { color: var(--text); background: #f2f4f7; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* ================= 轻提示 ================= */
#toastRoot {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 200;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
  max-width: 360px;
  box-shadow: var(--shadow-toast);
  animation: toast-in .2s ease;
}
.toast.err { border-left-color: var(--err); }
.toast.ok { border-left-color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ================= 登录 ================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 460px at 50% -18%, #e8f1fa 0%, rgba(232, 241, 250, 0) 62%),
    radial-gradient(760px 420px at 92% 108%, #e9f5fb 0%, rgba(233, 245, 251, 0) 60%),
    var(--bg);
}
.login-wrap { width: min(380px, 100%); }
.login-copy {
  text-align: center;
  color: var(--faint);
  font-size: 11.5px;
  margin-top: 18px;
  letter-spacing: .02em;
}

.login-box {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 30px 26px;
  box-shadow: 0 20px 56px rgba(16, 24, 40, .09), 0 1px 2px rgba(16, 24, 40, .04);
  animation: pop-in .2s ease;
}
.login-brand {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(150deg, #2aa6e0, #1479b5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(20, 121, 181, .26);
}
.login-brand svg { width: 22px; height: 22px; }
.login-box h2 { margin: 0 0 5px; font-size: 19px; font-weight: 680; letter-spacing: -.01em; }
.login-box p { color: var(--muted); font-size: 12.5px; margin: 0 0 22px; line-height: 1.65; }
.login-box .field { margin-bottom: 13px; }
.login-box input { height: 38px; }

.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; letter-spacing: .12em; }
.captcha-img {
  flex: 0 0 auto;
  width: 112px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .13s;
}
.captcha-img:hover { border-color: var(--accent); }
.captcha-img svg { display: block; }
.captcha-loading { font-size: 11.5px; color: var(--faint); }

.login-err {
  color: var(--err);
  font-size: 12.5px;
  line-height: 1.5;
  min-height: 18px;
  margin-bottom: 10px;
}
.login-foot {
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.7;
}
.login-submit { width: 100%; height: 38px; font-size: 14px; }

/* ================= 日志 ================= */
.log-box {
  margin: 0;
  padding: 16px 18px;
  background: #0d1117;
  border: 1px solid #1b2432;
  border-radius: var(--radius-sm);
  max-height: 380px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.75;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ================= 滚动条 ================= */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3d8de; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #bcc4cd; background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ================= 响应式 ================= */
@media (max-width: 1180px) {
  .card > table { white-space: nowrap; }
}

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

@media (max-width: 900px) {
  #app { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .brand { padding: 0 10px 0 0; margin: 0; }
  .brand-name { display: none; }
  #nav { display: flex; align-items: center; gap: 2px; }
  .nav-group { display: none; }
  #nav a { margin: 0; white-space: nowrap; height: 34px; }
  #nav a.active::before { display: none; }
  .side-foot { display: none; }
  .topbar { position: static; min-height: 60px; padding: 10px 14px; }
  .topbar-title h1 { font-size: 17px; }
  .topbar-title p { display: none; }
  .user-chip { display: none; }
  #view { padding: 16px 14px 44px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .card > h2, .card > .section-title {
    margin: -16px -16px 14px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .card > h2 { padding-top: 15px; }
  .card > table { width: calc(100% + 32px); margin-left: -16px; margin-right: -16px; }
  .card > table:last-child { margin-bottom: -16px; }
  .card > table th:first-child, .card > table td:first-child { padding-left: 16px; }
  .card > table th:last-child, .card > table td:last-child { padding-right: 16px; }
  .field-grid { grid-template-columns: 1fr; max-width: none; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .stat .value { font-size: 24px; }
}
