/* =========================================================
 * 六线谱库 · 样式（浅色主题）
 * ========================================================= */

:root {
  --bg: #f6f7fa;
  --surface: #ffffff;
  --ink: #232838;
  --ink-soft: #5c6472;
  --line: #e4e7ee;
  --accent: #d96c3f;        /* 吉他木色橙 */
  --accent-deep: #b9532c;
  --accent-soft: #fdf0e9;
  --teal: #2f6f68;
  --teal-soft: #e8f2f1;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(35, 40, 56, 0.08);
  --shadow-lg: 0 14px 44px rgba(35, 40, 56, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(1120px, 92%); margin: 0 auto; }
.br-pc { display: inline; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
a { color: var(--accent-deep); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
}
.logo { text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.12rem; }
.logo em { font-style: normal; font-size: 0.72rem; color: var(--ink-soft); margin-left: 8px; font-weight: 500; }
.nav a {
  color: var(--ink-soft); text-decoration: none; margin-left: 22px; font-size: 0.95rem;
  transition: color 0.15s;
}
.nav a:hover { color: var(--accent-deep); }

/* ---------- 首屏 ---------- */
.hero {
  background:
    radial-gradient(1000px 420px at 85% -10%, rgba(217, 108, 63, 0.14), transparent 60%),
    radial-gradient(800px 400px at 5% 110%, rgba(47, 111, 104, 0.12), transparent 60%),
    var(--bg);
  padding: 76px 0 60px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  line-height: 1.28; margin: 0 0 14px; letter-spacing: 0.5px;
}
.accent { color: var(--accent-deep); position: relative; }
.hero-sub { color: var(--ink-soft); font-size: 1.06rem; margin: 0 0 30px; }

.hero-search { position: relative; max-width: 560px; margin: 0 auto; }
.hero-search input {
  width: 100%; padding: 15px 48px 15px 20px; font-size: 1rem;
  border: 2px solid var(--line); border-radius: 999px; outline: none;
  background: var(--surface); box-shadow: var(--shadow);
  transition: border-color 0.2s;
}
.hero-search input:focus { border-color: var(--accent); }
.search-icon { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.05rem; }

.hero-stats { display: flex; justify-content: center; gap: 46px; margin-top: 34px; flex-wrap: wrap; }
.stat strong { display: block; font-size: 1.5rem; color: var(--accent-deep); }
.stat span { color: var(--ink-soft); font-size: 0.88rem; }

/* ---------- 区块通用 ---------- */
.section { padding: 64px 0; }
.section-alt { background: #eef1f6; }
.sec-title { font-size: 1.6rem; margin: 0 0 8px; }
.sec-title::after {
  content: ""; display: block; width: 44px; height: 4px; border-radius: 2px;
  background: var(--accent); margin-top: 10px;
}
.sec-desc { color: var(--ink-soft); margin: 0 0 26px; max-width: 760px; }
.sec-desc .hint { display: block; font-size: 0.86rem; color: #8a92a1; }

/* ---------- 筛选 ---------- */
.filters { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: 999px; padding: 6px 16px; font-size: 0.9rem; cursor: pointer;
  transition: all 0.15s;
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 曲谱卡片 ---------- */
.song-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 20px;
}
.song-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.18s, box-shadow 0.18s; cursor: pointer;
}
.song-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.chip {
  display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 0.78rem; font-weight: 600;
}
.chip-type { background: var(--teal-soft); color: var(--teal); }
.chip-chord { background: var(--accent-soft); color: var(--accent-deep); }
.diff { color: #e8a13c; font-size: 0.85rem; letter-spacing: 1px; }
.card-title { margin: 2px 0 0; font-size: 1.2rem; }
.card-sub { margin: 0; color: var(--ink-soft); font-size: 0.87rem; }
.card-artist { margin: 0; color: #8a92a1; font-size: 0.85rem; }
.card-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--ink-soft); font-size: 0.83rem; }
.card-chords { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.empty { color: var(--ink-soft); text-align: center; padding: 40px 0; grid-column: 1 / -1; }

.btn {
  border: none; border-radius: 10px; padding: 10px 20px; font-size: 0.95rem;
  cursor: pointer; font-weight: 600;
}
.btn-primary { background: var(--accent); color: #fff; transition: background 0.15s; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-open { margin-top: auto; align-self: flex-start; }

/* ---------- 和弦图库 ---------- */
.chord-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px;
}
.chord-card {
  margin: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 6px; box-shadow: var(--shadow);
  display: flex; justify-content: center; transition: transform 0.15s;
}
.chord-card:hover { transform: translateY(-3px); }
.chord-name { font-size: 1.15rem; font-weight: 700; fill: var(--ink); }
.chord-x { font-size: 11px; fill: #8a92a1; }
.chord-pos { font-size: 10px; fill: var(--ink-soft); }
.chord-dotnum { font-size: 9px; fill: #fff; font-weight: 700; }

/* ---------- 资源导航 ---------- */
.res-cat { margin-bottom: 34px; }
.sec-sub-title { font-size: 1.12rem; color: var(--teal); margin: 0 0 14px; }
.res-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px;
}
.res-card {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.res-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.res-head { display: flex; justify-content: space-between; align-items: center; }
.res-head h3 { margin: 0; font-size: 1.08rem; }
.res-go { color: var(--accent); font-size: 1.1rem; }
.res-card p { color: var(--ink-soft); font-size: 0.9rem; margin: 8px 0 10px; }
.res-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.res-tags span {
  background: var(--teal-soft); color: var(--teal); border-radius: 999px;
  padding: 2px 10px; font-size: 0.75rem; font-weight: 600;
}

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.about-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.about-card h3 { margin: 0 0 10px; font-size: 1.02rem; }
.about-card p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 30px 0; text-align: center;
}
.site-footer p { margin: 4px 0; }
.foot-note { color: #8a92a1; font-size: 0.84rem; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(30, 34, 46, 0.55); backdrop-filter: blur(4px);
  padding: 4vh 4vw; overflow-y: auto;
}
.modal.show { display: flex; align-items: flex-start; justify-content: center; }
.modal-box {
  position: relative; background: var(--surface); border-radius: 18px;
  width: min(980px, 100%); padding: 34px 34px 28px; box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 38px; height: 38px;
  border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface);
  font-size: 1rem; cursor: pointer; color: var(--ink-soft);
}
.modal-close:hover { border-color: var(--accent); color: var(--accent-deep); }
.modal-box h2 { margin: 0 0 4px; }
.m-sub { color: var(--ink-soft); margin: 0 0 12px; font-size: 0.92rem; }
.m-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.m-desc { color: var(--ink-soft); font-size: 0.94rem; margin: 0 0 10px; }
.chordline {
  background: var(--accent-soft); border-radius: 10px; padding: 10px 16px;
  font-size: 0.92rem; color: var(--accent-deep); margin-bottom: 12px;
}
.player-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 8px 0 4px; }
.tab-scroll {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 12px;
  background: #fbfcfe; padding: 10px 6px; margin-top: 12px;
}
.tab-word { font-weight: 800; font-size: 13px; fill: #4a5060; }
.tab-chord { font-weight: 700; font-size: 15px; fill: var(--teal); }
.tab-barnum { font-size: 11px; fill: #8a92a1; }
.tab-fret { font-size: 11px; font-weight: 700; fill: var(--ink); }
.tabnote.active circle { fill: var(--accent); }
.tabnote.active text { fill: #fff; }
.tabstem.active line { stroke: var(--accent-deep); }

.chord-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.chord-row h4, #mChords h4 { margin: 16px 0 4px; font-size: 0.98rem; }
.mini-chord {
  background: #fbfcfe; border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px 2px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .br-pc { display: none; }
  .nav a { margin-left: 12px; font-size: 0.88rem; }
  .hero { padding: 52px 0 44px; }
  .section { padding: 46px 0; }
  .modal-box { padding: 26px 18px 22px; }
  .hero-stats { gap: 28px; }
  .about-grid { grid-template-columns: 1fr; }
}
