:root,
[data-theme="light"] {
  color-scheme: light;
  --primary: #4f6ef7;
  --primary-dark: #3b57d9;
  --bg: #f0f2f8;
  --card-bg: #ffffff;
  --border: #e2e6f0;
  --text: #1a1f36;
  --text-muted: #6b7280;
  --required: #ef4444;
  --success: #10b981;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --on-primary: #ffffff;

  --input-bg: #ffffff;
  --surface-muted: #f8f9fc;
  --surface-hover: #f3f4f8;
  --surface-accent: #f8f9ff;
  --table-header-bg: #f8f9fc;
  --table-row-hover: #fafbff;
  --diagram-bg: #fafbff;
  --upload-hover-bg: #f8f9ff;
  --btn-secondary-hover-border: #c5cad8;
  --history-card-active-bg: #f8f9ff;
  --danger-hover-bg: #fee2e2;
  --danger-hover-border: #fca5a5;
  --avatar-bg: #f3f4f8;
  --btn-mini-bg: #ffffff;
  --priority-low: #6b7280;
  --modal-overlay: rgba(15, 23, 42, 0.45);

  --sidebar-bg: #ffffff;
  --sidebar-border: #e8eaf0;
  --sidebar-text: #6b7280;
  --sidebar-text-hover: #1a1f36;
  --sidebar-hover-bg: #f3f4f8;
  --sidebar-logo-name: #1a1f36;
  --sidebar-divider: rgba(0,0,0,0.06);

  --explorer-bg: #ffffff;
  --explorer-surface: #f8f9fc;
  --explorer-border: #e2e6f0;
  --explorer-text: #1a1f36;
  --explorer-text-muted: #6b7280;
  --explorer-title: #1a1f36;
  --explorer-input-bg: #ffffff;
  --explorer-input-border: #d1d5db;
  --explorer-btn-bg: #ffffff;
  --explorer-btn-border: #d1d5db;
  --explorer-btn-hover: #f3f4f8;
  --explorer-primary-bg: #4f6ef7;
  --explorer-primary-border: #3b57d9;
  --explorer-row-hover: #f3f4f8;
  --explorer-row-selected: #e8eeff;
  --explorer-row-multi: #d6eaff;
  --explorer-twist: #9ca3af;
  --explorer-success: #10b981;
  --explorer-error: #ef4444;
  --explorer-ctx-bg: #ffffff;
  --explorer-ctx-border: #e2e6f0;
  --explorer-ctx-text: #1a1f36;
  --explorer-ctx-hover: #e8eeff;
  --explorer-ctx-danger-hover: #fee2e2;
  --explorer-ctx-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --primary: #6b8aff;
  --primary-dark: #4f6ef7;
  --bg: #0f1117;
  --card-bg: #1a1e2a;
  --border: #2d3348;
  --text: #e8eaf0;
  --text-muted: #9ca3af;
  --shadow: 0 2px 16px rgba(0,0,0,0.35);
  --on-primary: #ffffff;

  --input-bg: #252a38;
  --surface-muted: #252a38;
  --surface-hover: #2a3042;
  --surface-accent: rgba(107, 138, 255, 0.12);
  --table-header-bg: #252a38;
  --table-row-hover: #2a3042;
  --diagram-bg: #252a38;
  --upload-hover-bg: rgba(107, 138, 255, 0.1);
  --btn-secondary-hover-border: #3d4560;
  --history-card-active-bg: rgba(107, 138, 255, 0.14);
  --danger-hover-bg: rgba(239, 68, 68, 0.15);
  --danger-hover-border: rgba(239, 68, 68, 0.45);
  --avatar-bg: #252a38;
  --btn-mini-bg: #252a38;
  --priority-low: #9ca3af;
  --modal-overlay: rgba(0, 0, 0, 0.65);

  --sidebar-bg: #141824;
  --sidebar-border: #2d3348;
  --sidebar-text: #9ca3af;
  --sidebar-text-hover: #f3f4f6;
  --sidebar-hover-bg: rgba(255,255,255,0.06);
  --sidebar-logo-name: #f3f4f6;
  --sidebar-divider: rgba(255,255,255,0.08);

  --explorer-bg: #1a1e2a;
  --explorer-surface: #252a38;
  --explorer-border: #2d3348;
  --explorer-text: #e8eaf0;
  --explorer-text-muted: #9ca3af;
  --explorer-title: #f3f4f6;
  --explorer-input-bg: #252a38;
  --explorer-input-border: #3d4560;
  --explorer-btn-bg: #252a38;
  --explorer-btn-border: #3d4560;
  --explorer-btn-hover: #2a3042;
  --explorer-primary-bg: #4f6ef7;
  --explorer-primary-border: #3b57d9;
  --explorer-row-hover: #2a3042;
  --explorer-row-selected: rgba(79, 110, 247, 0.28);
  --explorer-row-multi: rgba(79, 110, 247, 0.38);
  --explorer-twist: #9ca3af;
  --explorer-success: #34d399;
  --explorer-error: #f87171;
  --explorer-ctx-bg: #252a38;
  --explorer-ctx-border: #3d4560;
  --explorer-ctx-text: #e8eaf0;
  --explorer-ctx-hover: rgba(79, 110, 247, 0.22);
  --explorer-ctx-danger-hover: rgba(239, 68, 68, 0.2);
  --explorer-ctx-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.icon, .lucide { width: 1em; height: 1em; stroke-width: 2; flex-shrink: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* 侧边栏 */
.sidebar {
  width: 240px;
  height: 100vh;
  max-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text-hover);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--sidebar-border);
  overflow: hidden;
}

