/* =====================================================
   StarSail Studio · 案例展示站
   设计系统：深色优先 / lime+cyan accent / 系统字体栈
   8px 间距体系 / 动效仅 transform+opacity
   ===================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --sans: system-ui, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;
  --radius: 14px;
  --radius-sm: 10px;
  --wrap: 1200px;
  --header-h: 68px;
  --sp: 8px;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0a0e14;
  --surface: #11161f;
  --surface-2: #161d2a;
  --line: #232c3d;
  --ink: #e9eef7;
  --ink-soft: #a7b1c4;
  --ink-faint: #78829a;
  --accent: #a3e635;
  --accent-2: #22d3ee;
  --accent-ink: #0a0e14;
  --grid-line: rgba(163, 230, 53, 0.045);
  --glow: rgba(163, 230, 53, 0.10);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(10, 14, 20, 0.72);
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f6f7f3;
  --surface: #ffffff;
  --surface-2: #eef0e9;
  --line: #e1e5da;
  --ink: #171c26;
  --ink-soft: #49536a;
  --ink-faint: #5f6b84;
  --accent: #4d7c0f;
  --accent-2: #0e7490;
  --accent-ink: #ffffff;
  --grid-line: rgba(23, 28, 38, 0.05);
  --glow: rgba(77, 124, 15, 0.08);
  --shadow: 0 12px 36px rgba(23, 28, 38, 0.10);
  --header-bg: rgba(246, 247, 243, 0.8);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { overflow-x: clip; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

/* 背景网格 + 顶部光晕（fixed 不参与布局，无溢出风险） */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 25%, transparent 74%);
  mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 25%, transparent 74%);
}

body::after {
  content: '';
  position: fixed;
  top: -220px;
  left: 50%;
  width: min(880px, 92vw);
  height: 460px;
  transform: translateX(-50%);
  z-index: -1;
  background: radial-gradient(ellipse at center, var(--glow), transparent 68%);
  pointer-events: none;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- 3. Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.site-header.scrolled { border-bottom-color: var(--line); }

.header-in {
  max-width: var(--wrap);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; flex-shrink: 0; }

.logo-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px;
  font-family: var(--sans);
}

.nav-links { display: flex; gap: 26px; margin-left: 12px; }
.nav-links a { font-size: 14.5px; color: var(--ink-soft); transition: color 0.2s; padding: 8px 0; }
.nav-links a:hover { color: var(--ink); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.icon-btn svg { width: 18px; height: 18px; }

.lang-btn {
  height: 40px;
  min-width: 52px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.lang-btn:hover { color: var(--ink); border-color: var(--ink-faint); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink-faint); }

.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }

/* ---------- 4. Hero ---------- */
.hero { padding: calc(var(--header-h) + 96px) 0 72px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--accent); }

.hero h1 {
  margin: 0 0 22px;
  font-size: clamp(2.5rem, 6.5vw, 4.6rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.015em;
  max-width: 15ch;
}

.grad {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 620px;
  font-size: 17.5px;
  color: var(--ink-soft);
  margin: 0 0 34px;
}

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* stats */
.stats {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
}
.stat {
  padding: 22px 20px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: none; padding-left: 0; }
.stat-value {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 13.5px; color: var(--ink-faint); margin-top: 4px; }

/* ---------- 5. Section 通用 ---------- */
section { padding: 72px 0; }

.sec-head { margin-bottom: 44px; max-width: 640px; }
.sec-head .eyebrow { margin-bottom: 12px; }
.sec-head .eyebrow::before { display: none; }
.sec-head h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.sec-head p { margin: 0; color: var(--ink-soft); font-size: 16px; }

/* ---------- 6. Work 案例区 ---------- */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 32px; }

.chip {
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-family: var(--sans);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chip:hover { color: var(--ink); border-color: var(--ink-faint); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.chip .num { font-family: var(--mono); font-size: 12px; margin-left: 7px; opacity: 0.65; }

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.case-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: opacity 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.work-grid:hover .case-card:not(:hover) { opacity: 0.45; }
.case-card:hover { border-color: var(--ink-faint); }

.case-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
}
.case-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.45s ease;
}
.case-card:hover .case-media img { transform: scale(1.03); }

