/* ============================================================
   Pawcast Design System · 共享 CSS · 所有详情页引用
   ============================================================ */

:root {
  --primary: #8B5CF6;
  --primary-soft: #A78BFA;
  --accent: #F97316;
  --accent-soft: #FB923C;
  --bg-deep: #06060A;
  --surface-1: #13131B;
  --surface-2: #1C1C26;
  --surface-3: #25252F;
  --border-subtle: #27272F;
  --border-active: #3F3F4B;
  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --live: #FF2E5C;
  --grad-paw: linear-gradient(135deg, #8B5CF6 0%, #F97316 100%);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0; padding: 0;
  background: #06060A;
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
body {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(139,92,246,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(249,115,22,0.04) 0%, transparent 60%),
    #06060A;
  min-height: 100vh;
}

.page { max-width: 1480px; margin: 0 auto; padding: 56px 48px 96px; }
.num { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }

/* === Doc header === */
.doc-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 48px; }
.doc-title h1 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800; font-size: 56px; letter-spacing: -0.03em; margin: 0;
  background: var(--grad-paw); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.doc-title p { color: var(--text-secondary); font-size: 18px; margin-top: 12px; max-width: 720px; line-height: 1.6; }
.doc-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.chip { padding: 6px 12px; background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: 999px; font-size: 12px; color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; }
.eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--accent);
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 4px 12px; border: 1px solid rgba(249,115,22,0.3);
  border-radius: 999px; background: rgba(249,115,22,0.08);
}
.gradient-text { background: var(--grad-paw); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* === Global Site Top Nav === */
/* 统一在所有 9 个页面的最顶部，sticky，包含：左 Logo+品牌 / 中 全站导航 / 右 当前页指示 */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 24px;
  background: rgba(6,6,10,0.92); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  font-family: 'Inter', system-ui, sans-serif;
}

/* Brand (左侧 Logo + 名字 + 返回入口) */
.topbar .home-link {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-primary); text-decoration: none;
  font-family: 'Manrope', sans-serif; font-weight: 700;
  font-size: 16px; letter-spacing: -0.02em;
  flex-shrink: 0;
  padding: 4px 10px 4px 4px; border-radius: 8px;
  transition: background .15s;
}
.topbar .home-link:hover { background: var(--surface-2); }
.topbar .home-link::after {
  content: 'Design Preview';
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.06em; color: var(--text-muted);
  margin-left: 4px;
  padding: 2px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}
.topbar .breadcrumb { display: none; }

/* 中部全站导航 */
.topbar .nav-other {
  display: flex; gap: 2px; flex: 1;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar .nav-other::-webkit-scrollbar { display: none; }
.topbar .nav-other a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px;
  color: var(--text-secondary); text-decoration: none;
  font-size: 13px; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  border: 1px solid transparent;
  transition: all .15s;
}
.topbar .nav-other a:hover {
  background: var(--surface-2); color: var(--text-primary);
}
.topbar .nav-other a.active {
  background: var(--grad-paw); color: white;
  font-weight: 600;
  box-shadow: 0 4px 14px -4px rgba(139,92,246,0.6), 0 0 0 1px rgba(255,255,255,0.06) inset;
}
.topbar .nav-other a .num-prefix {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; opacity: 0.55;
  margin-right: -2px;
}
.topbar .nav-other a.active .num-prefix { opacity: 0.8; }

/* 分组分隔（介绍/原型 vs 模块 vs 工程） */
.topbar .nav-other .nav-divider {
  width: 1px; height: 16px;
  background: var(--border-subtle);
  margin: 0 4px;
  align-self: center;
  flex-shrink: 0;
}

/* 右侧版本徽章 */
.topbar .topbar-version {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.topbar .topbar-version::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

/* 响应式：小屏隐藏分隔，挤紧 */
@media (max-width: 1100px) {
  .topbar { padding: 10px 16px; gap: 12px; }
  .topbar .home-link::after { display: none; }
  .topbar .nav-other a { padding: 6px 10px; font-size: 12px; }
  .topbar .nav-other .nav-divider { display: none; }
}

/* === Section wrapper === */
.section {
  margin-top: 64px;
}
.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--accent); letter-spacing: 0.1em;
  display: block; margin-bottom: 6px;
}
.section-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800; font-size: 32px; letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.section-desc {
  color: var(--text-secondary); font-size: 15px; line-height: 1.7;
  max-width: 720px; margin: 0;
}

/* === Mockup with annotations layout === */
.mockup-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  margin-top: 32px;
  align-items: start;
}
@media (max-width: 1100px) { .mockup-wrap { grid-template-columns: 1fr; } }

.annotations { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 80px; }
.anno {
  padding: 14px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  border-left: 3px solid var(--primary);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.anno-num {
  display: inline-block; width: 20px; height: 20px;
  text-align: center; line-height: 20px;
  background: var(--grad-paw); color: white;
  border-radius: 50%; font-size: 11px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  margin-right: 6px;
}
.anno strong { color: var(--text-primary); display: block; margin-bottom: 4px; font-size: 13px; font-family: 'Manrope', sans-serif; font-weight: 700; }
.anno code { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--primary-soft); background: rgba(139,92,246,0.08); padding: 1px 6px; border-radius: 4px; }
.anno.impl { border-left-color: var(--accent); }
.anno.impl strong { color: var(--accent-soft); }
.anno.impl strong::before { content: '⚙ '; }

