/* ═══════════════════════════════════════════
   style-guide.css
   Layer 1 — CSS 变量 + 基础组件
   来源：favorite-manager/index.html 深色主题
   版本：1.0(2026-07-01)
   ═══════════════════════════════════════════ */

:root {
  --cobalt-50: #eef2ff;
  --cobalt-100: #e0e7ff;
  --cobalt-400: #818cf8;
  --cobalt-500: #6366f1;
  --cobalt-600: #4f46e5;
  --cobalt-700: #4338ca;
  --cobalt-800: #3730a3;
  --cobalt-900: #312e81;
  --cobalt-950: #1e1b4b;
  --accent-400: #facc15;
  --accent-500: #eab308;
  --accent-600: #ca8a04;
  --surface-800: #1e1e2e;
  --surface-850: #181825;
  --surface-900: #11111b;
  --surface-950: #0a0a14;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--surface-950);
  color: #e0e0e0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.4rem; font-weight: 700; color: #f0f0f0; margin-bottom: 0.75rem; }
h2 { font-size: 1.15rem; font-weight: 600; color: #e0e0e0; margin: 1.25rem 0 0.5rem; }
h3 { font-size: 1rem; font-weight: 600; color: #d0d0d0; margin: 1rem 0 0.4rem; }
p  { margin-bottom: 0.6rem; }
a { color: var(--cobalt-400); text-decoration: none; }
a:hover { color: var(--cobalt-500); text-decoration: underline; }
code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
pre {
  background: #0d0d1a;
  border: 1px solid #2a2a3e;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  overflow-x: auto;
  margin: 0.75rem 0;
}
pre code { background: none; padding: 0; }

/* ── Data Table ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface-900);
  border-bottom: 1px solid #2a2a3e;
  padding: 8px 10px; text-align: left; font-size: 0.7rem; font-weight: 600;
  color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em;
  white-space: nowrap; user-select: none;
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable::after { content: ' \25bc'; font-size: 10px; color: #555; }
.data-table th.sort-asc::after { content: ' \25b2'; color: var(--cobalt-400); }
.data-table th.sort-desc::after { content: ' \25bc'; color: var(--cobalt-400); }
.data-table td {
  padding: 8px 10px; border-bottom: 1px solid #1a1a2e;
  font-size: 0.8rem; vertical-align: middle;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.data-table tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(79,70,229,0.08); }
.data-table tbody tr.selected { background: rgba(79,70,229,0.15); }

/* ── Badges ── */
.badge-red    { background: #3b1f1f; color: #f87171; }
.badge-yellow { background: #3b351f; color: #fbbf24; }
.badge-blue   { background: #1e3a5f; color: #60a5fa; }
.badge-black  { background: #1a1a1a; color: #9ca3af; border: 1px solid #333; }
.badge { display: inline-block; padding: 1px 8px; border-radius: var(--radius-full); font-size: 0.7rem; margin: 1px; }

/* ── Tag Pill ── */
.tag-pill {
  display: inline-block; padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem; margin: 1px;
  cursor: pointer; transition: opacity 0.15s;
}
.tag-pill:hover { opacity: 0.8; }

/* ── Input ── */
.input-dark {
  background: #0f0f1a;
  border: 1px solid #2a2a3e;
  color: #e0e0e0;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  outline: none;
  font-size: 0.85rem;
  font-family: inherit;
}
.input-dark:focus { border-color: var(--cobalt-600); box-shadow: 0 0 0 2px rgba(79,70,229,0.2); }
.input-dark::placeholder { color: #555; }

/* ── Buttons ── */
.btn {
  padding: 6px 14px; border-radius: var(--radius-md);
  border: none; cursor: pointer; font-size: 0.8rem;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-primary { background: var(--cobalt-600); color: white; }
.btn-primary:hover { background: var(--cobalt-700); }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost {
  background: transparent; color: #9ca3af;
  border: 1px solid #2a2a3e;
}
.btn-ghost:hover { color: #e0e0e0; border-color: #555; }
.btn-sm { padding: 3px 10px; font-size: 0.72rem; }

/* ── Pager ── */
.pager { display: flex; gap: 4px; justify-content: center; align-items: center; margin-top: 16px; }
.pager button { min-width: 32px; }

/* ── Batch Bar ── */
.batch-bar {
  display: none;
  background: var(--cobalt-950);
  border: 1px solid var(--cobalt-700);
  border-radius: var(--radius-lg);
  padding: 10px 16px; margin-bottom: 12px;
  align-items: center; gap: 12px;
}
.batch-bar.active { display: flex; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--surface-900);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  width: 420px; max-width: 90vw;
  border: 1px solid #2a2a3e;
}
.modal-box h3 { font-size: 0.9rem; font-weight: 700; color: #f0f0f0; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ── Utility ── */
.card { background: var(--surface-900); border: 1px solid #1a1a2e; border-radius: var(--radius-lg); overflow: hidden; }
.wrapper { max-width: 1400px; margin: 0 auto; padding: 16px 20px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-3 { margin-bottom: 12px; }
.text-xs { font-size: 0.75rem; }
.text-gray { color: #9ca3af; }
.w-full { width: 100%; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a3e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a5e; }
