:root {
  --bg-primary: #0b0f14;
  --bg-secondary: #131820;
  --bg-card: #1a1f2b;
  --bg-card-hover: #1e2432;
  --border: #252b38;
  --text-primary: #e6ecf2;
  --text-secondary: #8896a7;
  --text-muted: #556374;
  --accent: #4f8ff7;
  --accent-dim: #3a6ed0;
  --green: #34c77b;
  --green-bg: #133a26;
  --orange: #f0a048;
  --orange-bg: #3d2c14;
  --red: #f0485c;
  --red-bg: #3d141c;
  --purple: #a78bfa;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
}
/* == Sidebar == */
.sidebar {
  width: 220px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-logo {
  padding: 0 20px 24px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo .dot { width:9px;height:9px;border-radius:50%;background:var(--accent); }
.sidebar-logo .dot.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79,143,247,.5); }
  50% { box-shadow: 0 0 0 8px rgba(79,143,247,0); }
}
.user-chip {
  margin: 0 20px 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
}
.user-chip strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-button {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
}
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-primary);
}
.auth-gate.show { display: flex; }
.auth-panel {
  width: min(420px, 100%);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}
.auth-panel h1 { font-size: 24px; margin-bottom: 6px; }
.auth-panel p { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.auth-panel input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 11px 12px;
  margin-bottom: 10px;
  font-size: 14px;
}
.auth-message,
.auth-error {
  min-height: 18px;
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}
.auth-message.success { color: var(--green); }
.auth-message.error,
.auth-error { color: var(--red); }
.auth-switch { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.auth-switch button {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}
.nav { list-style:none; flex:1; }
.nav li { padding: 0 12px; margin-bottom:2px; }
.nav li a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: all .15s;
}
.nav li a:hover { color: var(--text-primary); background: var(--bg-card); }
.nav li a.active { color: var(--text-primary); background: var(--bg-card); }
.nav li a .icon { font-size: 16px; width: 20px; text-align: center; }
.nav li a .badge {
  margin-left: auto; background: var(--accent);
  color: #fff; font-size: 11px; padding: 1px 7px;
  border-radius: 10px; font-weight: 600;
}
.sidebar-footer {
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
  margin: 0 12px;
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-footer .status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
}
.sidebar-footer .status-dot.warn { background: var(--orange); }
.sidebar-footer .status-dot.error { background: var(--red); }

/* == Main == */
.main { flex: 1; overflow-y: auto; padding: 32px 36px; }
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 28px;
}
.page-header h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.4px; }
.page-header .subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.page-header .time { text-align: right; font-size: 13px; color: var(--text-secondary); }

/* == Stats == */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.stat-card .stat-change { font-size: 12px; margin-top: 4px; }
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--orange); }
.stat-change.muted { color: var(--text-muted); }
.stat-change.ok { color: var(--green); }

