/* ============================================================
   Cron Studio — 样式
   ============================================================ */

:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --surface-3: #e8ebf4;
  --border: #e1e5ef;
  --border-strong: #cdd4e4;
  --text: #0f172a;
  --muted: #5b667c;
  --muted-2: #5f6a80;
  --accent: #4f46e5;
  --accent-ink: #4338ca;
  --accent-solid: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-border: #c9cdfb;
  --on-accent: #ffffff;
  --success: #0f9d6e;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 18px 40px -22px rgba(15, 23, 42, .25);
  --radius: 18px;
  --radius-sm: 12px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #080b14;
  --surface: #0f1524;
  --surface-2: #161d30;
  --surface-3: #1e2740;
  --border: #232c44;
  --border-strong: #33405f;
  --text: #e7ecf8;
  --muted: #9aa6bf;
  --muted-2: #7d8aa5;
  --accent: #8d97ff;
  --accent-ink: #aab3ff;
  --accent-solid: #5b5bf0;
  --accent-hover: #6d6df7;
  --accent-soft: rgba(109, 109, 247, .14);
  --accent-border: rgba(129, 140, 248, .4);
  --on-accent: #ffffff;
  --success: #34d399;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 24px 48px -24px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 620px;
  background:
    radial-gradient(48% 60% at 18% 10%, rgba(99, 102, 241, .16), transparent 70%),
    radial-gradient(42% 55% at 82% 0%, rgba(14, 165, 233, .12), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

html[data-theme="dark"] body::before {
  background:
    radial-gradient(48% 60% at 18% 10%, rgba(99, 102, 241, .22), transparent 70%),
    radial-gradient(42% 55% at 82% 0%, rgba(14, 165, 233, .14), transparent 72%);
}

::selection { background: var(--accent-soft); color: var(--accent-ink); }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

code, .mono { font-family: var(--mono); }

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

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 100;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

#generator, #quick-ref, #guide { scroll-margin-top: 84px; }

.noscript {
  max-width: 1180px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ---------------- Header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(140deg, #6366f1, #4338ca 70%);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .8);
  flex: none;
}
.brand-mark svg { width: 22px; height: 22px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15.5px; letter-spacing: -.01em; }
.brand-text em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.header-nav { display: flex; align-items: center; gap: 6px; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
#githubLink[hidden] { display: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 37px; height: 37px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .icon-sun { display: none; }
html[data-theme="dark"] .icon-btn .icon-sun { display: block; }
html[data-theme="dark"] .icon-btn .icon-moon { display: none; }

/* ---------------- Hero ---------------- */

.hero { padding-top: 54px; padding-bottom: 26px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 5px 12px 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.eyebrow .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.05rem, 4.6vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.1;
  background: linear-gradient(115deg, var(--text) 15%, var(--accent-ink) 60%, #0ea5e9 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 660px;
  margin: 16px 0 0;
  font-size: clamp(14.5px, 1.6vw, 16.5px);
  line-height: 1.75;
  color: var(--muted);
}

/* ---------------- Layout ---------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: 20px;
  align-items: start;
  padding-bottom: 6px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel { padding: 22px 22px 24px; min-width: 0; }

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------------- Segmented / buttons ---------------- */

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 9px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm), 0 1px 0 rgba(255, 255, 255, .06) inset;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { border-color: var(--accent-border); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { flex: none; }

.btn-primary {
  background: var(--accent-solid);
  border-color: transparent;
  color: var(--on-accent);
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .9);
}
.btn-primary:hover { background: var(--accent-hover); border-color: transparent; }

.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color .15s ease, text-decoration-color .15s ease;
}
.link-btn:hover { color: var(--accent-ink); text-decoration-color: currentColor; }

/* ---------------- Presets ---------------- */

.preset-wrap { position: relative; }

.preset-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 300px;
  max-width: min(300px, 82vw);
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 30;
}

.preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}
.preset-item:hover { background: var(--accent-soft); }
.preset-item code {
  font-size: 12px;
  color: var(--accent-ink);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 5px;
}
.preset-item:hover code { background: transparent; }

/* ---------------- Expression ---------------- */

.expr-box {
  margin-top: 18px;
  padding: 12px 14px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.expr-box.is-invalid { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }

.expr-main { display: flex; align-items: center; gap: 10px; min-width: 0; }

.prompt {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  user-select: none;
}

.expr-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 0;
  border: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text);
  outline: none;
}
.expr-input::placeholder { color: var(--muted-2); font-weight: 400; }

