/* ============================================================
   Portfolio Design System — md → HTML 转换引擎
   Register: Brand  |  Color Strategy: Committed (铜色 30-40%)
   Scene: 面试官在办公室看到展示,需要30秒内判断我的专业性
   css/style.css：作用是，如果没有它，页面没有样式（白底黑字，很丑）
   ============================================================ */

/* ── Design Tokens ── */
:root {
  --bg: #FBFAF7;
  --bg-dark: #1C1F2B;
  --bg-card: #FFFFFF;
  --bg-wash: #F5F2ED;
  --border: #E5E1DA;
  --border-light: #F0EDE7;

  --text: #1C1F2B;
  --text-secondary: #6B6E76;
  --text-tertiary: #94969C;

  --accent: #C17F59;
  --accent-glow: rgba(193, 127, 89, 0.12);
  --accent-dim: rgba(193, 127, 89, 0.06);

  --green: #4F9A74;
  --orange: #D4A24E;
  --red: #D14444;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --ease: cubic-bezier(0.22, 0.1, 0.13, 1);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);

  --measure: 65ch;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  background:
    /* subtle hex/infill pattern evoking 3D printing */
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='%23C17F59' stroke-width='0.3' opacity='0.08'/%3E%3Ccircle cx='30' cy='30' r='1' fill='%23C17F59' opacity='0.06'/%3E%3C/svg%3E") 0 0/60px 60px,
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Navigation ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 14px 48px;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(251, 250, 247, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s;
}
.nav-logo {
  font-family: var(--font-heading);
  font-size: 17px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.nav-logo span {
  font-size: 11px; font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 10px; border-radius: 12px;
}
.nav-links {
  display: flex; gap: 4px; list-style: none;
  background: var(--bg-wash); border-radius: 24px; padding: 4px;
}
.nav-links a {
  color: var(--text-secondary); text-decoration: none;
  font-size: 13px; font-weight: 500;
  padding: 8px 16px; border-radius: 20px;
  transition: all 0.2s; display: block;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.nav-links .nav-pdf {
  color: var(--accent);
}

/* ── Hero (Dark) ── */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding: 0 48px; position: relative;
  background:
    linear-gradient(135deg, rgba(28,31,43,0.92) 0%, rgba(28,31,43,0.78) 45%, rgba(28,31,43,0.65) 100%),
    url('../mars5ultra.png') 75% center/auto 70% no-repeat,
    var(--bg-dark);
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(193,127,89,0.15), transparent 55%),
    radial-gradient(ellipse at 70% 70%, rgba(61,139,139,0.08), transparent 55%),
    radial-gradient(ellipse at 50% 90%, rgba(193,127,89,0.06), transparent 50%);
  pointer-events: none;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
/* 3D printing layer-line atmosphere */
.hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(193,127,89,0.04) 3px,
      rgba(193,127,89,0.04) 3.5px
    );
  opacity: 0.6; pointer-events: none;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 70%);
}
.hero-inner {
  max-width: 1120px; margin: 0 auto; position: relative; z-index: 2;
}
.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(193,127,89,0.15);
  color: var(--accent);
  border-radius: 20px;
  font-size: 12px; font-weight: 600; letter-spacing: 1px;
  margin-bottom: 32px;
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 800; letter-spacing: -1.5px; line-height: 1.04;
  margin-bottom: 24px;
  color: #FFFFFF;
}
.hero h1 em {
  font-style: normal; color: var(--accent);
}
.hero .lede {
  font-size: 18px; color: rgba(255,255,255,0.6);
  max-width: 520px; line-height: 1.65;
  margin-bottom: 40px;
}
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  padding: 12px 26px; border-radius: 24px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.25s; border: none;
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(193,127,89,0.35);
}
.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25); color: #fff;
}
.btn-outline:hover {
  border-color: var(--accent); color: var(--accent);
}
.btn-sm {
  padding: 7px 16px; font-size: 12px;
  border-radius: 16px;
}

/* ── Section Layout ── */
.section {
  max-width: 1120px; margin: 0 auto; padding: 80px 48px;
  position: relative; z-index: 1;
}
.section-kicker {
  font-size: 12px; font-weight: 600;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.section-heading {
  font-family: var(--font-heading);
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 700; letter-spacing: -0.8px; line-height: 1.12;
  margin-bottom: 16px;
}
.section-sub {
  font-size: 17px; color: var(--text-secondary);
  max-width: 540px; line-height: 1.7;
}
.divider {
  width: 48px; height: 3px;
  background: var(--accent); border-radius: 2px;
  margin-bottom: 40px;
}

/* ── Document Index Cards ── */
.doc-group { margin-bottom: 48px; }
.doc-group-title {
  font-family: var(--font-heading);
  font-size: 20px; font-weight: 600;
  margin-bottom: 6px;
}
.doc-group-desc {
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 20px;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s var(--ease);
  position: relative;
  display: flex; gap: 16px; align-items: flex-start;
}
.doc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.doc-card-num {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg-wash);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 700;
  color: var(--accent);
  transition: all 0.3s var(--ease);
}
.doc-card:hover .doc-card-num {
  background: var(--accent);
  color: #fff;
}
.doc-card-body h3 {
  font-family: var(--font-heading);
  font-size: 16px; font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}
