/* ============================================================
   中信科大 Design System — Tokens (pulled from claude.ai/design)
   來源專案:「中信科大 Design System」(dfd40bb5)
   內容 = fonts + colors + typography + spacing + base 五層逐字合併。
   勿手改數值;設計變更請回 claude.ai/design 改後重新 pull。
   ============================================================ */

/* ---- Webfonts (Google Fonts CDN) ----------------------- */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@400;600;700;900&family=Noto+Sans+TC:wght@400;500;700;900&display=swap');

/* ============================================================
   Color Tokens
   Brand palette derived from official background colors:
   #247C7E (primary), #276D7E, #007C7C, #1A8DAA
   Accent: the red "ball" (紅球) of the logo lockup.
   ============================================================ */
:root {
  /* ---- Brand teal scale ---------------------------------- */
  --teal-50:  #ECF5F4;
  --teal-100: #D2E8E7;
  --teal-200: #A6D2D1;
  --teal-300: #6FB4B4;
  --teal-400: #1A8DAA;   /* bright cyan-teal — info / links */
  --teal-500: #007C7C;   /* pure teal */
  --teal-600: #247C7E;   /* PRIMARY brand teal */
  --teal-700: #276D7E;   /* deep teal */
  --teal-800: #1B585C;
  --teal-900: #143E42;   /* darkest, near-ink teal */

  /* ---- Logo red (紅球) accent ---------------------------- */
  --red-50:  #FCEDEE;
  --red-100: #F7D2D6;
  --red-300: #E78088;
  --red-500: #D32430;
  --red-600: #C8102E;   /* the ball red */
  --red-700: #A50C25;

  /* ---- Honor gold (sparingly: seals, awards) ------------- */
  --gold-300: #E4C977;
  --gold-500: #C29A3B;
  --gold-700: #8E6F22;

  /* ---- Neutrals (warm-cool, faintly teal-tinted ink) ----- */
  --ink-900: #14201F;   /* primary text */
  --ink-800: #25302F;
  --ink-700: #3A4544;
  --ink-600: #54605F;
  --ink-500: #6E7A79;
  --ink-400: #97A1A0;
  --ink-300: #C2C9C8;
  --ink-200: #DFE4E3;
  --ink-100: #ECEFEE;
  --ink-50:  #F5F7F6;

  /* ---- Paper & pure ------------------------------------- */
  --paper:    #FAF8F3;   /* warm academic paper */
  --white:    #FFFFFF;
  --black:    #0B1413;

  /* ---- Semantic raw ------------------------------------- */
  --green-success: #2E8B57;
  --amber-warning: #C98A12;
  --blue-info:     #1A8DAA;
  --red-danger:    #C8102E;

  /* Text */
  --text-primary:    var(--ink-900);
  --text-secondary:  var(--ink-600);
  --text-tertiary:   var(--ink-400);
  --text-inverse:    var(--white);
  --text-brand:      var(--teal-600);
  --text-link:       var(--teal-700);
  --text-accent:     var(--red-600);

  /* Surfaces */
  --surface-page:    var(--paper);
  --surface-card:    var(--white);
  --surface-sunken:  var(--ink-50);
  --surface-brand:   var(--teal-600);
  --surface-brand-deep: var(--teal-900);
  --surface-accent:  var(--red-600);
  --surface-tint:    var(--teal-50);

  /* Borders */
  --border-subtle:   var(--ink-200);
  --border-default:  var(--ink-300);
  --border-strong:   var(--ink-400);
  --border-brand:    var(--teal-600);

  /* Interactive */
  --action-primary:        var(--teal-600);
  --action-primary-hover:  var(--teal-700);
  --action-primary-press:  var(--teal-800);
  --action-accent:         var(--red-600);
  --action-accent-hover:   var(--red-700);
  --focus-ring:            var(--teal-400);

  /* Feedback */
  --feedback-success: var(--green-success);
  --feedback-warning: var(--amber-warning);
  --feedback-info:    var(--blue-info);
  --feedback-danger:  var(--red-danger);
}

/* ============================================================
   Typography Tokens
   Hybrid: serif display + sans body, bilingual TC / EN.
   ============================================================ */
