/* =========================================================
   好好云 · Design System — Cyberpunk 3.0 (bright)
   Tokens, base elements, typography, primitives.
   ========================================================= */
:root {
  /* Surfaces: pearl / silver tech space */
  --c-bg: #f3f7fb;
  --c-bg-2: #e9f0f8;
  --c-bg-3: #dde7f2;
  --c-surface: rgba(255, 255, 255, .74);
  --c-surface-solid: #ffffff;
  --c-surface-strong: rgba(255, 255, 255, .9);
  --c-line: rgba(80, 122, 170, .18);
  --c-line-strong: rgba(47, 168, 255, .45);

  /* Ink */
  --c-ink: #0a1a30;
  --c-ink-2: #34465f;
  --c-ink-3: #5f7189;
  --c-ink-inv: #eaf6ff;

  /* Signal colors */
  --c-ice: #1f9bff;
  --c-ice-2: #4fc3ff;
  --c-cyan: #00c8f0;
  --c-navy: #0d2140;
  --c-navy-2: #06101f;
  --c-teal: #12b8a6;
  --c-violet: #7c4dff;
  --c-gold: #e9a21c;
  --c-danger: #e5484d;
  --c-ok: #10a37f;

  /* Plan accents */
  --plan-blue: #1f8bff;
  --plan-purple: #8b5cf6;
  --plan-teal: #14c8b4;
  --plan-gold: #f0a91e;

  /* Gradients */
  --g-ice: linear-gradient(120deg, #1f9bff 0%, #00c8f0 55%, #6ef0d8 100%);
  --g-ink: linear-gradient(120deg, #0a1a30 0%, #1d4a8a 60%, #1f9bff 100%);
  --g-glass: linear-gradient(160deg, rgba(255,255,255,.92), rgba(255,255,255,.62));
  --g-fiber: linear-gradient(90deg, transparent, #4fc3ff 30%, #00c8f0 50%, #4fc3ff 70%, transparent);

  /* Type */
  --f-sans: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --fs-xs: .78rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
  --fs-2xl: clamp(1.6rem, 1.3rem + 1.3vw, 2.25rem);
  --fs-3xl: clamp(2rem, 1.5rem + 2.4vw, 3.25rem);
  --fs-hero: clamp(2.35rem, 1.6rem + 3.6vw, 4.6rem);
  --lh-tight: 1.15;
  --lh-body: 1.8;

  /* Space & shape */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem; --s-9: 6.5rem;
  --r-sm: 8px; --r-md: 14px; --r-lg: 22px; --r-xl: 30px; --r-pill: 999px;
  --container: 1240px;
  --container-narrow: 820px;
  --header-h: 68px;

  /* Elevation */
  --sh-1: 0 1px 2px rgba(15, 45, 90, .06), 0 4px 14px rgba(15, 45, 90, .06);
  --sh-2: 0 10px 30px rgba(20, 60, 120, .10), 0 2px 6px rgba(20, 60, 120, .06);
  --sh-3: 0 24px 60px rgba(20, 60, 120, .16);
  --sh-glow: 0 0 0 1px rgba(47,168,255,.35), 0 12px 40px rgba(31,155,255,.25);

  /* Motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --t-fast: .18s;
  --t-med: .45s;
  --t-slow: .9s;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--c-ink);
  background: var(--c-bg);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--c-ice); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #0b6fd0; }
h1, h2, h3, h4 { line-height: var(--lh-tight); margin: 0 0 var(--s-4); letter-spacing: -.01em; color: var(--c-ink); }
h1 { font-size: var(--fs-3xl); font-weight: 800; }
h2 { font-size: var(--fs-2xl); font-weight: 800; }
h3 { font-size: var(--fs-xl); font-weight: 700; }
h4 { font-size: var(--fs-lg); font-weight: 700; }
p { margin: 0 0 var(--s-4); }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.3em; }
table { border-collapse: collapse; width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(31, 155, 255, .22); }

:focus-visible { outline: 3px solid var(--c-ice); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  background: var(--c-navy); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  transition: top var(--t-fast);
}
.skip-link:focus { top: 12px; color: #fff; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.container--narrow { width: min(100% - 2.5rem, var(--container-narrow)); margin-inline: auto; }

/* ---------- Primitives ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--f-mono); font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase;
  color: var(--c-ice); font-weight: 600; margin-bottom: var(--s-3);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--g-ice); border-radius: 2px; box-shadow: 0 0 10px rgba(0,200,240,.6); }
.eyebrow__code { color: var(--c-ink-3); }

.lead { font-size: var(--fs-lg); color: var(--c-ink-2); max-width: 62ch; }
.muted { color: var(--c-ink-3); }
.small { font-size: var(--fs-sm); }
.mono { font-family: var(--f-mono); }

.text-gradient { background: var(--g-ink); -webkit-background-clip: text; background-clip: text; color: transparent; }
.text-ice { background: var(--g-ice); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Buttons */
.btn {
  --btn-bg: var(--c-surface-solid); --btn-fg: var(--c-ink); --btn-bd: var(--c-line);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .75em 1.4em; border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-weight: 700; font-size: var(--fs-md); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-med) var(--ease-out), background var(--t-med);
  isolation: isolate; overflow: hidden;
}
.btn:hover { color: var(--btn-fg); box-shadow: var(--sh-2); }
.btn:active { transform: scale(.97); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn--primary { --btn-bg: var(--c-navy); --btn-fg: #fff; --btn-bd: transparent; box-shadow: 0 10px 30px rgba(13, 33, 64, .25); }
.btn--primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--g-ice); opacity: 0; transition: opacity var(--t-med);
}
.btn--primary:hover::before { opacity: 1; }
.btn--primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg); transition: left .7s var(--ease-out);
}
.btn--primary:hover::after { left: 120%; }
.btn--ghost { --btn-bg: rgba(255,255,255,.55); --btn-bd: var(--c-line-strong); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn--sm { min-height: 40px; padding: .5em 1.1em; font-size: var(--fs-sm); }
.btn--block { width: 100%; }

/* Chips & badges */
.chip {
  display: inline-flex; align-items: center; gap: .4em; padding: .3em .8em; border-radius: var(--r-pill);
  background: rgba(31,155,255,.08); color: #0b5fb0; border: 1px solid rgba(31,155,255,.22);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.5;
}
.chip--brand { background: rgba(233,162,28,.10); color: #8a5a00; border-color: rgba(233,162,28,.35); }
.chip--editorial { background: rgba(18,184,166,.10); color: #0b6f64; border-color: rgba(18,184,166,.3); }
.chip--pending { background: rgba(95,113,137,.1); color: var(--c-ink-2); border-color: rgba(95,113,137,.3); }

/* Glass panel with HUD corners */
.panel {
  position: relative; background: var(--g-glass); border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--r-lg); box-shadow: var(--sh-1), inset 0 0 0 1px rgba(80,122,170,.08);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.hud { position: relative; }
.hud::before, .hud::after {
  content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none;
  border: 2px solid var(--c-ice-2); opacity: .7;
}
.hud::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.hud::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }

/* Notice */
.notice {
  display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md); background: rgba(255,255,255,.75); border: 1px solid var(--c-line);
  border-left: 4px solid var(--c-ice); font-size: var(--fs-sm); color: var(--c-ink-2);
}
.notice strong { color: var(--c-ink); }
.notice--warn { border-left-color: var(--c-gold); }
.notice p:last-child { margin-bottom: 0; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--c-line); background: var(--c-surface-strong); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline-offset: 2px; }
.data-table { font-size: var(--fs-sm); min-width: 640px; }
.data-table th, .data-table td { padding: .85em 1em; text-align: left; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.data-table thead th { background: linear-gradient(180deg, #f6faff, #ebf3fb); font-weight: 700; color: var(--c-ink); white-space: nowrap; position: sticky; top: 0; }
.data-table tbody tr:hover { background: rgba(31,155,255,.04); }
.data-table tbody th { font-weight: 700; white-space: nowrap; }
.data-table caption { caption-side: bottom; text-align: left; padding: .8em 1em; color: var(--c-ink-3); font-size: var(--fs-xs); }

/* Forms */
.field { display: grid; gap: .4em; }
.field label, .field legend { font-weight: 700; font-size: var(--fs-sm); color: var(--c-ink); }
.field small { color: var(--c-ink-3); font-size: var(--fs-xs); }
.input, .select {
  width: 100%; min-height: 46px; padding: .6em .9em; border-radius: var(--r-sm);
  background: #fff; border: 1px solid rgba(80,122,170,.3); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .select:focus { outline: none; border-color: var(--c-ice); box-shadow: 0 0 0 4px rgba(31,155,255,.15); }
.range { width: 100%; accent-color: var(--c-ice); }
.seg { display: flex; flex-wrap: wrap; gap: .5em; border: 0; padding: 0; margin: 0; }
.seg legend { margin-bottom: .5em; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  display: inline-flex; align-items: center; min-height: 40px; padding: .4em 1em; border-radius: var(--r-pill);
  border: 1px solid rgba(80,122,170,.3); background: #fff; cursor: pointer; font-weight: 600; font-size: var(--fs-sm);
  transition: all var(--t-fast);
}
.seg input:checked + label { background: var(--c-navy); color: #fff; border-color: var(--c-navy); box-shadow: 0 6px 18px rgba(13,33,64,.2); }
.seg input:focus-visible + label { outline: 3px solid var(--c-ice); outline-offset: 2px; }
