/* ===== 考公AI智能体 — 深色主题 ===== */
:root {
  --bg: #0d1117;
  --bg-2: #161b22;
  --bg-3: #1c2330;
  --bg-card: #1a2332;
  --border: #2d3b4e;
  --border-2: #3d4f63;
  --text: #e6edf3;
  --text-2: #8b949e;
  --text-3: #5c6670;
  --accent: #58a6ff;
  --accent-2: #1f6feb;
  --accent-bg: rgba(31, 111, 235, 0.12);
  --green: #3fb950;
  --green-bg: rgba(63, 185, 80, 0.12);
  --red: #f85149;
  --red-bg: rgba(248, 81, 73, 0.12);
  --orange: #d29922;
  --orange-bg: rgba(210, 153, 34, 0.12);
  --purple: #a371f7;
  --purple-bg: rgba(163, 113, 247, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 240px;
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: var(--bg); color: var(--text); overflow: hidden; }
a { text-decoration: none; color: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

/* ===== Layout ===== */
#app { display: flex; height: 100vh; }

/* ===== Sidebar ===== */
.sidebar { width: var(--sidebar-w); background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; transition: margin-left var(--transition); flex-shrink: 0; }
.sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-w)); }
.logo { display: flex; align-items: center; gap: 12px; padding: 20px 16px; border-bottom: 1px solid var(--border); }
.logo-icon { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--accent-2), var(--purple)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; }
.logo-title { font-size: 15px; font-weight: 600; }
.logo-sub { font-size: 11px; color: var(--text-3); }
.nav { flex: 1; padding: 8px 0; }
.nav-group { margin-bottom: 4px; }
.nav-group-title { font-size: 11px; color: var(--text-3); padding: 8px 20px 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 20px; font-size: 14px; color: var(--text-2); transition: all var(--transition); border-left: 3px solid transparent; }
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent); border-left-color: var(--accent); }
.nav-ico { font-size: 14px; opacity: 0.7; width: 18px; text-align: center; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.disclaimer { font-size: 10px; color: var(--text-3); line-height: 1.5; }

/* ===== Main ===== */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 56px; background: var(--bg-2); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.topbar-left { display: flex; align-items: center; gap: 16px; }
.menu-toggle { background: none; border: none; color: var(--text-2); font-size: 18px; cursor: pointer; display: none; }
#pageTitle { font-size: 17px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-info { display: flex; flex-direction: column; align-items: flex-end; }
.user-name { font-size: 13px; font-weight: 500; }
.user-tag { font-size: 11px; color: var(--accent); }
.content { flex: 1; overflow-y: auto; padding: 24px; }

/* ===== Cards & Grid ===== */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ''; width: 4px; height: 16px; background: var(--accent); border-radius: 2px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ===== Stat Cards ===== */
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; top: 0; right: 0; width: 60px; height: 60px; border-radius: 50%; opacity: 0.05; }
.stat-card.accent::after { background: var(--accent); }
.stat-card.green::after { background: var(--green); }
.stat-card.orange::after { background: var(--orange); }
.stat-card.red::after { background: var(--red); }
.stat-label { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-sub { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.stat-trend { font-size: 12px; margin-top: 6px; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.orange { background: var(--orange-bg); color: var(--orange); }
.badge.accent { background: var(--accent-bg); color: var(--accent); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }

/* ===== Tables ===== */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--text-2); font-weight: 500; font-size: 12px; }
tr:hover { background: var(--bg-3); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; color: var(--text); font-size: 14px; transition: border var(--transition); }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--accent); }
.form-textarea { min-height: 200px; resize: vertical; font-family: inherit; line-height: 1.6; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500; border: none; cursor: pointer; transition: all var(--transition); }
.btn-primary { background: var(--accent-2); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { background: var(--bg-3); color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ===== Progress Bar ===== */
.progress { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.progress-bar.accent { background: var(--accent); }
.progress-bar.green { background: var(--green); }
.progress-bar.orange { background: var(--orange); }
.progress-bar.red { background: var(--red); }

/* ===== Radar/SVG ===== */
.svg-center { display: flex; justify-content: center; align-items: center; padding: 20px 0; }

/* ===== Today Plan ===== */
.plan-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.plan-item:last-child { border: none; }
.plan-time { width: 140px; font-size: 12px; color: var(--text-2); font-family: monospace; }
.plan-task { flex: 1; font-size: 13px; }
.plan-status { width: 60px; text-align: right; }

/* ===== Supervisor ===== */
.supervisor-msg { background: var(--bg); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 14px 18px; font-size: 14px; line-height: 1.6; margin-bottom: 12px; }
.supervisor-card { text-align: center; padding: 24px; border: 2px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: all var(--transition); }
.supervisor-card:hover { border-color: var(--accent); background: var(--accent-bg); }
.supervisor-card.active { border-color: var(--accent); background: var(--accent-bg); }
.supervisor-emoji { font-size: 36px; margin-bottom: 12px; }
.supervisor-name { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.supervisor-desc { font-size: 12px; color: var(--text-2); line-height: 1.5; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--bg-card); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 20px; font-size: 14px; box-shadow: 0 4px 20px rgba(0,0,0,0.4); z-index: 999; transform: translateX(400px); transition: transform 0.3s ease; }
.toast.show { transform: translateX(0); }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

/* ===== Loading ===== */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-2); }
.loading::after { content: ''; width: 20px; height: 20px; border: 2px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-left: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Empty State ===== */
.empty { text-align: center; padding: 40px; color: var(--text-3); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ===== Tags ===== */
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tag { padding: 4px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; background: var(--bg-3); color: var(--text-2); border: 1px solid var(--border); transition: all var(--transition); }
.tag:hover { border-color: var(--accent); }
.tag.active { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 90%; max-width: 600px; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-2); font-size: 20px; cursor: pointer; }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 100; height: 100vh; }
  .menu-toggle { display: block; }
}