.sidebar-header { padding: 20px 16px 16px; border-bottom: 1px solid var(--sidebar-divider); flex-shrink: 0; }
.logo {
  display: flex; align-items: center; gap: 10px;
}
.logo-mark {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #4f6ef7 55%, #38bdf8 100%);
  box-shadow: 0 4px 14px rgba(79, 110, 247, 0.4);
}
.logo-mark .icon { width: 20px; height: 20px; color: #fff; stroke-width: 2.2; }
.logo-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.logo-name-row { display: flex; align-items: center; gap: 6px; }
.logo-name { font-size: 16px; font-weight: 700; letter-spacing: 0.3px; line-height: 1.2; color: var(--sidebar-logo-name); }
.logo-badge {
  font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(251,191,36,0.25), rgba(245,158,11,0.35));
  color: #fcd34d; letter-spacing: 0.6px; line-height: 1;
  border: 1px solid rgba(251,191,36,0.35);
}
.logo-sub { font-size: 11px; color: var(--sidebar-text); line-height: 1.3; }

.sidebar-nav { padding: 12px 8px; flex-shrink: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 14px; border: none; border-radius: 8px;
  background: transparent; color: var(--sidebar-text); cursor: pointer;
  font-size: 14px; text-align: left; transition: all 0.2s;
}
.nav-item:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-text-hover); }
.nav-item.active { background: var(--primary); color: var(--on-primary); }
.nav-icon { display: flex; align-items: center; flex-shrink: 0; }
.nav-icon .icon { width: 18px; height: 18px; }

.task-history {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px;
}
.history-title { font-size: 11px; text-transform: uppercase; color: var(--sidebar-text); padding: 0 14px 8px; letter-spacing: 0.5px; }
.history-item {
  display: block; width: 100%; padding: 8px 14px; border: none; border-radius: 6px;
  cursor: pointer; font-size: 13px; text-align: left; font-family: inherit;
  color: var(--sidebar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: transparent; transition: background 0.2s, color 0.2s;
}
.history-item:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-text-hover); }
.history-item.active { background: var(--primary); color: var(--on-primary); }
.history-item.active .time { opacity: 0.85; }
.history-item .time { font-size: 11px; opacity: 0.6; display: block; margin-top: 2px; }
.history-item-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  min-width: 0;
}
.history-item-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.task-status {
  flex-shrink: 0; font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 600;
}
.task-status-running { background: rgba(79, 110, 247, 0.2); color: #6b8aff; }
.task-status-completed { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.task-status-failed { background: rgba(239, 68, 68, 0.15); color: var(--required); }
[data-theme="dark"] .task-status-running { color: #93b4ff; }
.history-empty { padding: 8px 14px; font-size: 13px; color: var(--sidebar-text); }

.sidebar-footer {
  padding: 12px 8px 16px;
  border-top: 1px solid var(--sidebar-divider);
  flex-shrink: 0;
  margin-top: auto;
  background: var(--sidebar-bg);
}
.sidebar-footer-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.sidebar-footer-actions:last-child { margin-bottom: 0; }
.footer-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  flex: 1; min-width: 0; padding: 10px 8px;
  border: 1px solid var(--sidebar-border);
  border-radius: 8px; background: var(--sidebar-hover-bg);
  color: var(--sidebar-text); cursor: pointer; font-size: 12px;
  font-family: inherit; transition: all 0.2s;
}
.footer-action-btn:hover { color: var(--sidebar-text-hover); border-color: var(--primary); }
.footer-action-btn-full { flex: 1 1 100%; width: 100%; }
.footer-action-icon { display: flex; align-items: center; flex-shrink: 0; }
.footer-action-icon .icon { width: 16px; height: 16px; }

/* 弹窗 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--modal-overlay);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  width: 100%; max-width: 440px;
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  border: 1px solid var(--border);
}
.modal-card-wide { max-width: 560px; }
.modal-table-wrap { overflow-x: auto; margin-top: 8px; }
.modal-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.modal-table th, .modal-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left;
}
.modal-table th { background: var(--table-header-bg); font-weight: 600; white-space: nowrap; }
.modal-table tr:last-child td { border-bottom: none; }
.health-ok { color: var(--success); font-weight: 600; }
.health-fail { color: var(--required); font-weight: 600; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px; border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 600;
}
.modal-header h3 .icon { width: 18px; height: 18px; color: var(--primary); }
.modal-close {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none; border-radius: 6px;
  background: transparent; color: var(--text-muted); cursor: pointer;
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); }
.modal-close .icon { width: 18px; height: 18px; }
.modal-body { padding: 16px 20px; }
.modal-hint { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }
.modal-hint code { font-size: 12px; background: var(--surface-muted); padding: 1px 5px; border-radius: 4px; }
.api-key-status { font-size: 13px; margin-bottom: 14px; color: var(--text); }
.api-key-status.configured { color: var(--success); }
.api-key-status.empty { color: var(--text-muted); }
.modal-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.modal-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; font-family: inherit;
  background: var(--input-bg); color: var(--text);
}
.modal-input:focus { outline: none; border-color: var(--primary); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 20px 18px; border-top: 1px solid var(--border);
}

/* 主内容 */
.main-content { flex: 1; min-height: 0; overflow-y: auto; padding: 32px 40px; }
.view { display: none; }
.view.active { display: block; }

.page-header { margin-bottom: 24px; }
.page-header-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.page-header h1 { font-size: 24px; font-weight: 700; line-height: 1.4; margin: 0; }
.page-header h2 { font-size: 22px; }
.app-version-badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--primary); background: var(--surface-accent);
  border: 1px solid rgba(79, 110, 247, 0.25);
}
.subtitle { color: var(--text-muted); margin-top: 8px; font-size: 15px; }

