/**
 * RD Console — 墨青编辑部视觉令牌
 * Editorial feed layout · light / dark · responsive
 */
:root {
  color-scheme: light;

  --bg-0: #f4f5f6;
  --bg-1: #eff1f2;
  --bg-2: #e2e4e7;
  --surface-0: rgba(28, 39, 51, 0.025);
  --surface-1: rgba(28, 39, 51, 0.04);
  --surface-2: rgba(28, 39, 51, 0.06);
  --surface-3: rgba(28, 39, 51, 0.09);
  --surface-card: #ffffff;
  --surface-card-hover: #ffffff;
  --surface-elevated: #ffffff;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e2e4e7;

  --text-0: #1c2733;
  --text-1: #5c6672;
  --text-2: #6b7684;
  --text-3: #c9cdd4;
  --text-soft-strong: rgba(28, 39, 51, 0.92);
  --text-soft-medium: rgba(28, 39, 51, 0.55);

  --border: #e2e4e7;
  --border-strong: #d8dbdf;
  --border-soft: #eceef0;
  --border-emphasis: #8a94a2;
  --border-card-subtle-solid: #c9cdd2;

  --theme-accent: #135e6b;
  --theme-accent-rgb: 19, 94, 107;
  --theme-accent-hover: #0e4a54;
  --theme-accent-contrast: #fcfcfd;
  --theme-accent-fg: #135e6b;
  --accent-cyan: #135e6b;
  --accent-cyan-fg: #135e6b;
  --accent-emerald: #2f7d5c;
  --accent-emerald-fg: #2f7d5c;
  --accent-amber: #b8873a;
  --accent-amber-fg: #96702e;
  --accent-rose: #b3402a;
  --accent-rose-fg: #b3402a;
  --accent-subtle: rgba(19, 94, 107, 0.08);
  --accent-muted: rgba(19, 94, 107, 0.14);

  --rank-1: #b3402a;
  --rank-2: #c2703f;
  --rank-3: #b8873a;
  --rank-rest: #6b7684;
  --hot-rank: var(--rank-1);
  --note-fg: #42707c;

  --shadow: 0 12px 32px rgba(28, 39, 51, 0.12);
  --shadow-soft: 0 4px 12px rgba(28, 39, 51, 0.06);
  --shadow-card: 0 1px 2px rgba(28, 39, 51, 0.05);
  --shadow-card-hover: 0 6px 18px rgba(28, 39, 51, 0.09);
  --shadow-hover: var(--shadow-card-hover);
  --shadow-thumb: 0 1px 3px rgba(28, 39, 51, 0.14);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --content-max: 960px;
  --page-x: clamp(16px, 2.2vw, 32px);
  --page-x-sm: 16px;

  --font-body: "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: var(--font-body);
  --font-brand: var(--font-body);
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;

  --dur-fast: 120ms;
  --dur-base: 160ms;
  --dur-press: 80ms;
  --transition: 0.15s ease;
  --theme-transition: background-color 220ms ease, color 180ms ease, border-color 180ms ease, box-shadow 220ms ease;

  --nav-width: 200px;
  --bp-md: 640px;
  --bp-lg: 960px;
  --touch-target: 44px;
  --touch-target-sm: 36px;
  --scrim-overlay: rgba(0, 0, 0, 0.5);
  --page-bg-solid: var(--bg-0);

  /* Mobile shell */
  --m-bg: #f4f5f6;
  --m-surface: #ffffff;
  --m-ink: #1c2733;
  --m-ink-2: #5c6672;
  --m-ink-25: #2b3743;
  --m-ink-3: #6b7684;
  --m-brand: #135e6b;
  --m-brand-contrast: #fcfcfd;
  --m-brand-weak: rgba(19, 94, 107, 0.08);
  --m-rank-1: #b3402a;
  --m-rank-2: #c2703f;
  --m-rank-3: #b8873a;
  --m-rank-rest-bg: #eceef0;
  --m-rank-rest-ink: #6b7684;
  --m-border: #e2e4e7;
  --m-divider: #eceef0;
  --m-chip-border: #d8dbdf;
  --m-chip-ink: #5c6672;
  --m-chip-active-bg: #1c2733;
  --m-chip-active-ink: #ffffff;
  --m-daybar-bg: #eff1f2;
  --m-tab-inactive: #6b7684;
  --m-radius-card: 16px;
  --m-radius-btn: 12px;
  --m-shadow-card: 0 1px 2px rgba(28, 39, 51, 0.05);
  --m-tabbar-h: 54px;
  --m-gutter: 18px;

  /* Plugin aliases */
  --rdc-bg: var(--bg-0);
  --rdc-bg-1: var(--bg-1);
  --rdc-sidebar: var(--sidebar-bg);
  --rdc-surface: var(--surface-card);
  --rdc-surface-1: var(--surface-1);
  --rdc-surface-2: var(--surface-2);
  --rdc-surface-card: var(--surface-card);
  --rdc-surface-hover: var(--surface-1);
  --rdc-text: var(--text-0);
  --rdc-text-1: var(--text-1);
  --rdc-text-muted: var(--text-2);
  --rdc-text-faint: var(--text-3);
  --rdc-border: var(--border);
  --rdc-border-soft: var(--border-soft);
  --rdc-border-strong: var(--border-strong);
  --rdc-border-emphasis: var(--border-emphasis);
  --rdc-accent: var(--theme-accent);
  --rdc-accent-rgb: var(--theme-accent-rgb);
  --rdc-accent-hover: var(--theme-accent-hover);
  --rdc-accent-subtle: var(--accent-subtle);
  --rdc-emerald: var(--accent-emerald);
  --rdc-amber: var(--accent-amber);
  --rdc-rose: var(--accent-rose);
  --rdc-radius: var(--radius);
  --rdc-radius-sm: var(--radius-sm);
  --rdc-shadow: var(--shadow-card);
  --rdc-shadow-hover: var(--shadow-card-hover);
  --rdc-font: var(--font-body);
  --rdc-sidebar-w: var(--nav-width);
  --rdc-content-max: var(--content-max);
  --rdc-page-x: var(--page-x);

  --rd-bg: var(--bg-0);
  --rd-surface: var(--surface-card);
  --rd-surface-hover: var(--surface-1);
  --rd-text: var(--text-0);
  --rd-text-muted: var(--text-2);
  --rd-border: var(--border);
  --rd-border-strong: var(--border-strong);
  --rd-accent: var(--theme-accent);
  --rd-accent-rgb: var(--theme-accent-rgb);
  --rd-error: var(--accent-rose);
  --rd-success: var(--accent-emerald);
  --rd-font: var(--font-body);
  --rd-radius: var(--radius);
  --rd-radius-sm: var(--radius-sm);
  --rd-shadow: var(--shadow-card-hover);

  --neo-bg: var(--bg-0);
  --neo-surface: var(--surface-card);
  --neo-ink: var(--text-0);
  --neo-muted: var(--text-2);
  --neo-yellow: var(--theme-accent);
  --neo-pink: var(--accent-rose);
  --neo-cyan: var(--theme-accent);
  --neo-green: var(--accent-emerald);
  --neo-line: var(--border);
  --neo-border: 1px solid var(--border);
  --neo-border-thin: 1px solid var(--border-soft);
  --neo-shadow: var(--shadow-card);
  --neo-shadow-sm: var(--shadow-soft);
  --neo-shadow-xs: none;
  --neo-shadow-lg: var(--shadow-card-hover);
  --rdt-font: var(--font-body);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-0: #10151c;
    --bg-1: #171d26;
    --bg-2: #1b2230;
    --surface-0: rgba(255, 255, 255, 0.03);
    --surface-1: rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.07);
    --surface-3: rgba(255, 255, 255, 0.10);
    --surface-card: #171d26;
    --surface-card-hover: #1b2230;
    --surface-elevated: #1b2230;
    --sidebar-bg: #0c1117;
    --sidebar-border: rgba(255, 255, 255, 0.07);
    --text-0: #e8ebf2;
    --text-1: #98a2b3;
    --text-2: #7b869a;
    --text-3: #5c6672;
    --text-soft-strong: rgba(232, 235, 242, 0.85);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    --border-soft: rgba(255, 255, 255, 0.06);
    --border-emphasis: rgba(255, 255, 255, 0.22);
    --border-card-subtle-solid: rgba(255, 255, 255, 0.14);
    --theme-accent: #4fa3b3;
    --theme-accent-rgb: 79, 163, 179;
    --theme-accent-hover: #6cb8c6;
    --theme-accent-contrast: #10151c;
    --theme-accent-fg: #6cb8c6;
    --accent-cyan: #4fa3b3;
    --accent-cyan-fg: #6cb8c6;
    --accent-subtle: rgba(79, 163, 179, 0.12);
    --accent-muted: rgba(79, 163, 179, 0.2);
    --shadow-card: none;
    --shadow-card-hover: none;
    --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.35);
    --page-bg-solid: #10151c;
    --m-bg: #10151c;
    --m-surface: #171d26;
    --m-ink: #e8ebf2;
    --m-ink-2: #98a2b3;
    --m-ink-25: #c3cad6;
    --m-ink-3: #7b869a;
    --m-brand: #4fa3b3;
    --m-brand-contrast: #10151c;
    --m-brand-weak: rgba(79, 163, 179, 0.12);
    --m-border: rgba(255, 255, 255, 0.10);
    --m-divider: rgba(255, 255, 255, 0.06);
    --m-chip-border: rgba(255, 255, 255, 0.14);
    --m-chip-ink: #98a2b3;
    --m-chip-active-bg: #e8ebf2;
    --m-chip-active-ink: #10151c;
    --m-daybar-bg: rgba(255, 255, 255, 0.04);
    --m-tab-inactive: #7b869a;
    --m-shadow-card: none;
  }
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-0: #10151c;
  --bg-1: #171d26;
  --bg-2: #1b2230;
  --surface-card: #171d26;
  --surface-card-hover: #1b2230;
  --sidebar-bg: #0c1117;
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --text-0: #e8ebf2;
  --text-1: #98a2b3;
  --text-2: #7b869a;
  --text-3: #5c6672;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.06);
  --theme-accent: #4fa3b3;
  --theme-accent-rgb: 79, 163, 179;
  --theme-accent-hover: #6cb8c6;
  --theme-accent-fg: #6cb8c6;
  --accent-cyan-fg: #6cb8c6;
  --accent-subtle: rgba(79, 163, 179, 0.12);
  --page-bg-solid: #10151c;
  --m-bg: #10151c;
  --m-surface: #171d26;
  --m-ink: #e8ebf2;
  --m-brand: #4fa3b3;
}

[data-theme="light"] {
  color-scheme: light;
}
