@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700;900&family=Inter:wght@400;500;600;700;800&display=swap');

/* ══════════════════════════════════════════════
   Design Tokens — aligned with main index.html
══════════════════════════════════════════════ */
:root {
  --bg:           #f5f4f0;
  --bg2:          #efede8;
  --panel:        #ffffff;
  --ink:          #111111;
  --ink2:         #333333;
  --muted:        #777777;
  --line:         #e0ddd6;
  --line2:        #cccac4;
  --blue:         #2563eb;
  --cyan:         #0891b2;
  --green:        #059669;
  --amber:        #d97706;
  --red:          #dc2626;
  --shadow:       0 4px 20px rgba(0,0,0,.07);
  --shadow-md:    0 12px 40px rgba(0,0,0,.10);
  --shadow-lg:    0 24px 64px rgba(0,0,0,.12);
  --radius:       10px;
  --radius-lg:    16px;
  --font-display: 'Noto Serif SC', 'PingFang SC', Georgia, serif;
  --font-body:    'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a  { color: inherit; text-decoration: none; }
p  { margin: 0; color: var(--muted); }
h1 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
h2 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.14; letter-spacing: -0.02em; }
h3 { margin: 0; font-family: var(--font-body); font-weight: 700; line-height: 1.25; }

/* ── Top navigation bar ────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245,244,240,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
}

.brand img { width: 80px; height: auto; display: block; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-links a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1.5px solid var(--line2);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  transition: background .18s, border-color .18s;
}
.nav-links a:hover { background: var(--bg2); border-color: transparent; }
.nav-links a.active { background: var(--ink); color: #fff; border-color: transparent; }

/* ── Page wrapper ───────────────────────────── */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px 22px 80px;
}

/* ── Case Hero Card ─────────────────────────── */
.case-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(340px, 1fr);
  gap: 28px;
  align-items: stretch;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Top accent line */
.case-hero::before {
  content: "";
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ink), var(--ink2) 60%, var(--line));
}

.case-hero > * { position: relative; z-index: 1; }

/* Eyebrow */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  font-family: var(--font-body);
}

h1 { font-size: clamp(30px, 4.5vw, 52px); max-width: 680px; }

.lead {
  margin-top: 16px;
  color: var(--ink2);
  font-size: 17px;
  max-width: 640px;
  line-height: 1.65;
}

/* Tag pills */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg2);
  color: var(--ink2);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
}

.pill.green  { color: #065f46; background: #ecfdf5; border-color: #a7f3d0; }
.pill.amber  { color: #92400e; background: #fffbeb; border-color: #fcd34d; }
.pill.blue   { color: #1e40af; background: #eff6ff; border-color: #bfdbfe; }

/* ── Media panel (video / image) ────────────── */
.media-panel {
  min-height: 380px;
  border: 1px solid #1a2233;
  border-radius: var(--radius);
  background: #0d1117;
  box-shadow: 0 16px 48px rgba(0,0,0,.22);
  overflow: hidden;
}

.media-panel video {
  width: 100%;
  height: 100%;
  min-height: 380px;
  display: block;
  object-fit: contain;
  background: #0d1117;
}

.media-panel img {
  width: 100%;
  height: 100%;
  min-height: 380px;
  display: block;
  object-fit: cover;
}

.media-placeholder {
  min-height: 380px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 32px;
  background: linear-gradient(135deg, #0d1117, #1a2440);
}

.media-placeholder b { color: rgba(255,255,255,.9); font-size: 18px; }
.media-placeholder p { color: rgba(255,255,255,.55); font-size: 14px; }

/* ── iframe 媒体 (锻件3D viewer等) ────────────── */
.media-iframe-wrap {
  padding: 0 !important;
  overflow: hidden;
  min-height: 460px;
  background: #0d1117;
}

.media-iframe-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 460px;
  border: none;
}

/* ── AI图例说明（iframe专用）──────────────────── */
.iframe-legend {
  margin: 0 0 22px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.il-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.il-icon { font-size: 20px; }

.il-header b {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.il-sub {
  font-size: 12px;
  color: var(--muted);
  margin-left: 4px;
}

.il-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.il-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.il-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 4px;
}

.il-item b {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.il-item span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── 本视频看什么 ──────────────────────────────── */
.video-points {
  display: flex;
  align-items: stretch;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.vp-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 20px;
  background: var(--ink);
  color: #fff;
  text-align: center;
  flex-shrink: 0;
  min-width: 82px;
}

.vp-icon  { font-size: 22px; }
.vp-label b { font-size: 12px; line-height: 1.4; font-weight: 700; }

.vp-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 1;
}

.vp-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 16px 14px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.55;
  transition: background .15s;
}
.vp-item:hover { background: var(--bg); }

.vp-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Quick summary grid (景/痛/法/值) ────────── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.quick-card,
.content-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Left accent stripe */
.quick-card::before,
.content-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ink);
}
.quick-card:nth-child(2)::before { background: var(--amber); }
.quick-card:nth-child(3)::before { background: var(--cyan); }
.quick-card:nth-child(4)::before { background: var(--green); }

/* Icon badge — Chinese character shorthand */
.quick-card b::before,
.content-card b::before {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Quick card: 景/痛/法/值 */
.quick-card:nth-child(1) b::before { content: "景"; }
.quick-card:nth-child(2) b::before { content: "痛"; background: var(--amber); }
.quick-card:nth-child(3) b::before { content: "法"; background: var(--cyan); }
.quick-card:nth-child(4) b::before { content: "值"; background: var(--green); }

/* Content card: 思/做/难/效 */
.content-card:nth-child(1) b::before { content: "思"; }
.content-card:nth-child(2) b::before { content: "做"; background: var(--cyan); }
.content-card:nth-child(3) b::before { content: "难"; background: var(--amber); }
.content-card:nth-child(4) b::before { content: "效"; background: var(--green); }

.quick-card b,
.content-card b {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

/* ── Section ──────────────────────────────── */
.section { margin-top: 48px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 20px;
}

.section-head h2 { font-size: clamp(22px, 2.8vw, 34px); }
.section-head p  { max-width: 420px; }

/* ── Content cards (思/做/难/效) ──────────── */
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.content-card { min-height: 220px; padding: 22px; }

/* 可复制价值 — 单个卡片，自适应高度 */
#replicate-card { min-height: unset; }

.content-card:nth-child(2)::before { background: var(--cyan); }
.content-card:nth-child(3)::before { background: var(--amber); }
.content-card:nth-child(4)::before { background: var(--green); }

/* ── List ─────────────────────────────────── */
.list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.list li {
  position: relative;
  padding-left: 16px;
  color: var(--ink2);
  font-size: 14px;
}

.list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink2);
  opacity: .4;
}

/* ── Story rail (numbered steps) ─────────── */
.story-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.story-step {
  min-height: 140px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
}
.story-step:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.story-step span {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--line2);
  color: var(--ink2);
  font-size: 13px;
  font-weight: 800;
  background: transparent;
}