/* 卡片 */
.intro-card, .form-card, .result-module {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.intro-card p { color: var(--text-muted); line-height: 1.8; margin-bottom: 12px; }
.intro-card h3 { font-size: 16px; margin: 20px 0 12px; }
.intro-list { list-style: none; padding: 0; color: var(--text-muted); }
.intro-list li {
  display: flex; align-items: flex-start; gap: 10px;
  line-height: 1.7; margin-bottom: 10px;
}
.intro-list .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--primary); }
.intro-card ul:not(.intro-list) { padding-left: 20px; color: var(--text-muted); line-height: 2; }
.intro-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; margin-bottom: 16px;
}
.intro-section-title .icon { width: 18px; height: 18px; color: var(--primary); }
.author-card {
  display: flex; gap: 20px; align-items: flex-start;
}
.author-avatar {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: 14px;
}
.author-avatar-img {
  padding: 0; overflow: hidden;
  background: var(--avatar-bg); border: 2px solid var(--border);
}
.author-avatar-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.author-contact a { color: var(--primary); text-decoration: none; }
.author-contact a:hover { text-decoration: underline; }
.author-body { flex: 1; min-width: 0; }
.author-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.author-role { font-size: 13px; color: var(--primary); font-weight: 500; margin-bottom: 10px; }
.author-motto {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--text-muted); font-style: italic;
  line-height: 1.7; margin-bottom: 12px; padding: 10px 12px;
  background: var(--surface-muted); border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
}
.author-motto .icon { width: 16px; height: 16px; color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.author-bio { font-size: 14px; color: var(--text-muted); line-height: 1.8; margin-bottom: 14px; white-space: pre-line; }
.author-contact { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.author-contact li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text);
}
.author-contact .icon { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
@media (max-width: 600px) {
  .author-card { flex-direction: column; align-items: center; text-align: center; }
  .author-contact { align-items: center; }
}
.result-module { display: none; }
.result-module.active { display: block; }

/* 表单 */
.form-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.tab-btn {
  padding: 10px 20px; border: none; background: transparent; cursor: pointer;
  font-size: 14px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.model-select { margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.model-select label { font-size: 14px; font-weight: 500; }
.model-select select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; min-width: 240px;
  background: var(--input-bg); color: var(--text);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.required { color: var(--required); margin-left: 2px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; transition: border-color 0.2s;
  background: var(--input-bg); color: var(--text);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--primary);
}

.btn-primary {
  background: var(--primary); color: var(--on-primary); border: none; padding: 12px 32px;
  border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--input-bg); color: var(--text); border: 1px solid var(--border);
  padding: 12px 24px; border-radius: 8px; font-size: 15px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--btn-secondary-hover-border); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.form-actions { display: flex; gap: 12px; align-items: center; }

/* 上传区 */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 48px;
  text-align: center; cursor: pointer; transition: border-color 0.2s; margin-bottom: 16px;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--upload-hover-bg); }
.upload-icon { display: flex; justify-content: center; margin-bottom: 12px; }
.upload-icon .icon { width: 48px; height: 48px; color: var(--primary); opacity: 0.65; }
.upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.upload-example-row { display: flex; justify-content: center; margin: -8px 0 16px; }
.upload-example-row .btn-sm { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 14px; }
.upload-example-row .icon { width: 16px; height: 16px; }
.file-name { margin-top: 12px; font-weight: 500; color: var(--primary); }

