/* ==========================================================================
   MDFree Website Design Tokens
   - Editorial minimalism & crisp motion curves benchmarked against Typora
   - App preview themes sourced verbatim from docs/05.UIDesign/01.DesignTokens.md
   ========================================================================== */

:root {
  /* Page Surface & Text (Typora-inspired crisp paper & ink) */
  --page-bg: #ffffff;
  --page-bg-subtle: #fafbfc;
  --page-bg-muted: #f4f6f8;
  --page-surface: #ffffff;
  --page-border: #eceef1;
  --page-border-strong: #d5dae0;

  --text-primary: #1f2328;
  --text-body: #383d44;
  --text-secondary: #5f6771;
  --text-muted: #868e98;

  /* Restrained Ink CTA & Accent */
  --btn-primary-bg: #24292f;
  --btn-primary-hover: #111418;
  --btn-primary-text: #ffffff;
  --btn-secondary-border: #cfd5dc;
  --btn-secondary-hover-bg: #f6f8fa;
  --accent-link: #0969da;
  --accent-link-hover: #0550ae;
  --accent-soft: #eef5ff;

  /* Status & Changelog Tag Colors */
  --tag-added-bg: #eaf6ee;
  --tag-added-text: #1a7f37;
  --tag-improved-bg: #eef5ff;
  --tag-improved-text: #0969da;
  --tag-fixed-bg: #f3effe;
  --tag-fixed-text: #6639ba;
  --tag-notes-bg: #fdf6e7;
  --tag-notes-text: #9a6700;

  /* Typography */
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia,
    "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, "Liberation Mono", monospace;

  /* Layout & Spacing */
  --nav-height: 62px;
  --container-narrow: 720px;
  --container-default: 1000px;
  --container-wide: 1120px;
  --section-py: 108px;
  --section-py-compact: 76px;
  --section-py-mobile: 64px;

  /* Radius & Elevation */
  --radius-sm: 5px;
  --radius-md: 9px;
  --radius-lg: 14px;
  --shadow-window: 0 28px 72px rgba(15, 23, 42, 0.12),
    0 4px 16px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.07);
  --shadow-window-lift: 0 34px 86px rgba(15, 23, 42, 0.15),
    0 6px 20px rgba(15, 23, 42, 0.07), 0 0 0 1px rgba(15, 23, 42, 0.09);
  --shadow-card: 0 2px 10px rgba(15, 23, 42, 0.035);
  --shadow-card-hover: 0 14px 34px rgba(15, 23, 42, 0.085);
  --shadow-modal: 0 28px 72px rgba(15, 23, 42, 0.24);

  /* Typora-Grade Crisp Motion Curves */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-snap: cubic-bezier(0.34, 1.25, 0.64, 1);
  --t-fast: 160ms;
  --t-base: 260ms;
  --t-slow: 480ms;
  --t-reveal: 660ms;
}

/* ==========================================================================
   MDFree Official App Themes (UI-01 Exact Tokens)
   ========================================================================== */

[data-app-theme="bright"] {
  --app-bg: #ffffff;
  --app-sidebar-bg: #fafbfc;
  --app-chrome-bg: #f6f8fa;
  --app-text: #1f2328;
  --app-text-secondary: #59636e;
  --app-heading: #1f2328;
  --app-link: #0969da;
  --app-code-bg: #f6f8fa;
  --app-code-text: #1f2328;
  --app-quote-bar: #d1d9e0;
  --app-rule: #d1d9e0;
  --app-table-head: #f6f8fa;
  --app-table-border: #d1d9e0;
  --app-selection: #add6ff;
  --app-active-block: #f8fafd;
  --app-active-ring: #d0e2ff;
  --app-marker: #8c959f;
  --app-alert-note: #0969da;
  --app-alert-tip: #1a7f37;
  --app-alert-important: #8250df;
  --app-alert-warning: #9a6700;
  --app-alert-caution: #cf222e;
  --app-syn-keyword: #cf222e;
  --app-syn-string: #0a3069;
  --app-syn-comment: #59636e;
  --app-syn-number: #0550ae;
  --app-syn-type: #953800;
  --app-syn-fn: #8250df;
  --app-syn-meta: #6639ba;
}

[data-app-theme="dark"] {
  --app-bg: #0d1117;
  --app-sidebar-bg: #10151c;
  --app-chrome-bg: #161b22;
  --app-text: #e6edf3;
  --app-text-secondary: #8b949e;
  --app-heading: #e6edf3;
  --app-link: #58a6ff;
  --app-code-bg: #161b22;
  --app-code-text: #e6edf3;
  --app-quote-bar: #3d444d;
  --app-rule: #30363d;
  --app-table-head: #161b22;
  --app-table-border: #30363d;
  --app-selection: #264f78;
  --app-active-block: #131a24;
  --app-active-ring: #264f78;
  --app-marker: #6e7681;
  --app-alert-note: #4493f8;
  --app-alert-tip: #3fb950;
  --app-alert-important: #ab7df8;
  --app-alert-warning: #d29922;
  --app-alert-caution: #f85149;
  --app-syn-keyword: #ff7b72;
  --app-syn-string: #a5d6ff;
  --app-syn-comment: #8b949e;
  --app-syn-number: #79c0ff;
  --app-syn-type: #ffa657;
  --app-syn-fn: #d2a8ff;
  --app-syn-meta: #bc8cff;
}

[data-app-theme="eyecare"] {
  --app-bg: #f4ecd8;
  --app-sidebar-bg: #efe5cc;
  --app-chrome-bg: #eadfc4;
  --app-text: #3b2f1e;
  --app-text-secondary: #6b5b45;
  --app-heading: #2f2414;
  --app-link: #8c4a05;
  --app-code-bg: #eadfc4;
  --app-code-text: #3b2f1e;
  --app-quote-bar: #c9b98f;
  --app-rule: #d9cba6;
  --app-table-head: #eadfc4;
  --app-table-border: #d9cba6;
  --app-selection: #e3cf8e;
  --app-active-block: #efe6cf;
  --app-active-ring: #c9b98f;
  --app-marker: #8c7a5e;
  --app-alert-note: #1f5fa8;
  --app-alert-tip: #2e6b2e;
  --app-alert-important: #6a3fa0;
  --app-alert-warning: #8a5a00;
  --app-alert-caution: #a3271f;
  --app-syn-keyword: #a3271f;
  --app-syn-string: #1f4e79;
  --app-syn-comment: #6b5b45;
  --app-syn-number: #1f5fa8;
  --app-syn-type: #7a3e00;
  --app-syn-fn: #6a3fa0;
  --app-syn-meta: #5a4b9a;
}
