﻿/* ==========================================================
   上线性能与顺滑度增强引擎 (Smoothness & Performance Optimization)
   ========================================================== */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* 硬件加速与流畅悬停 */
a, button, .media-news-card, .btn-media-primary, .btn-media-secondary, .faq-card, .intro-panel {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* 移动端平滑滚动与防抖 */
.table-wrapper, .table-container, .code-box, pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* 媒体图片防溢出与自适应 */
img, svg, video, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 消除点击高亮延迟 */
a, button, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* 教程步骤海报风设计系统变量 (Tutorial Step Poster Tokens) */
  --pst-bg: #fdfbf7;             /* 温暖海报纸张底色 */
  --pst-surface: #ffffff;        /* 纯白卡片 */
  --pst-primary: #1c1917;        /* 浓墨纯黑 */
  --pst-orange: #ea580c;         /* 海报醒目亮橙 */
  --pst-orange-hover: #c2410c;
  --pst-amber: #f59e0b;          /* 步骤警示黄 */
  --pst-teal: #0f766e;           /* 沉稳墨绿 */
  
  --pst-border: #e7e5e4;         /* 边框 */
  --pst-border-strong: #1c1917;  /* 强黑边框海报质感 */
  --pst-shadow: 4px 4px 0px #1c1917; /* 经典海报阴影 */
  --pst-shadow-hover: 6px 6px 0px #ea580c;
  
  --text-main: #1c1917;
  --text-body: #44403c;
  --text-muted: #78716c;
  
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--pst-bg);
  color: var(--text-body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.85;
}

a { color: var(--pst-orange); text-decoration: none; font-weight: 700; }
a:hover { color: var(--pst-orange-hover); text-decoration: underline; }

.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

/* 顶部独立声明栏 */
.poster-topbar {
  background: #1c1917;
  color: #d6d3d1;
  font-size: 12.5px;
  padding: 8px 0;
  border-bottom: 2px solid #292524;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.poster-badge {
  background: var(--pst-orange);
  color: #ffffff;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
}
.topbar-text strong { color: #ffffff; }

/* 头部导航 */
.poster-header {
  background: #ffffff;
  border-bottom: 3px solid var(--pst-primary);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 78px;
  gap: 20px;
}
.poster-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.poster-logo-badge {
  font-size: 14px;
  font-family: var(--font-mono);
  font-weight: 900;
  background: var(--pst-orange);
  color: #ffffff;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 2px solid var(--pst-primary);
  box-shadow: 2px 2px 0px var(--pst-primary);
}
.poster-title-group {
  display: flex;
  flex-direction: column;
}
.poster-main-title {
  font-size: 20px;
  font-weight: 950;
  color: var(--pst-primary);
  line-height: 1.2;
}
.poster-main-title span { color: var(--pst-orange); }
.poster-sub-title {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a {
  color: var(--text-body);
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 14px;
  background: #f5f5f4;
  border: 2px solid var(--pst-primary);
  box-shadow: 2px 2px 0px var(--pst-primary);
  transition: all .15s ease;
}
.nav a:hover, .nav a.active {
  background: var(--pst-orange);
  border-color: var(--pst-primary);
  color: #ffffff;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--pst-primary);
  text-decoration: none;
}

/* Hero 首屏 - 海报风步骤指引 */
.hero {
  padding: 50px 0 44px;
  background: #ffffff;
  border-bottom: 3px solid var(--pst-primary);
}
.hero-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffedd5;
  color: #9a3412;
  border: 2px solid var(--pst-primary);
  box-shadow: 2px 2px 0px var(--pst-primary);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(26px, 3.8vw, 40px);
  font-weight: 950;
  line-height: 1.35;
  color: var(--pst-primary);
  margin-bottom: 16px;
}
.hero p {
  font-size: 16.5px;
  color: var(--text-body);
  max-width: 960px;
  line-height: 1.85;
  margin-bottom: 26px;
}
.hero strong { color: var(--pst-orange); }

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 32px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 900;
  border-radius: 4px;
  border: 2px solid var(--pst-primary);
  box-shadow: var(--pst-shadow);
  transition: all .15s ease;
}
.btn.primary {
  background: var(--pst-orange);
  color: #ffffff;
}
.btn.primary:hover {
  background: var(--pst-orange-hover);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--pst-primary);
  text-decoration: none;
}
.btn.secondary {
  background: #ffffff;
  color: var(--pst-primary);
}
.btn.secondary:hover {
  background: #f5f5f4;
  color: var(--pst-orange);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--pst-primary);
  text-decoration: none;
}

