/* ============================================
   功能谱编辑器开发记录 · 站点样式
   风格目标：Apple 官网气质
   大量留白、超大标题、细腻阴影、毛玻璃导航
   ============================================ */

:root {
  --page: #ffffff;
  --surface: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --ink-muted: #86868b;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --accent: #0066cc;
  --accent-deep: #004499;
  --accent-soft: rgba(0, 102, 204, 0.08);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --shell: 1080px;
  --article-width: 700px;
  --ease: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html {
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-underline-offset: 3px; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  z-index: 40;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- 页头 ---------- */

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px 24px;
  font-size: 14px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color var(--ease);
}

.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* ---------- 语言切换 ---------- */

.lang-switcher {
  position: relative;
  margin-left: 12px;
}

.lang-switcher select {
  appearance: none;
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236e6e73' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--ease);
}

.lang-switcher select:hover { border-color: var(--ink-muted); }
.lang-switcher select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 首页 Hero ---------- */

.hero {
  padding: 120px 0 100px;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero .lede {
  max-width: 640px;
  margin: 24px auto 0;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.7;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--card);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--ease);
  box-shadow: var(--shadow-sm);
}

.button.primary {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 102, 204, 0.3);
}

.button:hover {
  border-color: var(--ink-muted);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.button.primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.35);
}

.button:active { transform: translateY(0); }

/* ---------- 板块标题 ---------- */

.section { padding: 80px 0 24px; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.section-heading h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-heading .more {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.section-heading .more:hover { text-decoration: underline; }

/* ---------- 笔记列表 ---------- */

.notes-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-card {
  display: block;
  padding: 28px 32px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: all var(--ease);
}

.note-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.note-card .note-date {
  display: block;
  color: var(--ink-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.note-card h3 {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.4;
  transition: color var(--ease);
}

.note-card:hover h3 { color: var(--accent); }

.note-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

.note-card .note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
}

.empty-hint {
  padding: 32px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-muted);
  font-size: 15px;
  text-align: center;
}

/* ---------- 谱子卡片 ---------- */

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chart-card {
  display: flex;
  flex-direction: column;
  min-height: 170px;
  padding: 26px 28px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: all var(--ease);
}

.chart-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.chart-card h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.chart-meta {
  color: var(--ink-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.chart-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: auto;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--ease);
}

.chart-download:hover {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
}

/* ---------- 首页三入口卡片 ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: all var(--ease);
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.feature-card .card-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.feature-card h3 {
  margin: 12px 0 10px;
  font-size: 20px;
  font-weight: 700;
}

.feature-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.feature-card .card-go {
  margin-top: auto;
  padding-top: 20px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--ease);
}

.feature-card:hover .card-go { color: var(--accent); }

/* ---------- 子页面页眉 ---------- */

.page-intro {
  padding: 80px 0 48px;
  border-bottom: 1px solid var(--line-soft);
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(34px, 4.5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-intro .lede {
  max-width: 640px;
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.75;
}

/* ---------- 文章排版 ---------- */

.article {
  width: calc(100% - 48px);
  max-width: var(--article-width);
  margin: 0 auto;
  padding: 56px 0 120px;
}

.article > section { margin-bottom: 56px; }

.article h2 {
  margin: 0 0 20px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.article h3 {
  margin: 32px 0 12px;
  font-size: 20px;
  font-weight: 700;
}

.article p,
.article li {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.85;
}

.article p { margin: 0; }
.article p + p,
.article ul + p,
.article ol + p,
.article p + ul,
.article p + ol { margin-top: 18px; }

.article ul, .article ol { padding-left: 1.4em; }
.article li + li { margin-top: 8px; }

.article strong { color: var(--ink); font-weight: 600; }

.article a { color: var(--accent); font-weight: 500; }
.article a:hover { color: var(--accent-deep); text-decoration: underline; }

.article code {
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

.note {
  margin: 26px 0;
  padding: 20px 22px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--accent-soft);
}

.note p, .note { color: var(--ink-soft); font-size: 15px; line-height: 1.75; }

/* 文章页头部 */

.post-header {
  width: calc(100% - 48px);
  max-width: var(--article-width);
  margin: 0 auto;
  padding: 80px 0 0;
}

.post-header .note-date {
  color: var(--ink-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.post-header h1 {
  margin: 16px 0 0;
  font-size: clamp(34px, 4.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.post-header .note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.post-divider {
  width: calc(100% - 48px);
  max-width: var(--article-width);
  margin: 40px auto 0;
  border: none;
  border-top: 1px solid var(--line-soft);
}

.post-footer {
  width: calc(100% - 48px);
  max-width: var(--article-width);
  margin: 0 auto;
  padding: 0 0 120px;
}

.post-footer .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.post-footer .back-link:hover { text-decoration: underline; }

/* ---------- 目录 ---------- */

.toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--ease);
}

.toc a:hover { background: var(--accent-soft); color: var(--accent); }

/* ---------- 联系卡片 ---------- */

.contact-box {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding: 26px 28px;
  border-radius: var(--radius);
  background: var(--surface);
}

.contact-box strong { font-size: 15px; font-weight: 600; }

.contact-box a {
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
}

.contact-box span {
  color: var(--ink-muted);
  font-size: 14px;
}

/* ---------- 页脚 ---------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 40px 0 56px;
  color: var(--ink-muted);
  font-size: 13px;
}

.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
}

.site-footer p { margin: 0; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ---------- 响应式 ---------- */

@media (max-width: 760px) {
  .shell { width: calc(100% - 40px); }

  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 0;
  }
  .brand { font-size: 14px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 6px; }
  .nav-links { justify-content: flex-start; gap: 2px 16px; font-size: 13.5px; }
  .nav-links a { min-height: 34px; }

  .lang-switcher { margin-left: 0; margin-top: 4px; }

  .hero { padding: 72px 0 64px; text-align: left; }
  .hero h1 { font-size: clamp(34px, 8vw, 44px); }
  .hero .lede { font-size: 17px; }
  .actions { justify-content: flex-start; flex-direction: column; align-items: stretch; }

  .section { padding: 56px 0 16px; }
  .section-heading h2 { font-size: 24px; }

  .note-card { padding: 24px; }
  .note-card h3 { font-size: 19px; }

  .charts-grid { grid-template-columns: 1fr; }

  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 0; }

  .page-intro { padding: 56px 0 36px; }
  .page-intro h1 { font-size: clamp(30px, 7vw, 38px); }

  .article { padding: 40px 0 80px; }
  .article h2 { font-size: 24px; }

  .post-header { padding: 56px 0 0; }
  .post-footer { padding-bottom: 80px; }

  .toc { grid-template-columns: 1fr; }

  .site-footer .shell { display: block; }
  .site-footer p + p { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
