/* teardown.css — 产品拆解/竞品分析详情页样式
   主题：品牌色变量驱动（豆包蓝 / 七鱼红 / MolePlan 苔藓绿）
   视觉语言：毛玻璃 + 品牌渐变 + 图标投影（与作品集主页一致） */
:root {
  --ink: #0f172a; --muted: #64748b; --rule: rgba(15,23,42,0.09);
  --glass: rgba(255,255,255,0.82); --glass-strong: rgba(255,255,255,0.94);
  --glass-border: rgba(255,255,255,0.7);
  --shadow: 0 1px 3px rgba(2,6,23,0.06), 0 1px 2px rgba(2,6,23,0.04);
  --shadow-lg: 0 20px 50px -18px rgba(2,6,23,0.25);
  --radius: 20px;
  /* 默认品牌（豆包） */
  --brand: #1E6FFF; --brand-2: #57B4FF; --brand-deep: #0E4FD1;
  --brand-soft: rgba(30,111,255,0.08); --brand-glow: rgba(30,111,255,0.35);
  --brand-grad: linear-gradient(135deg,#0E4FD1 0%,#1E6FFF 50%,#57B4FF 100%);
  --brand-accent: #7FB4FF;
}
body.brand-qiyu {
  --brand: #E60012; --brand-2: #FF5A5F; --brand-deep: #A8000E;
  --brand-soft: rgba(230,0,18,0.08); --brand-glow: rgba(230,0,18,0.35);
  --brand-grad: linear-gradient(135deg,#A8000E 0%,#E60012 50%,#FF5A5F 100%);
  --brand-accent: #FFB3B6;
}
body.brand-moleplan {
  --brand: #1F6F4F; --brand-2: #3FA675; --brand-deep: #154D36;
  --brand-soft: rgba(31,111,79,0.08); --brand-glow: rgba(31,111,79,0.35);
  --brand-grad: linear-gradient(135deg,#154D36 0%,#1F6F4F 50%,#3FA675 100%);
  --brand-accent: #A8D5BA;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', -apple-system, sans-serif;
  color: var(--ink); font-size: 15px; line-height: 1.75;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  background:
    radial-gradient(ellipse 55% 40% at 10% -4%, var(--brand-soft) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 92% 4%, rgba(6,182,212,0.08) 0%, transparent 60%),
    linear-gradient(165deg, #f7f8ff 0%, #f5faf8 100%);
  background-attachment: fixed;
}

/* ===== 导航 ===== */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.8); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border-bottom: 1px solid var(--rule); }
.nav-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 62px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-size: 15px; font-weight: 800; text-decoration: none; color: var(--ink); background: var(--brand-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-links { display: flex; gap: 6px; }
.nav-links a { font-size: 14px; color: var(--muted); text-decoration: none; padding: 7px 14px; border-radius: 10px; transition: all 0.2s; font-weight: 500; }
.nav-links a:hover { color: var(--brand); background: var(--brand-soft); }
.nav-links a.active { color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.nav-ham { display: none; background: none; border: none; font-size: 22px; color: var(--ink); cursor: pointer; }
@media (max-width: 720px) {
  .nav-links { display: none; position: absolute; top: 62px; left: 0; right: 0; background: rgba(255,255,255,0.97); border-bottom: 1px solid var(--rule); padding: 12px; flex-direction: column; box-shadow: 0 20px 30px -20px rgba(2,6,23,0.15); }
  .nav-links.open { display: flex; }
  .nav-ham { display: block; }
}

/* ===== Hero：品牌渐变 + 产品图标投影 ===== */
.teardown-hero {
  position: relative; color: #fff; overflow: hidden;
  background: var(--brand-grad);
}
/* 氛围层：放大模糊的产品图标（"投影光"来源）——保持克制，避开文字区 */
.hero-aura {
  position: absolute; z-index: 0; pointer-events: none;
  right: -40px; top: 50%; transform: translateY(-50%);
  width: 400px; height: 400px; object-fit: contain;
  opacity: 0.10; filter: blur(38px) saturate(1.2);
}
@media (max-width: 1100px) { .hero-aura { width: 300px; height: 300px; right: -30px; opacity: 0.08; } }
@media (max-width: 900px) { .hero-aura { display: none; } }
.teardown-hero::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 46% 70% at 82% 20%, rgba(255,255,255,0.22) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 12% 88%, rgba(255,255,255,0.14) 0%, transparent 70%);
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 0 auto; padding: 84px 24px 90px;
  display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 48px; align-items: center;
}
.hero-copy { min-width: 0; }
.hero-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: #fff; text-decoration: none;
  padding: 7px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.34);
  backdrop-filter: blur(8px); margin-bottom: 16px;
  transition: all 0.2s;
}
.hero-back:hover { background: rgba(255,255,255,0.26); transform: translateX(-3px); }
.hero-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em;
  padding: 6px 15px; border-radius: 999px;
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.32);
  backdrop-filter: blur(8px); margin-bottom: 18px;
}
.hero-copy h1 { font-size: 2.7rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 4px; text-shadow: 0 2px 14px rgba(2,6,23,0.22); }
.hero-copy h1 small { font-size: 1.15rem; font-weight: 600; opacity: 0.82; margin-left: 10px; letter-spacing: 0.01em; }
.hero-one {
  font-size: 1.05rem; line-height: 1.8; opacity: 0.94;
  max-width: 640px; margin: 18px 0 22px;
}
.hero-badges { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-badge {
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(10px);
  border-radius: 14px; padding: 10px 18px; min-width: 118px;
  display: flex; flex-direction: column; gap: 1px;
}
.hero-badge b { font-size: 1.22rem; font-weight: 800; line-height: 1.25; }
.hero-badge span { font-size: 11.5px; opacity: 0.82; }
.hero-meta { font-size: 12.5px; opacity: 0.78; margin-bottom: 24px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 22px; border-radius: 12px;
  font-size: 14px; font-weight: 700; text-decoration: none; transition: all 0.22s;
}
.btn-primary { color: var(--brand-deep); background: rgba(255,255,255,0.95); box-shadow: 0 10px 24px -8px rgba(2,6,23,0.4); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(2,6,23,0.45); }
.btn-ghost { color: #fff; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.4); backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255,255,255,0.24); transform: translateY(-2px); }

/* 图标 + 投影视觉 */
.hero-visual { display: flex; justify-content: center; }
.hero-icon {
  position: relative; width: 216px; height: 216px; border-radius: 44px;
  background: rgba(255,255,255,0.97); padding: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 26px 46px -14px rgba(2,6,23,0.5);
  filter: drop-shadow(0 14px 18px rgba(2,6,23,0.28));
  animation: heroFloat 5.5s ease-in-out infinite;
}
.hero-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 16px; }
/* 地面投影 */
.hero-icon::after {
  content: ''; position: absolute; left: 50%; bottom: -40px; transform: translateX(-50%);
  width: 78%; height: 26px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(2,6,23,0.42), transparent 70%);
  filter: blur(7px);
  animation: heroShadow 5.5s ease-in-out infinite;
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes heroShadow {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
  50% { transform: translateX(-50%) scale(0.86); opacity: 0.72; }
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding: 48px 24px 56px; gap: 36px; }
  .hero-copy h1 { font-size: 2.1rem; }
  .hero-visual { order: -1; }
  .hero-icon { width: 150px; height: 150px; border-radius: 32px; padding: 18px; }
}