/* 步骤海报时间轴卡片 (Step Poster Timeline) */
.poster-steps-bar {
  background: #fffbeb;
  border: 2px solid var(--pst-primary);
  border-radius: 6px;
  padding: 22px 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  box-shadow: var(--pst-shadow);
}
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.step-num {
  font-size: 20px;
  font-family: var(--font-mono);
  font-weight: 950;
  background: var(--pst-primary);
  color: #ffffff;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}
.step-content strong {
  display: block;
  font-size: 14px;
  color: var(--pst-primary);
  margin-bottom: 2px;
}
.step-content span {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* 通用 Section */
.section {
  padding: 48px 0;
  border-bottom: 2px solid var(--pst-border);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 26px;
}
.section-head h2 {
  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 950;
  color: var(--pst-primary);
}
.section-note {
  max-width: 480px;
  color: var(--text-muted);
  font-size: 14px;
}

/* 六宫格功能模块区 - 海报卡片 */
.grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.poster-card {
  background: var(--pst-surface);
  border: 2px solid var(--pst-primary);
  border-radius: 6px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition: all .2s ease;
  box-shadow: var(--pst-shadow);
}
.poster-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--pst-shadow-hover);
  border-color: var(--pst-primary);
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.card-step-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 900;
  color: #ffffff;
  background: var(--pst-primary);
  padding: 2px 8px;
  border-radius: 3px;
}
.card-step-id {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--pst-orange);
  font-weight: 800;
}
.poster-card h3 {
  font-size: 18px;
  font-weight: 900;
  color: var(--pst-primary);
  margin-bottom: 8px;
}
.poster-card p {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.7;
  flex: 1;
}

/* 正文介绍区 - 海报双栏 */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.intro-box {
  background: var(--pst-surface);
  border: 2px solid var(--pst-primary);
  border-radius: 6px;
  padding: 30px;
  box-shadow: var(--pst-shadow);
}
.intro-box h3 {
  font-size: 20px;
  font-weight: 900;
  color: var(--pst-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.intro-box p {
  font-size: 14.5px;
  color: var(--text-body);
  margin-bottom: 14px;
  line-height: 1.85;
}
.intro-box ul {
  list-style: none;
  display: grid;
  gap: 12px;
}
.intro-box li {
  font-size: 14px;
  color: var(--text-main);
  padding-left: 24px;
  position: relative;
}
.intro-box li::before {
  content: "📌";
  position: absolute;
  left: 0;
  font-size: 13px;
}

/* 热门教程表格 */
.table-wrap {
  background: var(--pst-surface);
  border: 2px solid var(--pst-primary);
  border-radius: 6px;
  overflow-x: auto;
  box-shadow: var(--pst-shadow);
}
table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
th, td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--pst-border);
  font-size: 14px;
  vertical-align: middle;
}
th {
  background: #f5f5f4;
  color: var(--pst-primary);
  font-weight: 900;
  border-bottom: 2px solid var(--pst-primary);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafaf9; }
.level-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 900;
  font-family: var(--font-mono);
  border: 1px solid var(--pst-primary);
}
.level-badge.easy { background: #ffedd5; color: #9a3412; }
.level-badge.medium { background: #fef3c7; color: #b45309; }
.level-badge.hard { background: #fee2e2; color: #b91c1c; }

/* FAQ 折叠面板 */
.faq-list {
  display: grid;
  gap: 12px;
}
details {
  background: var(--pst-surface);
  border: 2px solid var(--pst-primary);
  border-radius: 6px;
  padding: 18px 24px;
  transition: all .2s ease;
  box-shadow: 2px 2px 0px var(--pst-primary);
}
details:hover {
  border-color: var(--pst-orange);
}
summary {
  font-size: 16px;
  font-weight: 900;
  color: var(--pst-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 18px;
  color: var(--pst-orange);
  font-weight: 900;
}
details[open] summary::after { content: "−"; }
details p {
  margin-top: 12px;
  color: var(--text-body);
  font-size: 14.5px;
  line-height: 1.85;
}

/* 子页面文章 */
.article {
  max-width: 900px;
  margin: 36px auto;
  background: var(--pst-surface);
  border: 2px solid var(--pst-primary);
  border-radius: 8px;
  padding: 40px;
  box-shadow: var(--pst-shadow);
}
.article h1 {
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 950;
  color: var(--pst-primary);
  margin-bottom: 16px;
  line-height: 1.35;
}
.article-lead {
  background: #ffedd5;
  border-left: 4px solid var(--pst-orange);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 14.5px;
  color: var(--text-body);
  border-radius: 0 4px 4px 0;
  line-height: 1.85;
}
.article h2 {
  font-size: 20px;
  font-weight: 900;
  color: var(--pst-primary);
  margin: 28px 0 12px;
  padding-top: 16px;
  border-top: 2px solid var(--pst-border);
}
.article p, .article li {
  color: var(--text-body);
  font-size: 14.5px;
  margin-bottom: 12px;
  line-height: 1.85;
}
.article ul { margin-left: 20px; }

/* 页脚 */
.poster-footer {
  margin-top: 50px;
  background: #1c1917;
  color: #a8a29e;
  padding: 46px 0 26px;
  border-top: 3px solid var(--pst-primary);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 28px;
}
.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 8px;
}
.footer-brand p {
  font-size: 13.5px;
  color: #a8a29e;
  max-width: 440px;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-nav a {
  color: #e7e5e4;
  background: #292524;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  border: 1px solid #44403c;
}
.footer-nav a:hover {
  background: var(--pst-orange);
  color: #ffffff;
  border-color: var(--pst-orange);
  text-decoration: none;
}
.footer-bottom {
  border-top: 1px solid #292524;
  padding-top: 18px;
  font-size: 12.5px;
  color: #78716c;
  text-align: center;
}

@media (max-width: 960px) {
  .header-inner { flex-direction: column; align-items: flex-start; padding: 12px 0; }
  .grid-6, .intro-grid, .poster-steps-bar, .footer-top { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .article { padding: 22px 16px; }
  .topbar-inner { flex-direction: column; align-items: flex-start; }
}
