:root {
  --ink: #201a17;
  --muted: #756b64;
  --paper: #f7f1e7;
  --paper-soft: #fcf8f0;
  --line: rgba(32, 26, 23, 0.16);
  --line-strong: rgba(32, 26, 23, 0.32);
  --accent: #9a3f2c;
  --accent-dark: #6f2b20;
  --sage: #6c755f;
  --blue: #31566b;
  --gold: #b68a41;
  --shadow: 0 16px 42px rgba(40, 32, 24, 0.12);
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(154, 63, 44, 0.08), transparent 28%),
    radial-gradient(circle at 86% 8%, rgba(49, 86, 107, 0.08), transparent 30%),
    linear-gradient(180deg, var(--paper) 0%, #efe4d2 100%);
  font-family: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  line-height: 1.72;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 241, 231, 0.92);
  backdrop-filter: blur(14px);
}

.nav {
  width: min(var(--max), calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand span,
.nav-links a,
.eyebrow,
.meta,
.piece-code,
.slot small,
.note-label {
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

.brand span {
  font-size: 12px;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  color: var(--paper-soft);
  background: var(--ink);
  border-radius: 999px;
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  color: var(--ink);
  background: transparent;
}

.page {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 74px 0 48px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: end;
}

.hero.compact {
  grid-template-columns: 1fr;
  max-width: 860px;
  padding-bottom: 26px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: 64px;
}

h2 {
  margin-top: 56px;
  margin-bottom: 18px;
  font-size: 38px;
}

h3 {
  margin-top: 30px;
  margin-bottom: 10px;
  font-size: 22px;
}

p {
  margin: 0 0 16px;
}

.lead {
  margin-top: 20px;
  max-width: 760px;
  color: #3c332e;
  font-size: 20px;
}

.piece-title-cn,
.cn-small {
  display: block;
  color: var(--muted);
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

.piece-title-cn {
  margin-top: 14px;
  font-size: 17px;
}

.cn-small {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.55;
}

.deck {
  padding: 26px;
  border: 1px solid var(--line);
  background: rgba(252, 248, 240, 0.72);
  box-shadow: var(--shadow);
}

.deck h2 {
  margin-top: 0;
}

.meta-grid,
.cards,
.grade-grid,
.source-grid,
.piece-grid,
.slot-grid {
  display: grid;
  gap: 16px;
}

.meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.meta-card,
.card,
.quote,
.figure-card,
.slot {
  border: 1px solid var(--line);
  background: rgba(252, 248, 240, 0.72);
}

.meta-card,
.card,
.slot {
  padding: 18px;
}

.meta {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grade-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card h3 {
  margin-top: 0;
}

.card p:last-child,
.grade-card p:last-child,
.slot p:last-child {
  margin-bottom: 0;
}

.grade-card {
  min-height: 164px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(252, 248, 240, 0.64);
  color: var(--ink);
  text-decoration: none;
}

.grade-card small {
  color: var(--accent-dark);
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.grade-card h3 {
  margin-top: 14px;
}

.grade-card.active {
  border-color: rgba(154, 63, 44, 0.55);
  background: rgba(252, 248, 240, 0.84);
  box-shadow: var(--shadow);
}

.grade-card.preview {
  border-color: rgba(49, 86, 107, 0.5);
}

.grade-card.locked {
  color: var(--muted);
  border-style: dashed;
}

.piece-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.piece-card {
  min-height: 238px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(252, 248, 240, 0.78);
  color: var(--ink);
  text-decoration: none;
}

.piece-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.piece-card h3 {
  margin-top: 8px;
  font-size: 22px;
}

.piece-code {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.piece-card .composer {
  color: var(--muted);
}

.chapter {
  padding: 22px 0 36px;
}

.section-body {
  max-width: 850px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: 34px;
  align-items: start;
}

.quote {
  margin: 28px 0;
  padding: 24px;
  border-left: 5px solid var(--accent);
  font-size: 22px;
}

.figure-card {
  overflow: hidden;
}

.figure-card img {
  display: block;
  width: 100%;
  height: auto;
}

.figure-card figcaption {
  padding: 12px 14px;
  color: var(--muted);
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 13px;
}

.figure-stack,
.figure-grid {
  display: grid;
  gap: 16px;
}

.figure-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 24px 0;
}

.figure-card.cover img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  background: rgba(252, 248, 240, 0.72);
}

.note-list,
.fact-list {
  padding-left: 1.2em;
}

.lyrics-block p {
  margin-top: 0;
  margin-bottom: 1.1em;
}

.lyrics-block .meta {
  margin-top: 1.4em;
}

.lyrics-block .meta:first-child {
  margin-top: 0;
}

.helper-text {
  color: var(--muted);
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

.note-list li,
.fact-list li {
  margin-bottom: 10px;
}

.note-label {
  display: inline-block;
  margin: 24px 0 8px;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.slot-section {
  margin: 44px 0;
}

.slot-section h2 {
  margin-top: 0;
}

.slot-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.slot {
  min-height: 120px;
  display: block;
  color: var(--ink);
  text-decoration: none;
}

button.slot {
  width: 100%;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  text-align: left;
}

.slot h3 {
  margin-top: 12px;
}

.slot.active {
  border-color: rgba(154, 63, 44, 0.45);
}

.slot.empty {
  color: var(--muted);
  background: rgba(252, 248, 240, 0.42);
}

.slot.pending {
  border-style: dashed;
}

.slot-expand {
  border-color: rgba(49, 86, 107, 0.56);
  background: rgba(49, 86, 107, 0.08);
}

.slot-expand:hover,
.slot-expand:focus-visible {
  border-color: var(--blue);
  box-shadow: var(--shadow);
}

.slot-grid-advanced {
  margin-top: 22px;
}

.slot-grid-advanced[hidden] {
  display: none !important;
}


/* NetEase Cloud Music embedded player */
.netease-player {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 8px 14px;
  border: 1px solid #c93a3a;
  background: #fff;
  border-radius: 8px;
  width: auto;
  min-width: 340px;
}
.netease-player iframe {
  border: none;
  height: 52px;
  flex: 1;
  min-width: 240px;
}
.netease-player-label {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 11px;
  color: #b33;
  line-height: 1.4;
  padding-right: 6px;
  border-right: 1px solid rgba(201, 58, 58, 0.3);
}

.analysis-table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

.analysis-table th,
.analysis-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.analysis-table th {
  color: var(--accent-dark);
  font-size: 13px;
  white-space: nowrap;
}

.source-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-grid a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(252, 248, 240, 0.62);
  text-decoration: none;
}

.footer {
  margin-top: 64px;
  padding: 34px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

.site-compliance {
  margin-top: 10px;
}

.site-compliance a {
  color: var(--muted);
  text-decoration: none;
}

.site-compliance a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.activation-panel {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(32, 26, 23, 0.04);
}

.activation-panel input {
  width: min(100%, 320px);
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper-soft);
  color: var(--ink);
  font-size: 16px;
}

.preview-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(49, 86, 107, 0.32);
  background: rgba(49, 86, 107, 0.06);
}

.preview-panel p {
  margin: 6px 0 0;
}

.small {
  color: var(--muted);
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

@media (max-width: 820px) {
  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 28px;
  }

  .hero,
  .two-col {
    grid-template-columns: 1fr;
  }

  .meta-grid,
  .cards,
  .grade-grid,
  .piece-grid,
  .figure-grid,
  .source-grid,
  .slot-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .nav-links {
    gap: 10px;
  }

  .preview-panel {
    align-items: flex-start;
    flex-direction: column;
  }
}