:root {
  /* ---- Families ----------------------------------------- */
  --font-serif: "Source Serif 4", "Noto Serif TC", "Songti TC", Georgia, serif;
  --font-sans:  "Source Sans 3", "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  --font-mono:  "JetBrains Mono", "Noto Sans TC", ui-monospace, monospace;

  /* Semantic role families */
  --font-display: var(--font-serif);
  --font-heading: var(--font-serif);
  --font-body:    var(--font-sans);
  --font-ui:      var(--font-sans);
  --font-data:    var(--font-mono);

  /* ---- Type scale (1.250 major-third, 16px base) -------- */
  --text-2xs:  11px;
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-md:   18px;
  --text-lg:   20px;
  --text-xl:   25px;
  --text-2xl:  31px;
  --text-3xl:  39px;
  --text-4xl:  49px;
  --text-5xl:  61px;
  --text-6xl:  76px;

  /* ---- Weights ------------------------------------------ */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-black:    900;

  /* ---- Line heights ------------------------------------- */
  --leading-tight:   1.12;
  --leading-snug:    1.28;
  --leading-normal:  1.5;
  --leading-relaxed: 1.7;

  /* ---- Letter spacing ----------------------------------- */
  --tracking-tight:  -0.02em;
  --tracking-snug:   -0.01em;
  --tracking-normal: 0;
  --tracking-wide:   0.04em;
  --tracking-caps:   0.12em;   /* eyebrows / labels */
}

/* ============================================================
   Spacing, Radii, Shadows, Borders, Layout
   4px base grid. Modest academic radii, restrained shadows.
   ============================================================ */
:root {
  /* ---- Spacing scale (4px base) ------------------------- */
  --space-0:   0;
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   20px;
  --space-6:   24px;
  --space-8:   32px;
  --space-10:  40px;
  --space-12:  48px;
  --space-16:  64px;
  --space-20:  80px;
  --space-24:  96px;
  --space-32:  128px;

  /* ---- Radii (restrained, institutional) ---------------- */
  --radius-xs:   3px;
  --radius-sm:   5px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   18px;
  --radius-2xl:  26px;
  --radius-pill: 999px;
  --radius-circle: 50%;

  /* ---- Border widths ------------------------------------ */
  --border-hair: 1px;
  --border-thin: 1.5px;
  --border-thick: 2px;
  --border-accent: 3px;

  /* ---- Shadows (soft, low, cool-tinted) ----------------- */
  --shadow-xs:  0 1px 2px rgba(20, 32, 31, 0.06);
  --shadow-sm:  0 1px 3px rgba(20, 32, 31, 0.08), 0 1px 2px rgba(20, 32, 31, 0.04);
  --shadow-md:  0 4px 10px rgba(20, 32, 31, 0.08), 0 2px 4px rgba(20, 32, 31, 0.05);
  --shadow-lg:  0 12px 28px rgba(20, 32, 31, 0.12), 0 4px 8px rgba(20, 32, 31, 0.06);
  --shadow-xl:  0 24px 50px rgba(20, 32, 31, 0.16);
  --shadow-brand: 0 10px 28px rgba(36, 124, 126, 0.28);
  --shadow-inset: inset 0 1px 2px rgba(20, 32, 31, 0.08);

  /* ---- Layout ------------------------------------------- */
  --container-sm:  640px;
  --container-md:  840px;
  --container-lg:  1080px;
  --container-xl:  1280px;
  --container-2xl: 1440px;
  --gutter:        24px;
  --header-height: 72px;

  /* ---- Motion ------------------------------------------- */
  --ease-standard: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-out:      cubic-bezier(0.16, 0.84, 0.44, 1);
  --ease-in:       cubic-bezier(0.45, 0, 0.55, 0.2);
  --dur-fast:   120ms;
  --dur-base:   200ms;
  --dur-slow:   320ms;

  /* ---- Z-index ------------------------------------------ */
  --z-base:    0;
  --z-sticky:  100;
  --z-overlay: 500;
  --z-modal:   1000;
  --z-toast:   1500;
}

/* ============================================================
   Base element defaults
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-snug);
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

p { margin: 0 0 var(--space-4); text-wrap: pretty; }

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-standard);
}

@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--action-primary-hover); }
}

strong { font-weight: var(--weight-semibold); }

code, kbd, samp { font-family: var(--font-mono); font-size: 0.9em; }

hr {
  border: none;
  border-top: var(--border-hair) solid var(--border-subtle);
  margin: var(--space-8) 0;
}

::selection { background: var(--teal-100); color: var(--teal-900); }

:focus-visible {
  outline: var(--border-thick) solid var(--focus-ring);
  outline-offset: 2px;
}

/* Eyebrow / label utility used across the system */
.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-brand);
}