/* 加载 */
#viewLoading.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  height: 100%;
}
.loading-container {
  text-align: center;
  padding: 40px 24px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.spinner {
  width: 56px; height: 56px; border: 4px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-task-title {
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  min-height: 1.2em;
}
.loading-task-model {
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 8px;
  min-height: 1.2em;
}
.loading-task-hint {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

/* 结果 */
.result-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.result-title-wrap { flex: 1; min-width: 180px; }
.result-title-wrap h2 { font-size: 20px; }
.result-meta { color: var(--text-muted); font-size: 13px; display: block; margin-top: 4px; }

.result-tabs { display: flex; gap: 8px; flex-shrink: 0; }
.result-tab {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card-bg); cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-muted); transition: all 0.2s;
}
.result-tab:hover { border-color: var(--primary); color: var(--primary); }
.result-tab.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* 结果页 - 项目结构模块撑满高度 */
#viewResult.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px);
}
#viewResult .result-module[data-module="structure"].active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}
#viewResult .result-module[data-module="structure"] .structure-layout {
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.result-module h3,
.module-title { font-size: 17px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.module-title,
.structure-panel-title {
  display: flex; align-items: center; gap: 8px;
}
.module-title .icon,
.structure-panel-title .icon { width: 20px; height: 20px; color: var(--primary); }
.module-content.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .module-content.two-col { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: var(--table-header-bg); padding: 10px 12px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); white-space: nowrap; color: var(--text); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.5; color: var(--text); }
tr:hover td { background: var(--table-row-hover); }

.priority-high { color: #ef4444; font-weight: 600; }
.priority-mid { color: #f59e0b; }
.priority-low { color: var(--priority-low); }

.diagram-wrap h4, .tree-wrap h4 { font-size: 14px; color: var(--text-muted); }
.tree-wrap h4 { margin: 0 0 12px; }
.diagram-wrap h4 { margin: 0; }
.diagram-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.btn-diagram-fs {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-muted); color: var(--text-muted);
  cursor: pointer; flex-shrink: 0; transition: all 0.2s;
}
.btn-diagram-fs .icon { width: 16px; height: 16px; }
.btn-diagram-fs:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.btn-diagram-fs:disabled { opacity: 0.4; cursor: not-allowed; }
.mermaid { background: var(--diagram-bg); border-radius: 8px; padding: 16px; overflow: auto; min-height: 200px; border: 1px solid var(--border); }
.mermaid svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }

/* 图表全屏查看 */
.diagram-fs-overlay {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; flex-direction: column;
  background: var(--diagram-fs-bg, var(--bg));
}
.diagram-fs-overlay[hidden] { display: none; }
.diagram-fs-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg); flex-shrink: 0;
}
.diagram-fs-title {
  font-size: 16px; font-weight: 600; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.diagram-fs-controls {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
.diagram-fs-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-muted); color: var(--text);
  font-size: 13px; font-family: inherit; cursor: pointer; transition: all 0.2s;
}
.diagram-fs-btn .icon { width: 16px; height: 16px; }
.diagram-fs-btn:hover { border-color: var(--primary); color: var(--primary); }
.diagram-fs-btn-primary {
  background: var(--primary); color: var(--on-primary); border-color: var(--primary);
}
.diagram-fs-btn-primary:hover { opacity: 0.92; color: var(--on-primary); }
.diagram-fs-zoom {
  min-width: 52px; text-align: center; font-size: 13px;
  font-weight: 600; color: var(--text-muted);
}
.diagram-fs-viewport {
  flex: 1; min-height: 0; overflow: hidden;
  position: relative; cursor: grab; touch-action: none;
  background: var(--diagram-bg);
}
.diagram-fs-viewport.dragging { cursor: grabbing; }
.diagram-fs-stage {
  position: absolute; top: 0; left: 0;
}
.diagram-fs-stage svg {
  display: block;
  max-width: none !important;
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
}
.diagram-fs-hint {
  margin: 0; padding: 8px 20px 12px;
  text-align: center; font-size: 12px; color: var(--text-muted);
  background: var(--card-bg); border-top: 1px solid var(--border); flex-shrink: 0;
}
@media (max-width: 640px) {
  .diagram-fs-toolbar { flex-direction: column; align-items: stretch; }
  .diagram-fs-controls { justify-content: center; }
  .diagram-fs-btn span { display: none; }
}

.hw-summary, .structure-summary { color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; font-size: 14px; }

.hw-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.hw-chart-card {
  background: var(--surface-muted); border-radius: 8px; padding: 16px; text-align: center;
  border: 1px solid var(--border);
}
.hw-chart-card h5 { font-size: 14px; margin-bottom: 12px; color: var(--text); }
.hw-chart-card canvas { max-height: 220px; }