/* == Pipeline == */
.pipeline {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.pipeline h3 { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.pipeline-steps { display: flex; align-items: center; gap: 0; }
.pipe-step {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; flex: 1;
}
.pipe-step .step-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 8px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  transition: all .2s;
}
.pipe-step .step-icon.ok { border-color: var(--green); color: var(--green); }
.pipe-step .step-icon.running {
  border-color: var(--accent); color: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}
.pipe-step .step-icon.error { border-color: var(--red); color: var(--red); }
.pipe-step .step-icon.idle { color: var(--text-muted); }
.pipe-step .step-label { font-size: 13px; font-weight: 600; }
.pipe-step .step-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pipe-arrow { font-size: 20px; color: var(--text-muted); margin-bottom: 20px; flex-shrink: 0; }

/* == Section title == */
.section-title {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.section-title h3 { font-size: 14px; font-weight: 600; }
.section-title a { font-size: 13px; color: var(--accent); text-decoration: none; }
.section-title a:hover { text-decoration: underline; }

/* == Topic row == */
.topic-list { margin-bottom: 24px; }
.topic-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: background .12s;
}
.topic-row:hover { background: var(--bg-card-hover); }
.topic-score {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.score-high { background: #1d3d34; color: var(--green); }
.score-mid { background: #3d3414; color: var(--orange); }
.score-low { background: #2d1a1e; color: var(--red); }

.topic-info { flex: 1; min-width: 0; }
.topic-info .topic-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.topic-info .topic-pitch {
  font-size: 12px; color: var(--text-secondary);
  margin-top: 3px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.topic-cat {
  font-size: 11px; padding: 3px 10px;
  border-radius: 12px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.cat-agent { background: #1a2340; color: #7b9ffa; }
.cat-coding { background: #1d3a30; color: #5ec49b; }
.cat-model { background: #2e1d3d; color: #b08ef0; }
.cat-other { background: #2a2d32; color: #8896a7; }

.pushed-flag { font-size:11px; color:var(--green); white-space:nowrap; flex-shrink:0; }
.pushed-flag.muted { color:var(--text-muted); }

.topic-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn {
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; border: none;
  cursor: pointer; transition: all .15s;
}
.btn-detail { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-detail:hover { color: var(--text-primary); border-color: var(--text-muted); }
.btn-done { background: var(--green-bg); color: var(--green); }
.btn-done:hover { filter: brightness(1.2); }
.btn-skip { background: transparent; color: var(--text-muted); }
.btn-skip:hover { color: var(--text-secondary); }
.btn-link {
  background: transparent; color: var(--accent); border: 1px solid var(--border);
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.btn-link:hover { border-color: var(--accent); background: rgba(79,143,247,.08); }
.topic-source-meta {
  font-size: 11px; color: var(--text-muted); margin-top: 4px;
  display: flex; align-items: center; gap: 6px;
}
.topic-source-meta .src-pill {
  padding: 1px 7px; border-radius: 8px; background: #1a2350;
  color: #7b9ffa; font-weight: 600; text-transform: uppercase; font-size: 10px;
}
.timeliness {
  font-size: 11px; padding: 3px 9px; border-radius: 12px;
  font-weight: 600; white-space: nowrap; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
}
.timeliness::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.timeliness-urgent  { background: rgba(240,72,92,.12); color: #f0485c; }
.timeliness-short   { background: rgba(240,160,72,.12); color: #f0a048; }
.timeliness-medium  { background: rgba(79,143,247,.12); color: #4f8ff7; }
.timeliness-long    { background: rgba(52,199,123,.12); color: #34c77b; }
.timeliness-unknown { background: var(--bg-card); color: var(--text-muted); }
.timeliness-block {
  margin-top: 20px; padding: 14px 18px;
  background: var(--bg-primary); border-radius: var(--radius-sm);
}
.timeliness-block-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.timeliness-block-head h4 {
  font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}
.timeliness-block-head h4 small {
  font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted);
}
.timeliness-block-body { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }

/* == Feedback (v0.2) == */
.feedback-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 28px;
  margin-top: 20px;
  margin-bottom: 24px;
}
.feedback-box h3 { font-size: 14px; margin-bottom: 8px; font-weight: 600; }
.feedback-opts { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.fb-opt {
  padding: 8px 18px; border-radius: 20px; border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all .12s;
}
.fb-opt:hover { border-color: var(--text-muted); color: var(--text-primary); }
.fb-opt.selected { border-color: var(--accent); color: var(--accent); background: rgba(79,143,247,.08); }
.fb-note {
  width: 100%; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text-primary); font-size: 13px; margin-bottom: 10px;
  resize: vertical; min-height: 56px;
  font-family: inherit;
}
.fb-note::placeholder { color: var(--text-muted); }
.btn-submit {
  background: var(--accent); color: #fff;
  padding: 8px 20px; font-size: 13px; font-weight: 600;
  border: none; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s;
}
.btn-submit:hover { background: var(--accent-dim); }

/* == Category Management (v0.2.1) == */
.cat-list { margin-bottom: 14px; }
.cat-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.cat-color-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.cat-name { flex: 1; font-size: 14px; font-weight: 500; }
.cat-count { font-size: 12px; color: var(--text-muted); margin-right: 8px; white-space: nowrap; }
.btn-icon-sm {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.btn-icon-sm:hover { color: var(--text-primary); border-color: var(--text-muted); }
.btn-icon-sm.danger:hover { color: var(--red); border-color: var(--red); }

.add-cat-form {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.add-cat-form input {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
}
.add-cat-form input::placeholder { color: var(--text-muted); }
.add-cat-form input[type="text"] { min-width: 120px; }
.add-cat-form input[type="color"] {
  width: 40px; height: 36px; padding: 2px; cursor: pointer;
}
.btn-add-cat {
  background: var(--accent); color: #fff;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
}
.btn-add-cat:hover { background: var(--accent-dim); }

/* == Chart == */
.chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px 28px;
  height: 200px;
  display: flex; flex-direction: column;
  margin-bottom: 16px;
}
.chart-box h3 { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.chart-body { flex: 1; display: flex; align-items: flex-end; gap: 10px; padding: 0 8px 8px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-stack { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; flex: 1; justify-content: flex-end; width: 100%; }
.bar {
  width: 100%; max-width: 32px; border-radius: 4px 4px 0 0;
  transition: height .3s;
}
.bar.total { background: var(--accent); opacity: .35; }
.bar.adopted { background: var(--green); }
.bar-label { font-size: 11px; color: var(--text-muted); }

/* == Filters == */
.content-layout { display: flex; gap: 24px; }
.filter-panel {
  width: 200px; flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  height: fit-content;
}
.filter-panel h4 { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.filter-group { margin-bottom: 16px; }
.filter-group label {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 13px; color: var(--text-secondary);
  cursor: pointer;
}
.filter-group label input[type=checkbox] { accent-color: var(--accent); }
.filter-group label .count { margin-left: auto; font-size: 11px; color: var(--text-muted); }

.score-slider { width: 100%; accent-color: var(--accent); margin-top: 4px; }
.slider-val { text-align: center; font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.topic-table { flex: 1; }
.pagination {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 16px;
}
.pagination span {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary);
  cursor: pointer;
}
.pagination span.active { background: var(--accent); color: #fff; font-weight: 600; }
.pagination span:hover:not(.active) { background: var(--bg-card); }

/* == Detail == */
.detail-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
}
.detail-hero .hero-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.detail-hero .hero-score { font-size: 36px; font-weight: 700; letter-spacing: -1px; }
.detail-hero .hero-title { font-size: 18px; font-weight: 600; }
.detail-hero .hero-pitch { font-size: 14px; color: var(--text-secondary); margin-top: 6px; max-width: 720px; line-height: 1.5; }

.dimensions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.dim-row { display: flex; align-items: center; gap: 12px; }
.dim-row .dim-label { width: 70px; font-size: 13px; color: var(--text-secondary); }
.dim-row .dim-bar-bg { flex: 1; height: 8px; background: var(--bg-primary); border-radius: 4px; overflow: hidden; }
.dim-row .dim-bar-fg { height: 100%; border-radius: 4px; }
.dim-bar-novel { background: var(--accent); }
.dim-bar-writable { background: var(--green); }
.dim-bar-hot { background: var(--orange); }
.dim-bar-relevant { background: var(--purple); }
.dim-row .dim-val { width: 32px; font-size: 13px; font-weight: 600; text-align: right; }

.angles-list { margin-top: 20px; padding: 14px 18px; background: var(--bg-primary); border-radius: var(--radius-sm); }
.angles-list h4 { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.angles-list ul { padding-left: 18px; }
.angles-list li { font-size: 13px; line-height: 1.6; color: var(--text-primary); }

.source-items { margin-bottom: 20px; }
.source-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.source-item:hover { background: var(--bg-card-hover); }
.source-item .src-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  font-weight: 600; text-transform: uppercase;
  background: #1a2350; color: #7b9ffa;
  white-space: nowrap;
}
.source-item .src-title { flex: 1; font-size: 13px; line-height: 1.4; }
.source-item .src-link { font-size: 12px; color: var(--text-muted); }

/* == Run button == */
.btn-run {
  background: var(--accent); color: #fff;
  padding: 10px 22px; font-size: 14px; font-weight: 600;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-run:hover { background: var(--accent-dim); }
.btn-run.running {
  background: var(--bg-card); color: var(--text-muted);
  border: 1px solid var(--border); cursor: not-allowed;
  pointer-events: none;
}
.btn-run-outline {
  background: transparent; color: var(--accent);
  padding: 10px 22px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-run-outline:hover { background: rgba(79,143,247,.08); }
.btn-run-outline.running { opacity: .5; pointer-events: none; }

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

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: none;
}
.btn-run.running .spinner { display: block; }
.btn-run.running .btn-icon { display: none; }

.pipeline-console {
  margin-top: 18px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.console-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.console-head strong {
  color: var(--text-primary);
  font-size: 12px;
}
.console-status { color: var(--text-muted); }
.console-status.running { color: var(--accent); }
.console-status.ok { color: var(--green); }
.console-status.error { color: var(--red); }
.run-log {
  padding: 12px 14px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  min-height: 92px;
  max-height: 280px;
  overflow-y: auto;
}
.run-log .log-line { padding: 2px 0; white-space: pre-wrap; }
.run-log .log-line.ok { color: var(--green); }
.run-log .log-line.warn { color: var(--orange); }
.run-log .log-line.error { color: var(--red); }
.run-log .log-line.muted { color: var(--text-muted); }

/* == Sources == */
.src-table { width: 100%; border-collapse: collapse; }
.src-table th {
  text-align: left; font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; padding: 0 16px 12px;
  font-weight: 600;
}
.src-table td { padding: 12px 16px; font-size: 13px; border-top: 1px solid var(--border); }
.src-table tr:hover td { background: rgba(255,255,255,.015); }
.src-table tr.disabled td { opacity: .55; }
.src-name { font-weight: 600; }
.bar-mini {
  display: inline-block; height: 6px; border-radius: 3px;
  vertical-align: middle; margin-right: 8px;
}
.bar-mini.green { background: var(--green); }
.bar-mini.orange { background: var(--orange); }

/* kind 徽章 */
.kind-pill {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 4px;
  background: var(--bg-primary); color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* tier dropdown(inline 编辑) */
.tier-select {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all .12s;
}
.tier-select:hover { border-color: var(--text-muted); }
.tier-select:focus { outline: none; border-color: var(--accent); }
.tier-select.t0 { color: var(--green); }
.tier-select.t1 { color: var(--accent); }
.tier-select.t2 { color: var(--text-muted); }

/* 启用开关 */
.toggle {
  position: relative; display: inline-block;
  width: 36px; height: 20px;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 20px; transition: .15s;
}
.toggle-slider::before {
  content: ""; position: absolute;
  height: 14px; width: 14px; left: 2px; top: 2px;
  background: var(--text-muted); border-radius: 50%;
  transition: .15s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); background: #fff; }

/* 行内操作 */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .btn-icon-sm { width: 26px; height: 26px; font-size: 12px; }

/* 通用按钮 */
.btn-primary {
  background: var(--accent); color: #fff;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .12s;
}
.btn-primary:hover { background: var(--accent-dim); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary {
  background: transparent; color: var(--text-secondary);
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--text-muted); }

/* btn-icon-sm(行内编辑/删除按钮) */
.btn-icon-sm {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.btn-icon-sm:hover { color: var(--text-primary); border-color: var(--text-muted); }
.btn-icon-sm.danger:hover { color: var(--red); border-color: var(--red); }

/* == Modal == */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  backdrop-filter: blur(2px);
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%; max-width: 520px;
  max-height: 86vh; overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
.modal-close {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; line-height: 1;
  padding: 4px 8px; border-radius: var(--radius-sm);
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-card); }
.modal-body { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* form fields */
.form-field { margin-bottom: 14px; }
.form-field label {
  display: block; font-size: 12px; color: var(--text-secondary);
  margin-bottom: 6px; font-weight: 500;
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--text-muted); }
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none; border-color: var(--accent);
}
.form-field textarea { min-height: 78px; resize: vertical; font-family: ui-monospace, monospace; font-size: 12px; }
.form-field .hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-checkbox {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
}
.form-checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

/* == Settings == */
.setting-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 28px;
  margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.setting-row .setting-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.setting-row .setting-desc { font-size: 12px; color: var(--text-muted); }
.setting-row .setting-value { font-size: 22px; font-weight: 700; color: var(--accent); }
.personal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.personal-grid .form-field {
  margin: 0;
}
.personal-grid .form-field.full {
  grid-column: 1 / -1;
}
.personal-grid .form-field span {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.personal-grid input,
.personal-grid select,
.personal-grid textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 13px;
}
.personal-grid textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.5;
}
.schedule-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 12px;
  align-items: end;
}
.schedule-toggle-field {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 41px;
}
.schedule-toggle-field span {
  margin-bottom: 0;
}

/* == Empty state == */
.empty {
  background: var(--bg-card); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 48px 20px;
  text-align: center; color: var(--text-muted); font-size: 13px;
}

/* == Toast == */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
  font-size: 13px; color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(10px);
  transition: all .25s;
  pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

@media (max-width: 720px) {
  .personal-grid,
  .schedule-grid {
    grid-template-columns: 1fr;
  }
  .setting-row {
    padding: 18px;
  }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