/* ===== 正文区：左侧 TOC + 右侧渲染 ===== */
.teardown-layout {
  max-width: 1180px; margin: 36px auto 0; padding: 0 24px;
  display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 26px; align-items: start;
}
.teardown-side { position: sticky; top: 86px; min-width: 0; }
.toc-title { font-size: 12px; font-weight: 800; color: var(--brand); letter-spacing: 0.1em; margin-bottom: 10px; }
.toc { display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: thin; }
.toc a {
  display: block; font-size: 13px; color: var(--muted); text-decoration: none;
  padding: 7px 12px; border-left: 3px solid transparent; border-radius: 0 10px 10px 0;
  line-height: 1.45; transition: all 0.18s;
}
.toc a:hover { color: var(--brand); background: var(--brand-soft); }
.toc a.active { color: var(--brand); background: var(--brand-soft); border-left-color: var(--brand); font-weight: 700; }
.toc a.lv3 { padding-left: 26px; font-size: 12.5px; }

.doc-viewer {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 30px 34px; min-height: 70vh; min-width: 0; max-width: 100%;
}

/* ===== 渲染后的 Markdown 排版（品牌色化） ===== */
.md-body { font-size: 14.6px; color: #334155; }
.md-body > *:first-child { margin-top: 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { color: var(--ink); font-weight: 800; letter-spacing: -0.01em; margin: 26px 0 12px; line-height: 1.4; scroll-margin-top: 90px; }
.md-body h1 { font-size: 1.5rem; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.md-body h2 { font-size: 1.28rem; padding-left: 12px; border-left: 4px solid var(--brand); }
.md-body h3 { font-size: 1.08rem; }
.md-body h4 { font-size: 0.98rem; }
.md-body p { margin: 9px 0; }
.md-body ul, .md-body ol { margin: 9px 0 9px 22px; }
.md-body li { margin: 4px 0; }
.md-body li > ul, .md-body li > ol { margin: 3px 0 3px 18px; }
.md-body strong { color: var(--ink); }
.md-body a { color: var(--brand); text-decoration: none; border-bottom: 1px dashed var(--brand-glow); word-break: break-all; }
.md-body a:hover { border-bottom-style: solid; }
.md-body code {
  font-family: 'Consolas', 'SFMono-Regular', Menlo, monospace;
  background: var(--brand-soft); color: var(--brand-deep);
  padding: 1px 6px; border-radius: 5px; font-size: 13px;
}
.md-body pre {
  background: #0f172a; color: #e2e8f0; border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; margin: 14px 0;
}
.md-body pre code { background: none; color: inherit; padding: 0; font-size: 13px; line-height: 1.6; }
.md-body blockquote {
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  padding: 12px 18px; margin: 14px 0; border-radius: 0 12px 12px 0; color: #475569;
}
.md-body table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 13.5px; display: block; overflow-x: auto; }
.md-body th, .md-body td { border: 1px solid rgba(15,23,42,0.1); padding: 9px 13px; text-align: left; vertical-align: top; }
.md-body th { background: var(--brand-soft); color: var(--ink); font-weight: 700; }
.md-body tr:nth-child(even) td { background: rgba(15,23,42,0.02); }
.md-body hr { border: none; border-top: 1px solid var(--rule); margin: 22px 0; }
.md-body img { max-width: 100%; border-radius: 10px; border: 1px solid var(--rule); }
.md-body .md-mermaid { text-align: center; margin: 14px 0; overflow-x: auto; }
.md-body .md-mermaid svg { max-width: 100%; height: auto; }
.md-body .md-mermaid-fallback { text-align: left; }
.md-body .md-mermaid-note { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ===== 相关阅读 ===== */
.teardown-more { max-width: 1180px; margin: 44px auto 0; padding: 0 24px; }
.teardown-more h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 18px; letter-spacing: -0.02em; }
.more-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.more-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--glass); backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: all 0.22s;
}
.more-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.more-card .mc-tag { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--brand); }
.more-card .mc-title { font-size: 15.5px; font-weight: 800; }
.more-card .mc-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.more-card .mc-go { font-size: 12.5px; font-weight: 700; color: var(--brand); margin-top: auto; }
@media (max-width: 900px) { .more-cards { grid-template-columns: 1fr; } }

footer { text-align: center; padding: 56px 24px 40px; color: var(--muted); font-size: 13px; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .teardown-layout { grid-template-columns: 1fr; margin-top: 24px; }
  .teardown-side { position: static; }
  .toc { flex-direction: row; overflow-x: auto; padding-bottom: 10px; gap: 4px; -webkit-overflow-scrolling: touch; }
  .toc a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; border-radius: 0; padding: 8px 12px; }
  .toc a.active { border-left: none; border-bottom-color: var(--brand); }
  .toc a.lv3 { padding-left: 12px; }
  .toc-title { display: none; }
}
@media (max-width: 560px) {
  .teardown-layout { padding: 0 14px; }
  .doc-viewer { padding: 20px 16px; }
  .hero-copy h1 { font-size: 1.8rem; }
  .hero-one { font-size: 0.98rem; }
  .hero-badges { gap: 8px; }
  .hero-badge { min-width: 100px; padding: 9px 14px; }
  .md-body { font-size: 14px; }
  .md-body pre { padding: 12px; font-size: 12px; }
  .md-body table { font-size: 12.5px; }
}
@media print { .nav, .teardown-side, .teardown-more, footer { display: none; } .teardown-layout { display: block; } body { background: #fff; } }