/* 项目树 */
.project-tree { font-size: 13px; line-height: 1.8; }
.tree-node { padding-left: 0; }
.tree-item {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 0; min-height: 22px;
}
.tree-item .explorer-icon { flex-shrink: 0; }
.tree-name { font-weight: 500; }
.tree-desc { color: var(--text-muted); font-size: 12px; }

/* 项目结构左右布局 */
.structure-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  min-height: 0;
  flex: 1;
}
@media (max-width: 1000px) {
  .structure-layout { grid-template-columns: 1fr; }
}

.structure-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

.structure-panel-white {
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  overflow-y: auto;
  gap: 16px;
}
.structure-panel-white .tree-wrap,
.structure-panel-white .diagram-wrap {
  flex-shrink: 0;
}

.structure-panel-dark {
  background: transparent;
  min-height: 0;
}
.structure-panel-dark .workspace-sync {
  flex: 1;
  border-radius: var(--radius);
}

.workspace-sync {
  background: var(--explorer-bg);
  border-radius: 8px;
  padding: 0;
  border: 1px solid var(--explorer-border);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--explorer-text);
  font-family: "Segoe UI", "PingFang SC", sans-serif;
}
.sync-header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px 8px; flex-shrink: 0;
  border-bottom: 1px solid var(--explorer-border);
}
.sync-header-left {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0;
}
.sync-title {
  font-size: 13px; font-weight: 700; color: var(--explorer-title);
  white-space: nowrap; flex-shrink: 0;
}
.sync-header .workspace-hint {
  color: var(--explorer-text-muted); font-size: 11px; line-height: 1.4;
}
.workspace-quota-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px 8px;
}
.workspace-quota-track {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--explorer-input-border); overflow: hidden;
}
.workspace-quota-fill {
  height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  transition: width 0.25s ease;
}
.workspace-quota-fill.quota-warn { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.workspace-quota-fill.quota-full { background: #ef4444; }
.workspace-quota-text {
  font-size: 11px; color: var(--explorer-text-muted); white-space: nowrap;
}
.server-folder-list {
  max-height: 320px; overflow-y: auto; margin-top: 8px;
  border: 1px solid var(--explorer-input-border); border-radius: 6px;
}
.server-folder-item {
  display: block; width: 100%; text-align: left; padding: 8px 12px;
  border: none; border-bottom: 1px solid var(--explorer-input-border);
  background: transparent; color: var(--explorer-text); font-size: 13px;
  cursor: pointer;
}
.server-folder-item:last-child { border-bottom: none; }
.server-folder-item:hover { background: var(--explorer-row-hover, rgba(99,102,241,0.12)); }
.server-folder-item.active { background: rgba(99, 102, 241, 0.18); font-weight: 600; }
.sync-time { font-size: 11px; color: var(--explorer-text-muted); font-weight: 400; white-space: nowrap; flex-shrink: 0; }
.sync-status { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.btn-sync-refresh {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--explorer-btn-border); border-radius: 4px;
  background: var(--explorer-btn-bg); color: var(--explorer-text); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-sync-refresh:hover:not(:disabled) { background: var(--explorer-btn-hover); color: var(--explorer-title); }
.btn-sync-refresh:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sync-refresh .icon { width: 14px; height: 14px; }
.btn-sync-refresh.spinning .icon { animation: spin 0.8s linear infinite; }

.explorer-top-bar {
  padding: 8px 12px 10px;
  flex-shrink: 0;
}
.explorer-top-bar .workspace-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.explorer-top-bar .workspace-input {
  flex: 1; min-width: 120px; padding: 6px 10px;
  border: 1px solid var(--explorer-input-border); border-radius: 4px;
  font-size: 12px; background: var(--explorer-input-bg); color: var(--explorer-text);
}
.explorer-top-bar .workspace-input::placeholder { color: var(--explorer-text-muted); }
.explorer-top-bar .write-status { font-size: 12px; color: var(--explorer-success); }
.explorer-top-bar .write-status.error { color: var(--explorer-error); }

.btn-explorer {
  padding: 6px 12px; font-size: 12px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--explorer-btn-border); background: var(--explorer-btn-bg); color: var(--explorer-text);
  white-space: nowrap; transition: all 0.15s;
}
.btn-explorer:hover { background: var(--explorer-btn-hover); border-color: var(--primary); color: var(--explorer-title); }
.btn-explorer.primary {
  background: var(--explorer-primary-bg); border-color: var(--explorer-primary-border); color: var(--on-primary);
}
.btn-explorer.primary:hover { filter: brightness(1.08); }
.btn-explorer:disabled { opacity: 0.45; cursor: not-allowed; }

.sync-toolbar {
  display: flex; gap: 6px; padding: 0 8px 8px;
  border-bottom: 1px solid var(--explorer-border); flex-shrink: 0; flex-wrap: wrap;
}
.sync-toolbar .btn-mini {
  background: var(--explorer-btn-bg); border-color: var(--explorer-btn-border); color: var(--explorer-text);
}
.sync-toolbar .btn-mini:hover { background: var(--explorer-btn-hover); border-color: var(--primary); color: var(--explorer-title); }

.explorer-panel,
.local-folder-tree {
  flex: 1;
  min-height: 0;
  overflow: auto;
  outline: none;
  background: var(--explorer-bg);
}
.explorer-panel .sync-placeholder { color: var(--explorer-text-muted); padding: 32px 16px; font-size: 12px; }

.explorer-tree { padding: 4px 0 8px; }
.explorer-row {
  display: flex; align-items: center; gap: 4px;
  height: 22px; cursor: pointer; user-select: none;
  color: var(--explorer-text); font-size: 13px;
}
.explorer-row:hover { background: var(--explorer-row-hover); }
.explorer-row.selected { background: var(--explorer-row-selected); color: var(--explorer-title); }
.explorer-row.selected:hover { background: var(--explorer-row-selected); }
.explorer-row.multi-selected { background: var(--explorer-row-multi); color: var(--explorer-title); }
.explorer-row.multi-selected:hover { background: var(--explorer-row-multi); }

.explorer-twist {
  width: 16px; height: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: var(--explorer-twist); transition: transform 0.1s;
}
.explorer-twist.open { transform: rotate(90deg); }
.explorer-twist.placeholder { visibility: hidden; }

.explorer-icon {
  width: 16px; height: 16px; flex-shrink: 0;
  background-size: contain; background-repeat: no-repeat; background-position: center;
}
.explorer-icon.folder {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23dcb67a' d='M1 3h5l1 1h8v9H1z'/%3E%3C/svg%3E");
}
.explorer-icon.folder-open {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23dcb67a' d='M1 3h5l1 1h8v2H1zm0 3h14v7H1z'/%3E%3C/svg%3E");
}
.explorer-icon.file {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23858585' d='M3 1h7l3 3v11H3z'/%3E%3Cpath fill='%23ccc' d='M10 1v3h3'/%3E%3C/svg%3E");
}

/* 文件类型图标（彩色标签） */
.explorer-icon.file-type {
  background-image: none;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
  line-height: 1;
  font-family: "Segoe UI", sans-serif;
}
.explorer-icon.file-type::after { content: attr(data-ext); }

.explorer-icon.file-py { background: #3572a5; }
.explorer-icon.file-py::after { content: 'PY'; }
.explorer-icon.file-java { background: #b07219; }
.explorer-icon.file-java::after { content: 'JV'; }
.explorer-icon.file-js { background: #f7df1e; color: #1a1a1a; }
.explorer-icon.file-js::after { content: 'JS'; }
.explorer-icon.file-ts { background: #3178c6; }
.explorer-icon.file-ts::after { content: 'TS'; }
.explorer-icon.file-jsx { background: #61dafb; color: #1a1a1a; }
.explorer-icon.file-jsx::after { content: 'JX'; }
.explorer-icon.file-tsx { background: #3178c6; }
.explorer-icon.file-tsx::after { content: 'TX'; }
.explorer-icon.file-json { background: #cbcb41; color: #1a1a1a; }
.explorer-icon.file-json::after { content: '{}'; }
.explorer-icon.file-html { background: #e44d26; }
.explorer-icon.file-html::after { content: '<>'; }
.explorer-icon.file-css { background: #264de4; }
.explorer-icon.file-css::after { content: '#'; }
.explorer-icon.file-scss { background: #c6538c; }
.explorer-icon.file-scss::after { content: 'SC'; }
.explorer-icon.file-less { background: #1d365d; }
.explorer-icon.file-less::after { content: 'LE'; }
.explorer-icon.file-md { background: #519aba; }
.explorer-icon.file-md::after { content: 'MD'; }
.explorer-icon.file-xml { background: #e37933; }
.explorer-icon.file-xml::after { content: 'XM'; }
.explorer-icon.file-svg { background: #ffb13b; color: #1a1a1a; }
.explorer-icon.file-svg::after { content: 'SV'; }
.explorer-icon.file-yaml { background: #cb171e; }
.explorer-icon.file-yaml::after { content: 'YM'; }
.explorer-icon.file-sql { background: #e38c00; }
.explorer-icon.file-sql::after { content: 'SQ'; }
.explorer-icon.file-go { background: #00add8; }
.explorer-icon.file-go::after { content: 'GO'; }
.explorer-icon.file-rust { background: #dea584; color: #1a1a1a; }
.explorer-icon.file-rust::after { content: 'RS'; }
.explorer-icon.file-c { background: #555555; }
.explorer-icon.file-c::after { content: 'C'; }
.explorer-icon.file-cpp { background: #659ad2; }
.explorer-icon.file-cpp::after { content: 'C+'; }
.explorer-icon.file-cs { background: #68217a; }
.explorer-icon.file-cs::after { content: 'C#'; }
.explorer-icon.file-php { background: #777bb4; }
.explorer-icon.file-php::after { content: 'PH'; }
.explorer-icon.file-ruby { background: #cc342d; }
.explorer-icon.file-ruby::after { content: 'RB'; }
.explorer-icon.file-swift { background: #f05138; }
.explorer-icon.file-swift::after { content: 'SW'; }
.explorer-icon.file-kt { background: #a97bff; }
.explorer-icon.file-kt::after { content: 'KT'; }
.explorer-icon.file-shell { background: #4eaa25; }
.explorer-icon.file-shell::after { content: 'SH'; }
.explorer-icon.file-ps { background: #012456; }
.explorer-icon.file-ps::after { content: 'PS'; }
.explorer-icon.file-docker { background: #2496ed; }
.explorer-icon.file-docker::after { content: 'DK'; }
.explorer-icon.file-toml { background: #9c4221; }
.explorer-icon.file-toml::after { content: 'TM'; }
.explorer-icon.file-ini { background: #6d6d6d; }
.explorer-icon.file-ini::after { content: 'IN'; }
.explorer-icon.file-txt { background: #6d6d6d; }
.explorer-icon.file-txt::after { content: 'TX'; }
.explorer-icon.file-pdf { background: #f40f02; }
.explorer-icon.file-pdf::after { content: 'PD'; }
.explorer-icon.file-image { background: #a074c4; }
.explorer-icon.file-image::after { content: 'IG'; }
.explorer-icon.file-zip { background: #e8bf6a; color: #1a1a1a; }
.explorer-icon.file-zip::after { content: 'ZP'; }
.explorer-icon.file-wasm { background: #654ff0; }
.explorer-icon.file-wasm::after { content: 'WA'; }
.explorer-icon.file-vue { background: #41b883; }
.explorer-icon.file-vue::after { content: 'VU'; }
.explorer-icon.file-svelte { background: #ff3e00; }
.explorer-icon.file-svelte::after { content: 'SV'; }
.explorer-icon.file-lua { background: #000080; }
.explorer-icon.file-lua::after { content: 'LU'; }
.explorer-icon.file-r { background: #276dc3; }
.explorer-icon.file-r::after { content: 'R'; }
.explorer-icon.file-scala { background: #dc322f; }
.explorer-icon.file-scala::after { content: 'SC'; }
.explorer-icon.file-dart { background: #0175c2; }
.explorer-icon.file-dart::after { content: 'DT'; }
.explorer-icon.file-elixir { background: #6e4a7e; }
.explorer-icon.file-elixir::after { content: 'EX'; }
.explorer-icon.file-erl { background: #b83939; }
.explorer-icon.file-erl::after { content: 'ER'; }
.explorer-icon.file-clj { background: #63b132; }
.explorer-icon.file-clj::after { content: 'CL'; }
.explorer-icon.file-hs { background: #5e5084; }
.explorer-icon.file-hs::after { content: 'HS'; }
.explorer-icon.file-terraform { background: #844fba; }
.explorer-icon.file-terraform::after { content: 'TF'; }
.explorer-icon.file-proto { background: #4285f4; }
.explorer-icon.file-proto::after { content: 'PB'; }
.explorer-icon.file-graphql { background: #e535ab; }
.explorer-icon.file-graphql::after { content: 'GQ'; }
.explorer-icon.file-git { background: #f05032; }
.explorer-icon.file-git::after { content: 'GI'; }
.explorer-icon.file-env { background: #ecd53f; color: #1a1a1a; }
.explorer-icon.file-env::after { content: 'EN'; }
.explorer-icon.file-make { background: #6d8086; }
.explorer-icon.file-make::after { content: 'MK'; }
.explorer-icon.file-lock { background: #8b8b8b; }
.explorer-icon.file-lock::after { content: 'LK'; }
.explorer-icon.file-default {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23858585' d='M3 1h7l3 3v11H3z'/%3E%3Cpath fill='%23aaa' d='M10 1v3h3'/%3E%3C/svg%3E");
}
.explorer-icon.file-default::after { content: none; }

.explorer-label {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.explorer-children { /* nested */ }

.explorer-context-menu {
  position: fixed; z-index: 9999;
  background: var(--explorer-ctx-bg); border: 1px solid var(--explorer-ctx-border);
  border-radius: 4px; padding: 4px 0; min-width: 140px;
  box-shadow: var(--explorer-ctx-shadow);
}
.explorer-ctx-item {
  display: block; width: 100%; padding: 6px 16px;
  border: none; background: transparent; color: var(--explorer-ctx-text);
  font-size: 13px; text-align: left; cursor: pointer;
}
.explorer-ctx-item:hover { background: var(--explorer-ctx-hover); color: var(--explorer-title); }
.explorer-ctx-item.danger:hover { background: var(--explorer-ctx-danger-hover); }

.sync-placeholder { color: var(--text-muted); font-size: 13px; text-align: center; padding: 24px 0; }

.btn-mini {
  padding: 2px 8px; font-size: 11px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--btn-mini-bg); cursor: pointer; color: var(--text-muted); transition: all 0.15s;
}
.btn-mini:hover { border-color: var(--primary); color: var(--primary); }

/* 历史列表 */
.history-full-list { display: flex; flex-direction: column; gap: 12px; }
.history-card {
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; display: flex; align-items: center; gap: 16px; cursor: pointer;
  transition: transform 0.15s;
}
.history-card:hover { transform: translateY(-1px); }
.history-card.active {
  border: 2px solid var(--primary);
  background: var(--history-card-active-bg);
}
.history-card-info { flex: 1; }
.history-card-title { font-weight: 600; font-size: 15px; }
.history-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.history-card-actions button {
  background: transparent; border: 1px solid var(--border); padding: 6px 12px;
  border-radius: 6px; cursor: pointer; font-size: 12px;
}
.history-card-actions button:hover { background: var(--danger-hover-bg); border-color: var(--danger-hover-border); color: #ef4444; }

.history-card-meta .task-status { margin-left: 4px; vertical-align: middle; }

.empty-state { text-align: center; padding: 60px; color: var(--text-muted); }

/* 体验次数 */
.quota-badge {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
  color: var(--sidebar-text);
  background: var(--sidebar-hover-bg);
  border: 1px solid var(--sidebar-border);
}
.quota-badge.quota-empty { color: #ef4444; border-color: rgba(239, 68, 68, 0.35); }
.quota-apply-status { font-size: 13px; margin-bottom: 14px; color: var(--text-muted); }
.quota-reason-input { min-height: 96px; resize: vertical; }

/* 后台管理 */
.admin-layout { min-height: 100vh; background: var(--bg); color: var(--text); }
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; border-bottom: 1px solid var(--border); background: var(--card-bg);
}
.admin-header-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.admin-header h1 {
  display: flex; align-items: center; gap: 8px; margin: 0; font-size: 22px;
}
.admin-header h1 .icon { width: 22px; height: 22px; color: var(--primary); }
.admin-back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); text-decoration: none; font-size: 14px;
}
.admin-back-link:hover { color: var(--primary); }
.admin-login-card, .admin-main { max-width: 1100px; margin: 24px auto; padding: 0 24px 40px; }
.admin-login-card {
  max-width: 420px; background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; border: 1px solid var(--border);
}
.admin-login-card h2 { margin: 0 0 8px; font-size: 20px; }
.admin-login-actions { margin-top: 16px; }
.admin-error { color: #ef4444; font-size: 13px; margin-top: 12px; }
.admin-hint { color: var(--text-muted); font-size: 13px; line-height: 1.6; margin-bottom: 16px; }
.admin-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.admin-tab {
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text); cursor: pointer; font-family: inherit;
}
.admin-tab.active, .admin-tab:hover { border-color: var(--primary); color: var(--primary); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-card {
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; border: 1px solid var(--border);
}
.admin-card h3 { margin: 0 0 8px; font-size: 18px; }
.admin-card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.admin-form-grid { display: grid; gap: 14px; max-width: 420px; margin-bottom: 16px; }
.admin-filter-row { display: flex; gap: 8px; align-items: center; }
.admin-filter-select { width: auto; min-width: 140px; padding: 8px 10px; }
.admin-table-wrap { overflow-x: auto; margin-top: 12px; }
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.admin-table th, .admin-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top;
}
.admin-table th { background: var(--table-header-bg); white-space: nowrap; }
.admin-empty { text-align: center; color: var(--text-muted); }
.admin-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-accent); color: var(--primary); font-size: 12px;
}
.admin-status-pending { color: #d97706; }
.admin-status-approved { color: var(--success); }
.admin-status-rejected { color: #ef4444; }
.admin-reason-cell { max-width: 280px; white-space: pre-wrap; }
.admin-muted { color: var(--text-muted); font-size: 12px; }
.admin-textarea { min-height: 88px; resize: vertical; }
.btn-mini { padding: 6px 12px; font-size: 12px; }

/* Toast 提示 */
.toast-root {
  position: fixed; top: 20px; right: 20px; z-index: 20000;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  min-width: 220px; max-width: 360px; padding: 12px 16px;
  border-radius: 8px; font-size: 13px; line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0; transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  background: var(--card-bg); color: var(--text); border: 1px solid var(--border);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: rgba(34, 197, 94, 0.45); color: var(--success); }
.toast-error { border-color: rgba(239, 68, 68, 0.45); color: #ef4444; }
.toast-info { border-color: rgba(79, 110, 247, 0.35); color: var(--primary); }
.form-inline-error { font-size: 13px; color: #ef4444; margin: 0 0 12px; }
.form-inline-success { font-size: 13px; color: var(--success); margin: 0 0 12px; }
