/* ===== Claude Code 教程 · Claude 官网风格 ===== */

:root {
  --bg: #F7F4ED;
  --card: #FFFFFF;
  --border: #E8E2D4;
  --accent: #D97757;
  --accent-hover: #C96442;
  --accent-soft: #F6E8E0;
  --text: #1B1A17;
  --text-secondary: #6B675E;
  --serif: Georgia, 'Noto Serif SC', 'Source Han Serif SC', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(27, 26, 23, 0.06), 0 12px 32px rgba(27, 26, 23, 0.05);
  --nav-h: 64px;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-soft); }

/* ===== 阅读进度条 ===== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 1001;
  transition: width 0.08s linear;
}

/* ===== 顶部导航 ===== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(247, 244, 237, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand-dot { color: var(--accent); margin: 0 6px; }

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14.5px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: rgba(27, 26, 23, 0.05); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 9px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  padding: 10px 22px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 6px 18px rgba(217, 119, 87, 0.35); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-lg { padding: 14px 32px; font-size: 16.5px; }
.btn-sm { padding: 7px 16px; font-size: 13.5px; }
.btn-mini {
  padding: 4px 12px;
  font-size: 12.5px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  vertical-align: middle;
  margin-left: 8px;
}
.btn-mini:hover { background: var(--accent); color: #fff; }

.btn.copied {
  background: #4E8D5B !important;
  border-color: #4E8D5B !important;
  color: #fff !important;
}

/* ===== Hero ===== */
.hero {
  padding: 110px 24px 90px;
  text-align: center;
}
.hero-inner { max-width: 840px; margin: 0 auto; }

.hero-eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 6px 18px;
  margin-bottom: 32px;
  background: var(--accent-soft);
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(40px, 7vw, 68px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.01em;
  margin-bottom: 26px;
}

.hero-subtitle {
  font-size: 19px;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 20px;
}

.hero-meta {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===== 布局容器 ===== */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 前言 ===== */
.intro { padding: 30px 24px 10px; }
.intro p { margin-bottom: 18px; }

.section-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  margin: 54px 0 22px;
}
.section-title:first-child { margin-top: 0; }

.step-list {
  margin: 0 0 20px 22px;
}
.step-list li { margin-bottom: 10px; }

/* ===== 网站卡片 ===== */
.site-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 10px 0 30px;
}

.site-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.site-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(27, 26, 23, 0.08), 0 20px 44px rgba(27, 26, 23, 0.08);
}
.site-card h3 { font-family: var(--serif); font-size: 19px; }
.site-url { font-size: 13px; word-break: break-all; }
.site-desc { color: var(--text-secondary); font-size: 14.5px; flex: 1; }
.site-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

/* ===== 章节 ===== */
.chapter { padding: 70px 0 10px; }

.chapter-head {
  margin-bottom: 44px;
  text-align: center;
}

.chapter-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 5px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.chapter-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4.5vw, 38px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 14px;
}

.chapter-lead {
  color: var(--text-secondary);
  font-size: 16.5px;
  max-width: 620px;
  margin: 0 auto;
}

/* ===== 步骤卡片 ===== */
.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 38px;
  margin-bottom: 30px;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.step-badge {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(217, 119, 87, 0.35);
}

.step-head h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
}

.step-card p { margin-bottom: 16px; }
.step-card ul { margin: 0 0 16px 22px; }
.step-card ul li { margin-bottom: 8px; }

/* ===== 图片 ===== */
.step-figure {
  margin: 22px 0 6px;
}

.step-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: zoom-in;
  transition: box-shadow 0.25s, transform 0.25s;
}
.step-figure img:hover {
  box-shadow: 0 10px 30px rgba(27, 26, 23, 0.14);
  transform: translateY(-2px);
}

.step-figure figcaption {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13.5px;
  margin-top: 10px;
}

/* ===== Callout ===== */
.callout {
  background: #FBF3EC;
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 15px;
}
.callout strong { color: var(--accent-hover); }

/* ===== 表格 ===== */
.table-wrap {
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  background: var(--card);
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  background: #F1EBDF;
  font-weight: 700;
  white-space: nowrap;
}

tbody tr:nth-child(even) { background: #FAF7F0; }
tbody tr:last-child td { border-bottom: none; }

/* ===== 代码 ===== */
code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.88em;
  background: #EFE9DD;
  color: var(--accent-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  word-break: break-all;
}

kbd {
  font-family: var(--sans);
  font-size: 0.82em;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 7px;
}

/* ===== FAQ 手风琴 ===== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: none;
  border: none;
  padding: 20px 24px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  line-height: 1.6;
  transition: color 0.2s;
}
.faq-q:hover { color: var(--accent); }

.faq-arrow {
  flex: none;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.3s;
  margin-right: 4px;
}

.faq-item.open .faq-arrow { transform: rotate(225deg); }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-a p {
  padding: 0 24px 22px;
  color: var(--text-secondary);
}

/* ===== 结语 ===== */
.epilogue { text-align: left; }
.epilogue p { margin-bottom: 18px; }
.epilogue-sign {
  font-family: var(--serif);
  color: var(--text-secondary);
  text-align: right;
}

/* ===== 页脚 ===== */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 36px 24px 44px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ===== 回到顶部 ===== */
.back-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(217, 119, 87, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s, background 0.2s;
  z-index: 900;
}
.back-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-top:hover { background: var(--accent-hover); }

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(27, 26, 23, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  cursor: zoom-out;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lightbox-img {
  max-width: 92vw;
  max-height: 82vh;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  cursor: default;
}
.lightbox-caption {
  color: #EDE9E0;
  font-size: 14.5px;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}
.lightbox-close:hover { background: var(--accent); }

body.no-scroll { overflow: hidden; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 18px;
    display: none;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 10px 14px; }
  .nav-toggle { display: flex; }
  .nav-inner { gap: 12px; }
}

@media (max-width: 767px) {
  body { font-size: 15.5px; }
  .hero { padding: 70px 20px 60px; }
  .hero-actions .btn { width: 100%; max-width: 320px; }
  .nav-cta { display: none; }
  .site-grid { grid-template-columns: 1fr; }
  .step-card { padding: 24px 20px; }
  .step-head h3 { font-size: 19px; }
  .step-badge { width: 40px; height: 40px; font-size: 13.5px; }
  .step-figure img { border-radius: 8px; }
  .back-top { right: 18px; bottom: 18px; }
  .chapter { padding: 54px 0 6px; }
  .section-title { font-size: 26px; }
}