.doc-card-body p {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.6;
}

/* B-group: Timeline variant */
.doc-timeline {
  display: flex; flex-direction: column; gap: 0;
  position: relative;
}
.doc-timeline::before {
  content: '';
  position: absolute; left: 19px; top: 8px; bottom: 8px;
  width: 2px; background: var(--border);
}
.doc-timeline .doc-card {
  border: none; border-radius: 0;
  padding: 16px 24px 16px 56px;
  background: transparent;
  position: relative;
}
.doc-timeline .doc-card:hover {
  transform: translateX(4px);
  box-shadow: none;
  background: var(--bg-wash);
}
.doc-timeline .doc-card-num {
  position: absolute; left: 2px; top: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 13px; z-index: 1;
}

/* Resource cards (prominent) */
.doc-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.doc-resource-card--featured {
  grid-column: 1 / -1;
}
.doc-resource-card {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px 28px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s var(--ease);
  display: flex; gap: 14px; align-items: center;
}
.doc-resource-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.doc-resource-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* ── Document Detail Page ── */
.doc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 1120px;
  margin: 0 auto;
  padding: 120px 48px 80px;
  gap: 48px;
}

.doc-sidebar {
  position: sticky; top: 100px;
  align-self: start;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.doc-sidebar h4 {
  font-family: var(--font-heading);
  font-size: 13px; font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 16px;
}
.doc-toc { list-style: none; }
.doc-toc li { margin-bottom: 2px; }
.doc-toc a {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px; color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.doc-toc a:hover,
.doc-toc a.active {
  color: var(--accent);
  background: var(--accent-dim);
}
.doc-toc a.toc-h2 { padding-left: 12px; font-weight: 500; }
.doc-toc a.toc-h3 { padding-left: 28px; font-size: 12px; }

.doc-content {
  max-width: var(--measure);
  min-width: 0;
}
.doc-content h1 {
  font-family: var(--font-heading);
  font-size: 36px; font-weight: 700;
  letter-spacing: -0.6px; line-height: 1.15;
  margin-bottom: 8px;
}
.doc-content h2 {
  font-family: var(--font-heading);
  font-size: 24px; font-weight: 600;
  margin-top: 48px; margin-bottom: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}
.doc-content h3 {
  font-family: var(--font-heading);
  font-size: 18px; font-weight: 600;
  margin-top: 32px; margin-bottom: 8px;
}
.doc-content h4 {
  font-family: var(--font-heading);
  font-size: 16px; font-weight: 600;
  margin-top: 24px; margin-bottom: 6px;
}

.doc-content p {
  font-size: 15px; line-height: 1.8;
  margin-bottom: 16px;
  color: var(--text);
}
.doc-content strong {
  font-weight: 600;
  color: var(--text);
}
.doc-content a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.doc-content a:hover { text-decoration: underline; }

.doc-content blockquote {
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  padding: 20px 24px;
  margin: 24px 0;
  font-size: 15px; line-height: 1.8;
  color: var(--text-secondary);
}
.doc-content blockquote p {
  margin-bottom: 0;
  color: inherit;
}

.doc-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-wash);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
}
.doc-content pre {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.85);
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 20px 0;
  font-size: 13px;
  line-height: 1.7;
}
.doc-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.doc-content ul, .doc-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}
.doc-content li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.doc-content li strong {
  color: var(--text);
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13px;
}
.doc-content th {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  background: var(--bg-wash);
}
.doc-content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  line-height: 1.6;
}
.doc-content tr:last-child td { border-bottom: none; }

.doc-content hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 32px 0;
}

.doc-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 20px 0;
}

/* Doc navigation (prev/next) */
.doc-nav {
  display: flex; justify-content: space-between;
  margin-top: 80px; padding-top: 32px;
  border-top: 1px solid var(--border);
  gap: 16px;
}
.doc-nav a {
  font-size: 14px; font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.2s;
}
.doc-nav a:hover { gap: 10px; }
.doc-nav .doc-nav-label {
  font-size: 11px; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 4px;
}

/* Doc header with PDF print banner */
.doc-header {
  margin-bottom: 32px;
}
.doc-action-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 12px;
}
.doc-action-bar .btn-pdf {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s;
  font-family: var(--font-body);
  box-shadow: 0 2px 8px rgba(193,127,89,0.25);
}
.doc-action-bar .btn-pdf:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(193,127,89,0.4);
}
.doc-action-bar .btn-pdf svg {
  width: 18px; height: 18px;
}
.doc-pdf-hint {
  font-size: 12px; color: var(--text-tertiary);
  line-height: 1.5;
  margin-top: 8px;
}