#copyBtn { height: 34px; padding: 0 13px; font-size: 12.5px; flex: none; }

.expr-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.expr-help { font-size: 11.5px; color: var(--muted-2); }
.expr-help code {
  font-size: 11px;
  background: var(--surface-3);
  padding: 1px 4px;
  border-radius: 4px;
}
.expr-tools-right { display: flex; gap: 14px; }

.expr-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 10px 0 2px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--danger);
}
.expr-error::before { content: "⚠"; }

html[data-theme="dark"] .expr-error { color: #fca5a5; }

/* ---------------- Field cards ---------------- */

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 9px;
  margin-top: 18px;
}

.field-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  min-width: 0;
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.field-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -12px rgba(79, 70, 229, .55);
}
.field-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}
.field-label .field-step {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--muted-2);
}

.field-token {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.field-card.is-active .field-token { color: var(--accent-ink); }

.field-hint {
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-note {
  margin: 9px 0 0;
  font-size: 11.5px;
  color: var(--muted-2);
}
.field-note b { color: var(--muted); font-weight: 600; }

.field-grid.is-stale { opacity: .5; filter: saturate(.6); }
.field-grid { transition: opacity .15s ease; }

/* ---------------- Field editor ---------------- */

.field-editor {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--accent-border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 70%),
    var(--surface);
  animation: editor-in .18s ease;
}

@keyframes editor-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.editor-head strong { font-size: 14px; }
.editor-head .editor-range {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted-2);
  margin-left: 8px;
  font-weight: 400;
}
.editor-close {
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}
.editor-close:hover { background: var(--surface-2); color: var(--text); }

.mode-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.mode-pill {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  transition: all .12s ease;
}
.mode-pill:hover { border-color: var(--accent-border); color: var(--text); }
.mode-pill.is-active {
  background: var(--accent-solid);
  border-color: transparent;
  color: var(--on-accent);
}

.editor-body { margin-top: 12px; min-height: 44px; }

.editor-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}
.editor-note code {
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.inline-inputs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.num-input {
  width: 76px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  text-align: center;
}
.num-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }

.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 5px;
  max-height: 176px;
  overflow-y: auto;
  padding: 2px;
}

.chip-grid.chips-month { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); }

.chips-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: var(--muted-2);
}
.chips-bar b { color: var(--accent-ink); font-family: var(--mono); }
.chip-grid.chips-dow { grid-template-columns: repeat(7, minmax(38px, 1fr)); }

.chip {
  height: 31px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  transition: all .1s ease;
}
.chip:hover { border-color: var(--accent-border); color: var(--text); }
.chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.editor-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px dashed var(--border-strong);
  font-size: 12px;
  color: var(--muted-2);
}
.editor-preview code {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-ink);
}

/* ---------------- Summary ---------------- */

.summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--accent-border);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 85%);
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}

.summary-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.summary-text {
  margin: 3px 0 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

/* ---------------- Runs ---------------- */

.runs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.runs-head h2 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }

.runs-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-left: auto;
}
.control { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.select-label { font-size: 11.5px; color: var(--muted); font-weight: 500; }

.select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  max-width: 210px;
}
#countSelect { padding-right: 4px; }

.icon-btn.small { width: 30px; height: 32px; border: 1px solid var(--border-strong); border-radius: 8px; }
.icon-btn.small:hover { background: var(--surface-2); }

.runs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 5px; }

.run {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13.5px;
  transition: border-color .12s ease, background .12s ease;
}
.run:hover { border-color: var(--accent-border); background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface)); }

.run-index {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10.5px;
}