.case-badge {
  position: absolute;
  top: 12px; left: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(10, 14, 20, 0.72);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.case-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.case-top { display: flex; align-items: baseline; gap: 12px; }
.case-top h3 { margin: 0; font-size: 19px; font-weight: 700; }
.case-client { font-size: 13px; color: var(--ink-faint); margin-left: auto; flex-shrink: 0; }

.case-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.case-tags span {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}

.case-more {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.case-more svg { width: 15px; height: 15px; transition: transform 0.25s ease; }
.case-card:hover .case-more svg { transform: translateX(4px); }

.work-empty { color: var(--ink-faint); font-size: 15px; padding: 32px 0; }

/* ---------- 7. Services ---------- */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.svc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  transition: border-color 0.3s ease;
}
.svc-card:hover { border-color: var(--accent); }
.svc-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--accent);
  margin-bottom: 16px;
}
.svc-icon svg { width: 22px; height: 22px; }
.svc-card h3 { margin: 0 0 8px; font-size: 17.5px; font-weight: 700; }
.svc-card p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* ---------- 8. Process ---------- */
.proc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.proc-step {
  position: relative;
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.proc-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.proc-step h3 { margin: 10px 0 8px; font-size: 16.5px; font-weight: 700; }
.proc-step p { margin: 0; font-size: 13.8px; color: var(--ink-soft); line-height: 1.65; }

/* ---------- 9. Why ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.why-item {
  padding: 26px 28px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.why-item:nth-child(odd) { border-left: none; }
.why-item:nth-child(-n+2) { border-top: none; }
.why-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px;
}
.why-item p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* ---------- 10. CTA ---------- */
.cta-band {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: 64px 28px;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, var(--glow), transparent 70%);
  pointer-events: none;
}
.cta-band h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  position: relative;
}
.cta-band > p { color: var(--ink-soft); margin: 0 0 30px; position: relative; }
.cta-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}
.cta-note { margin-top: 18px; font-size: 13px; color: var(--ink-faint); position: relative; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 16px);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
  max-width: calc(100vw - 48px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 11. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 42px;
  margin-top: 40px;
}
.footer-in {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-in p { margin: 0; color: var(--ink-faint); font-size: 13.5px; }
.footer-links { margin-left: auto; display: flex; gap: 20px; }
.footer-links a { color: var(--ink-faint); font-size: 13.5px; }
.footer-links a:hover { color: var(--ink); }

/* ---------- 12. Case 详情页 ---------- */
.case-hero { padding: calc(var(--header-h) + 64px) 0 36px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 26px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--ink); }
.back-link svg { width: 15px; height: 15px; }

.case-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.case-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--ink-soft); font-size: 14.5px; }
.case-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-faint); }

.case-cover {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  margin: 26px 0 0;
  background: var(--surface-2);
}
.case-cover img { width: 100%; height: auto; }

.case-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 44px 0;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.metric-value {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1.3;
}
.metric-label { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }

.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  align-items: start;
}
.case-main h2 { font-size: 21px; font-weight: 800; margin: 34px 0 14px; }
.case-main h2:first-child { margin-top: 0; }
.case-main .summary { color: var(--ink-soft); font-size: 16px; margin: 0; }

.hl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hl-list li {
  display: flex;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}
.hl-list .check {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--accent);
  display: grid; place-items: center;
  margin-top: 2px;
}
.hl-list .check svg { width: 13px; height: 13px; }

.shot-stack { display: grid; gap: 16px; margin-top: 18px; }
.shot-stack figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.shot-stack img { width: 100%; height: auto; }

.case-side {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: grid;
  gap: 16px;
}
.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.side-card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.side-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.side-tags span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 9px;
}
.side-cta { display: grid; gap: 10px; }

.case-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 64px;
}
.case-nav a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--surface);
  transition: border-color 0.25s ease;
  min-width: 0;
}
.case-nav a:hover { border-color: var(--accent); }
.case-nav .dir { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); display: block; margin-bottom: 6px; }
.case-nav .t { font-weight: 700; font-size: 15px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-nav a:last-child { text-align: right; }

/* ---------- 13. 404 ---------- */
.nf-wrap { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 100px 24px 60px; }
.nf-code { font-family: var(--mono); font-size: 15px; color: var(--accent); letter-spacing: 0.14em; }
.nf-wrap h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 12px 0 14px; font-weight: 800; }
.nf-wrap p { color: var(--ink-soft); margin: 0 0 28px; }

/* ---------- 14. Reveal 动画 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .case-media img, .case-more svg, .btn { transition: none; }
}

/* ---------- 15. 响应式 ---------- */
@media (max-width: 1020px) {
  .nav-links { display: none; }
  .case-layout { grid-template-columns: 1fr; }
  .case-side { position: static; }
}

@media (max-width: 860px) {
  section { padding: 56px 0; }
  .hero { padding: calc(var(--header-h) + 64px) 0 56px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 16px 14px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .stat:nth-child(odd) { border-left: none; padding-left: 0; }
  .stat:nth-child(-n+2) { border-top: none; }
  .work-grid { grid-template-columns: 1fr; }
  .svc-grid { grid-template-columns: 1fr; }
  .proc-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; }
  .why-item { border-left: none; }
  .why-item:not(:first-child) { border-top: 1px solid var(--line); }
  .case-nav { grid-template-columns: 1fr; }
  .case-nav a:last-child { text-align: left; }
  .case-metrics { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .header-in { padding: 0 18px; gap: 10px; }
  .proc-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { flex: 1 1 auto; }
  .cta-band { padding: 48px 20px; }
  .case-top { flex-wrap: wrap; }
  .case-client { margin-left: 0; flex-basis: 100%; }
}