/* === Window frame === */
.win-frame {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02) inset;
  position: relative;
}
.titlebar { display: flex; align-items: center; height: 36px; background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border-subtle); padding: 0 12px; gap: 10px; }
.traffic { display: flex; gap: 6px; }
.traffic span { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.traffic .min { background: #FBBF24; }
.traffic .max { background: #34D399; }
.traffic .close { background: #F87171; }
.titlebar-title { font-size: 12px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; letter-spacing: 0.02em; }
.titlebar-version { margin-left: auto; font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* === App nav === */
.topnav { display: flex; align-items: center; padding: 14px 24px; gap: 24px; border-bottom: 1px solid var(--border-subtle); flex-wrap: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-name { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.nav-tabs { display: flex; gap: 2px; flex: 1; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.nav-tab { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: all .15s; font-weight: 500; white-space: nowrap; flex-shrink: 0; }
.nav-tab:hover { background: rgba(255,255,255,0.03); color: var(--text-primary); }
.nav-tab.active { background: var(--surface-2); color: var(--text-primary); box-shadow: 0 0 0 1px var(--border-active); }
.nav-tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.nav-tab.active .dot { background: var(--primary); box-shadow: 0 0 8px var(--primary); }
.nav-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.icon-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text-secondary); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.icon { width: 14px; height: 14px; flex-shrink: 0; }

/* === Common UI components === */
.card { background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: 12px; }
.card-h { padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; }
.card-h h3 { font-size: 13px; font-weight: 600; margin: 0; color: var(--text-primary); }
.card-h .h-meta { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); }
.card-b { padding: 16px; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.pill-live { background: rgba(255,46,92,0.15); color: var(--live); }
.pill-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
.pill-success { background: rgba(16,185,129,0.12); color: var(--success); }
.pill-warn { background: rgba(245,158,11,0.12); color: var(--warning); }
.pill-danger { background: rgba(239,68,68,0.12); color: var(--danger); }
.pill-muted { background: rgba(255,255,255,0.04); color: var(--text-muted); }
.pill-primary { background: rgba(139,92,246,0.15); color: var(--primary-soft); border: 1px solid rgba(139,92,246,0.2); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; border: 0; font-family: inherit; white-space: nowrap; }
.btn-primary { background: var(--grad-paw); color: white; box-shadow: 0 8px 20px -8px rgba(139,92,246,0.6); }
.btn-primary:hover { box-shadow: 0 10px 24px -6px rgba(139,92,246,0.7); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text-primary); }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.btn-success { background: rgba(16,185,129,0.12); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }

.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; color: white; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-xl { width: 56px; height: 56px; font-size: 20px; }
.avatar-grad { background: var(--grad-paw); }

.toggle { width: 36px; height: 20px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--text-muted); border-radius: 50%; transition: all .2s; }
.toggle.on { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.toggle.on::after { left: 18px; background: white; }

.input {
  background: var(--surface-2); border: 1px solid var(--border-subtle);
  color: var(--text-primary); padding: 8px 12px; border-radius: 6px;
  font-family: inherit; font-size: 13px; outline: none;
}
.input:focus { border-color: var(--primary); }
.input.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

.field-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  display: block; margin-bottom: 4px;
}

.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th { text-align: left; color: var(--text-muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--border-subtle); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.table tr:hover td { background: rgba(255,255,255,0.02); }

.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; position: relative; }
.progress-bar { height: 100%; background: var(--grad-paw); border-radius: 999px; transition: width .4s ease; }
.progress.duel { display: flex; height: 24px; }
.progress.duel .left { background: linear-gradient(90deg, #06B6D4, #0EA5E9); }
.progress.duel .right { background: linear-gradient(90deg, #EC4899, #F472B6); }

.actionbar { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-top: 1px solid var(--border-subtle); background: rgba(255,255,255,0.01); }
.actionbar .field { display: flex; align-items: center; gap: 10px; flex: 1; }
.actionbar label { color: var(--text-muted); font-size: 12px; }

/* === Modal overlay === */
.modal-card {
  background: var(--surface-1);
  border: 1px solid var(--border-active);
  border-radius: 14px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.8);
  margin: 24px;
  overflow: hidden;
  position: relative;
}
.modal-card::before {
  content: 'MODAL · 弹窗设计';
  position: absolute; top: 8px; right: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 0.1em;
  background: rgba(249,115,22,0.15); color: var(--accent);
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid rgba(249,115,22,0.3);
  z-index: 5;
}
.modal-h {
  padding: 18px 22px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-h h3 { margin: 0; font-family: 'Manrope', sans-serif; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.modal-h .close { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; }
.modal-h .close:hover { background: var(--surface-3); color: var(--text-primary); }
.modal-b { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: flex-end; gap: 8px; background: rgba(255,255,255,0.01); }

/* === Variation grid (for showing many states) === */
.var-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 24px; margin-top: 28px;
}
.var-cell {
  display: flex; flex-direction: column; gap: 10px;
}
.var-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em;
}
.var-label .num-tag {
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--accent);
  font-size: 10px; font-weight: 600;
}

/* === Footer === */
.doc-footer-note {
  margin-top: 96px;
  padding: 24px;
  background: var(--surface-1); border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-muted); font-size: 13px; line-height: 1.7;
}
.doc-footer-note strong { color: var(--text-primary); }
.doc-footer-note a { color: var(--primary-soft); text-decoration: none; }
.doc-footer-note a:hover { text-decoration: underline; }