.run-time {
  font-family: var(--mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.run-time .run-weekday { font-family: var(--sans); font-size: 12px; color: var(--muted-2); margin-left: 8px; }

.run-rel {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.run-rel.is-today { color: #046c4e; background: #e8f5ef; }

html[data-theme="dark"] .run-rel.is-today { color: #6ee7b7; background: rgba(52, 211, 153, .14); }

.runs-empty {
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-2);
}

.runs-foot { margin: 10px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted-2); }

/* ---------------- Export ---------------- */

.export {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.export-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.text-input {
  height: 38px;
  width: 100%;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
}
.text-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.text-input::placeholder { color: var(--muted-2); font-family: var(--sans); }
#downloadBtn { height: 38px; }

/* ---------------- Sidebar ---------------- */

.side {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 86px;
  min-width: 0;
}

.mini { padding: 18px; }

.mini h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.mini h2::before {
  content: "";
  width: 3px; height: 13px;
  border-radius: 2px;
  background: var(--accent);
}

.ref-list { list-style: none; margin: 0; padding: 0; }
.ref-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
}
.ref-list li:last-child { border-bottom: 0; }
.ref-list code {
  flex: none;
  min-width: 62px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
}
.ref-list span { color: var(--muted); }

.ref-foot {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.ref-foot code { font-size: 10.5px; letter-spacing: -.02em; }
.badge {
  flex: none;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 9.5px;
  font-weight: 700;
}

.example-list { display: grid; gap: 6px; }

.example {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  text-align: left;
  transition: border-color .12s ease, background .12s ease;
}
.example:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.example code { font-size: 11.5px; font-weight: 600; color: var(--text); }
.example span { font-size: 11px; color: var(--muted-2); white-space: nowrap; }

.tip-card p { margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--muted); }

/* ---------------- Article ---------------- */

.article-wrap { padding-top: 30px; padding-bottom: 8px; }

.article { padding: 30px 32px 34px; }

.article h2 {
  margin: 0 0 12px;
  font-size: 21px;
  letter-spacing: -.02em;
}

.article h3 {
  margin: 30px 0 10px;
  font-size: 15.5px;
  letter-spacing: -.01em;
}

.article p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
}

.article code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--text);
  white-space: nowrap;
}

.table-scroll {
  margin: 16px 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
}

.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table th {
  padding: 9px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.spec-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.spec-table td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }

.prose-list { margin: 0 0 12px; padding-left: 20px; }
.prose-list li { margin: 6px 0; font-size: 13.5px; line-height: 1.8; color: var(--muted); }

.article details {
  margin-top: 10px;
  padding: 11px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.article summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.article details p { margin: 8px 0 0; font-size: 13px; }

/* ---------------- Footer / toast ---------------- */

.site-footer {
  margin-top: 36px;
  border-top: 1px solid var(--border);
  padding: 22px 0 36px;
  font-size: 12.5px;
  color: var(--muted-2);
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-meta a { font-weight: 500; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 14px);
  z-index: 80;
  padding: 10px 18px;
  border-radius: 999px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 14px 32px -12px rgba(15, 23, 42, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
html[data-theme="dark"] .toast { background: #e7ecf8; color: #0f172a; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- Responsive ---------------- */

@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tip-card { display: none; }
  .panel { padding: 20px; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .header-inner { height: 60px; }
  .nav-link { display: none; }
  .nav-link.cross-link { display: inline-flex; padding: 6px 8px; font-size: 12.5px; }
  #githubLink { display: none !important; }
  .hero { padding: 34px 0 20px; }
  .panel { padding: 16px; }
  .side { grid-template-columns: 1fr; }
  .article { padding: 22px 20px 26px; }
  .article-wrap { padding-top: 22px; }
  .export { grid-template-columns: 1fr; }
  #downloadBtn { width: 100%; }
  .runs-controls { width: 100%; margin-left: 0; }
  .runs-head { align-items: flex-start; }
  .runs-head h2 { width: 100%; }
  .control:first-child { flex: 1 1 100%; }
  .control:first-child .select { flex: 1 1 auto; max-width: none; }
  .control .select { min-width: 0; }
  .control:not(:first-child) { flex: 0 0 auto; }
  #countSelect { padding-right: 4px; }
  .expr-input { font-size: 16px; }
  .expr-main { gap: 8px; }
  .field-token { font-size: 14.5px; }
  .chip-grid { max-height: 210px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .brand-text em { display: none; }
  .expr-tools { align-items: flex-start; flex-direction: column; }
  .expr-tools-right { width: 100%; justify-content: flex-end; }
  .run { grid-template-columns: 24px minmax(0, 1fr); row-gap: 4px; }
  .run-rel { grid-column: 2; justify-self: start; }
  .run-time { font-size: 12.5px; }
}

@media (max-width: 380px) {
  .header-inner { gap: 6px; }
  .header-nav { gap: 1px; }
  .nav-link.cross-link { padding: 5px 6px; font-size: 11.5px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text strong { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