/* ── Footer ── */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 60px 48px 40px;
  margin-top: 80px;
}
.footer a {
  color: var(--accent);
  text-decoration: none; font-weight: 600;
}
.footer a:hover { text-decoration: underline; }
.footer .ft-links {
  display: flex; gap: 24px; justify-content: center;
  margin-bottom: 16px; font-size: 14px;
}
.footer .ft-note {
  font-size: 12px; color: rgba(255,255,255,0.3); margin-top: 8px;
}

/* ── Reveal Animation ── */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: all 0.65s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: 50ms; }
.reveal.d2 { transition-delay: 100ms; }
.reveal.d3 { transition-delay: 150ms; }
.reveal.d4 { transition-delay: 200ms; }

/* ── Stats bar ── */
.stats-bar {
  max-width: 560px; margin: -60px auto 0;
  position: relative; z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px; padding: 0 48px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px; text-align: center;
  box-shadow: var(--shadow);
}
.stat-num {
  font-family: var(--font-heading);
  font-size: 40px; font-weight: 700;
  color: var(--accent);
}
.stat-lbl {
  font-size: 13px; color: var(--text-secondary); margin-top: 4px;
}

/* ── Task badges in doc cards ── */
.doc-card-badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 600;
  margin-bottom: 6px;
}
.badge-evidence { background: rgba(79,154,116,0.1); color: var(--green); }
.badge-narrative { background: rgba(193,127,89,0.1); color: var(--accent); }

/* ── Mobile ── */
@media (max-width: 768px) {
  .nav { padding: 12px 20px; }
  .nav-links a { font-size: 11px; padding: 6px 10px; }
  .hero { padding: 0 20px; }
  .hero h1 { font-size: 36px; }
  .section, .doc-layout { padding: 60px 20px; }
  .stats-bar { grid-template-columns: 1fr; max-width: 280px; padding: 0 20px; margin-top: -40px; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-sidebar { display: none; }
  .doc-content h1 { font-size: 28px; }
  .doc-grid, .doc-resource-grid { grid-template-columns: 1fr; }
  .doc-header { flex-direction: column; }
}

/* ── ELEGOO Inline Content ── */
.elegoo-inline { margin-top: 36px; }
.elegoo-inline h3 {
  font-family: var(--font-heading); font-size: 20px; font-weight: 600;
  margin-top: 36px; margin-bottom: 14px; padding-top: 24px;
  border-top: 1px solid var(--border-light);
  color: var(--text);
}
.elegoo-inline h3:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.elegoo-inline p { font-size: 15px; line-height: 1.8; color: var(--text-secondary); margin-bottom: 14px; }

.pain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 20px 0; }
.pain-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: all 0.3s; }
.pain-card:hover { box-shadow: var(--shadow); }
.pain-card.p0 { border-left: 4px solid var(--red); }
.pain-card.p1 { border-left: 4px solid var(--orange); }
.pain-card.p2 { border-left: 4px solid var(--accent); }
.pain-chip { display: inline-block; padding: 4px 12px; border-radius: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; margin-bottom: 12px; }
.pain-chip.p0 { background: rgba(209,68,68,0.1); color: var(--red); }
.pain-chip.p1 { background: rgba(212,162,78,0.12); color: var(--orange); }
.pain-chip.p2 { background: rgba(193,127,89,0.1); color: var(--accent); }
.pain-card h4 { font-family: var(--font-heading); font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.pain-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

.elegoo-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 13px; }
.elegoo-table th { text-align: left; padding: 12px 14px; border-bottom: 2px solid var(--border); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-tertiary); background: var(--bg-wash); }
.elegoo-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-light); vertical-align: top; line-height: 1.7; }

.framework-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 20px 0; }
.framework-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: all 0.3s; }
.framework-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.framework-card h4 { font-family: var(--font-heading); font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--accent); }
.framework-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }

/* ── Print (for PDF export) ── */
@media print {
  .nav, .hero, .footer, .doc-sidebar, .btn-pdf, .doc-nav,
  .reveal, .stats-bar { display: none !important; }

  body { background: #fff; color: #000; }
  .doc-layout {
    display: block; max-width: 100%;
    padding: 0; margin: 0;
  }
  .doc-content {
    max-width: 100%;
  }
  .doc-content h1 { font-size: 24pt; }
  .doc-content h2 { font-size: 16pt; }
  .doc-content h3 { font-size: 13pt; }
  .doc-content p, .doc-content li { font-size: 11pt; line-height: 1.6; }
  .doc-content pre { background: #f5f5f5; color: #000; }
  .doc-content table { font-size: 9pt; }
  .doc-content a { color: inherit; text-decoration: underline; }

  @page { margin: 2cm; }
}