.story-step b {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 14px;
}

/* ── Case navigation (other cases) ─────────── */
.case-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.case-switch a {
  min-height: 54px;
  display: grid;
  align-content: center;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink2);
  font-size: 13px;
  font-weight: 700;
  transition: transform .16s, box-shadow .16s, background .16s;
}

.case-switch a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  background: var(--bg2);
}

.case-switch a.active {
  color: #fff;
  background: var(--ink);
  border-color: transparent;
}

.case-switch a small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: inherit;
  opacity: .65;
  margin-top: 2px;
}

/* ── Media Tabs for Video and Images ───────── */
.media-tabs-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 380px;
}

.media-tabs-content {
  flex: 1;
  position: relative;
  min-height: 380px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-pane {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.tab-pane.active {
  display: block;
}

.tab-pane video, .tab-pane img {
  width: 100%;
  height: 100%;
  min-height: 380px;
  object-fit: contain;
}

.media-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 16px;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
  font-weight: 500;
}

.media-tabs-nav {
  display: flex;
  background: #111827;
  border-top: 1px solid #1a2233;
}

.media-tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 600;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  border-right: 1px solid #1a2233;
}

.media-tab-btn:last-child {
  border-right: none;
}

.media-tab-btn:hover {
  background: #1f2937;
  color: #fff;
}

.media-tab-btn.active {
  background: #1f2937;
  color: var(--blue);
  box-shadow: inset 0 -2px 0 var(--blue);
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 960px) {
  .case-hero    { grid-template-columns: 1fr; }
  .quick-grid   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .story-rail   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-switch  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 620px) {
  .wrap { padding: 28px 16px 60px; }
  .case-hero { padding: 20px; }
  .quick-grid, .story-rail, .case-switch { grid-template-columns: 1fr; }
  .media-panel, .media-placeholder { min-height: 240px; }
  .media-panel video, .media-panel img { min-height: 240px; }
  .media-tabs-container, .media-tabs-content, .tab-pane video, .tab-pane img { min-height: 240px; }
  .media-tabs-nav { flex-direction: column; }
  .media-tab-btn { border-right: none; border-bottom: 1px solid #1a2233; padding: 10px 12px; }
  .media-tab-btn:last-child { border-bottom: none; }
  .video-points { flex-direction: column; }
  .vp-label    { flex-direction: row; gap: 10px; padding: 12px 16px; min-width: unset; text-align: left; }
  .vp-items    { grid-template-columns: 1fr; }
  .vp-item     { border-left: none; border-top: 1px solid var(--line); }
}
