/* ===== 陈奕迅词典 · Claude 主题 · 米白 / 暖橙 / 石墨 ===== */

:root {
  /* Claude 配色 */
  --bg: #FAF9F5;           /* 主背景：温暖米白 */
  --bg-card: #FFFFFF;      /* 卡片：纯白 */
  --bg-soft: #F2EFE6;      /* 次背景：浅米 */
  --bg-codeblock: #F5F2EA; /* 引用块：更柔的米 */

  --ink: #262624;          /* 主文字：深石墨 */
  --ink-soft: #4D4A45;     /* 次文字 */
  --ink-mute: #85827A;     /* 弱文字：温暖灰 */
  --ink-faint: #B8B3A7;    /* 最浅 */

  --accent: #C96442;       /* Claude 橙 */
  --accent-soft: #D97757;  /* 次橙 */
  --accent-deep: #A04E32;  /* 深橙 */
  --accent-tint: #FBE8DC;  /* 橙的淡背景 */

  --rule: #E8E3D5;         /* 分割线：浅米色 */
  --rule-soft: #F0EBDD;    /* 更浅分割 */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, 'PingFang SC', 'PingFang HK',
               'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  font-feature-settings: "ss01", "cv01";
}

/* serif 字族（标题、歌词、释义里） */
.serif, .entry-song, .ly-line, .card-lyric, .cover .title,
.def-gloss, .colophon .quote {
  font-family: 'Source Serif 4', 'Source Serif Pro', 'Iowan Old Style',
               'Noto Serif SC', 'Songti SC', 'STSong', serif;
}

/* ============ 封面 ============ */
.cover {
  text-align: center;
  padding: 72px 20px 48px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 42px;
  font-weight: 700;
  border-radius: 14px;
  letter-spacing: -2px;
  margin-bottom: 22px;
  font-family: 'Source Serif 4', 'STKaiti', 'KaiTi', serif;
  box-shadow: 0 6px 20px rgba(201, 100, 66, 0.18),
              0 1px 3px rgba(201, 100, 66, 0.10);
}

.cover .title {
  font-size: 46px;
  letter-spacing: 1px;
  margin: 6px 0 14px;
  font-weight: 600;
  color: var(--ink);
}

.title-sep { color: var(--ink); margin: 0 4px; }
.title-spacer { display: inline-block; width: 16px; }

.cover .subtitle {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 4px;
  margin: 0 0 20px;
  font-weight: 500;
  text-transform: uppercase;
}

.cover .byline {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}

.cover .edition {
  font-size: 12px;
  color: var(--ink-mute);
  margin: 0;
  letter-spacing: 1.5px;
  font-style: italic;
}

/* ============ 主体 ============ */
.book {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}

.meta-row {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  letter-spacing: 0.5px;
}

.meta-row .divider { opacity: 0.4; }
.meta-row .meta-tip { margin-left: auto; font-style: italic; }

/* ============ 試聽解鎖提示 ============ */
.audio-unlock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: -8px auto 28px;
  padding: 11px 20px;
  max-width: 560px;
  border: 1px dashed var(--accent);
  border-radius: 999px;
  background: rgba(201, 100, 66, 0.06);
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.7s ease, transform 0.7s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.audio-unlock:hover { background: rgba(201, 100, 66, 0.12); }

.audio-unlock-icon {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
}

.audio-unlock.attention {
  animation: unlock-pulse 1.4s ease-in-out infinite;
  background: rgba(201, 100, 66, 0.15);
}

@keyframes unlock-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 100, 66, 0.45); }
  50%      { box-shadow: 0 0 0 10px rgba(201, 100, 66, 0); }
}

.audio-unlock.unlocked {
  border-style: solid;
  background: rgba(34, 139, 87, 0.08);
  border-color: #4a9b6f;
  color: #2f7a52;
  animation: none;
  box-shadow: none;
}

.audio-unlock.fading {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

/* ============ 词性分组 ============ */
.type-section { margin-bottom: 44px; }

.type-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font-weight: 500;
}

.type-tag {
  display: inline-block;
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-size: 12px;
  padding: 3px 11px;
  border-radius: 6px;
  letter-spacing: 1px;
  font-weight: 600;
}

.type-name {
  font-size: 20px;
  color: var(--ink);
  letter-spacing: 2px;
  font-weight: 500;
}

.type-count {
  font-size: 12px;
  color: var(--ink-mute);
  margin-left: auto;
}

/* ============ 卡片（首页 · 黑胶版） ============ */
.word-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

.word-card a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.3s ease,
              transform 0.3s ease,
              box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.word-card a:hover {
  border-color: var(--accent-soft);
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(38, 38, 36, 0.10),
              0 4px 12px rgba(38, 38, 36, 0.05);
}

/* ---- 黑胶包裹层（不旋转，承载音符提示） ---- */
.vinyl-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

/* ---- 黑胶碟身（旋转的部分） ---- */
.vinyl {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  background:
    /* 中心高光：让中央有点立体 */
    radial-gradient(circle at 38% 38%,
      rgba(255, 255, 255, 0.06) 0%,
      transparent 28%),
    /* 唱片主体径向渐变 */
    radial-gradient(circle at center,
      #1a1a1a 0%,
      #0d0d0d 40%,
      #050505 80%,
      #000000 100%);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    0 2px 6px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.6s ease;
}

/* 同心圆纹路：双层叠加（密细线 + 疏粗线），模拟真实唱片刻槽 */
.vinyl::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    /* 细密刻槽（每 2.4px 一道） */
    repeating-radial-gradient(
      circle at center,
      transparent 0,
      transparent 1.8px,
      rgba(255, 255, 255, 0.07) 1.8px,
      rgba(255, 255, 255, 0.07) 2.4px
    ),
    /* 较粗的"分段线"，每 7px 一道 */
    repeating-radial-gradient(
      circle at center,
      transparent 0,
      transparent 6.5px,
      rgba(255, 255, 255, 0.13) 6.5px,
      rgba(255, 255, 255, 0.13) 7px
    );
  pointer-events: none;
}

/* 斜向反光高光 + 整体光晕 */
.vinyl::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.03) 22%,
      transparent 40%,
      transparent 60%,
      rgba(255, 255, 255, 0.025) 78%,
      rgba(255, 255, 255, 0.08) 100%
    );
  pointer-events: none;
}

/* hover 时唱片缓慢旋转（7s 一圈，更"在播" 但能看清封面） */
.word-card a:hover .vinyl {
  animation: spin-vinyl 7s linear infinite;
}

/* 右上角音符提示：hover 时浮现（在 vinyl-wrap 内，不受 vinyl 旋转影响） */
.vinyl-play-hint {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, "Helvetica Neue", sans-serif;
  box-shadow: 0 4px 12px rgba(201, 100, 66, 0.4);
  opacity: 0;
  transform: scale(0.5) translateY(4px);
  transition: opacity 0.3s ease,
              transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 4;
}

.word-card a:hover .vinyl-play-hint {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* 音符的呼吸动画（hover 时） */
.word-card a:hover .vinyl-play-hint {
  animation: pulse-note 1.5s ease-in-out 0.4s infinite;
}

@keyframes pulse-note {
  0%, 100% { box-shadow: 0 4px 12px rgba(201, 100, 66, 0.4); }
  50% { box-shadow: 0 4px 18px rgba(201, 100, 66, 0.7); }
}

@keyframes spin-vinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---- 中心 label：专辑封面 ---- */
.vinyl-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  height: 70%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* 三层 shadow：外接缝线、内压暗（picture disc 的物理感） */
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 0 2px rgba(255, 255, 255, 0.04),
    inset 0 0 12px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

/* 中心轴孔（盖在封面上）—— 用 inset shadow 模拟"穿过去的洞" */
.vinyl-label::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7.5%;
  height: 7.5%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.7),
    inset 0 1px 2px rgba(0, 0, 0, 0.65),
    inset 0 -0.5px 1px rgba(255, 255, 255, 0.3);
  z-index: 2;
}

/* ---- 黑胶下方：拼音 + 歌名 ---- */
.card-meta-row {
  text-align: center;
  margin-top: 24px;
  width: 100%;
}

.card-jyutping {
  font-size: 10.5px;
  color: var(--accent);
  letter-spacing: 1.8px;
  font-style: italic;
  margin-bottom: 7px;
  font-weight: 500;
  font-family: 'Inter', -apple-system, sans-serif;
  text-transform: lowercase;
}

.card-song {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--ink);
  font-family: 'Source Serif 4', 'Source Serif Pro',
               'Songti SC', 'STSong', serif;
  line-height: 1.2;
  /* 抵消 letter-spacing 让视觉居中 */
  padding-left: 4px;
}

/* ---- 金句（最底） ---- */
.card-lyric {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.7;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px dashed var(--rule);
  letter-spacing: 0.4px;
  text-align: center;
  width: 100%;
  font-style: italic;
}

.card-lyric .quote-mark {
  color: var(--accent-soft);
  font-weight: 600;
  margin: 0 2px;
  font-style: normal;
  font-size: 15px;
  vertical-align: -1px;
}

/* ============ 详情页 ============ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}

.back-link {
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.15s;
}

.back-link:hover { color: var(--accent); }

.page-brand {
  color: var(--ink-mute);
  letter-spacing: 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.seal-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 14px;
  border-radius: 6px;
  font-family: 'Source Serif 4', 'STKaiti', serif;
  font-weight: 700;
}

.entry { padding-top: 16px; }

.entry-head {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 22px;
  margin-bottom: 32px;
}

.entry-jyutping {
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 2px;
  font-style: italic;
  margin-bottom: 10px;
  font-weight: 500;
}

.entry-song {
  font-size: 56px;
  margin: 0 0 18px;
  letter-spacing: 4px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-btn {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: var(--ink-soft);
}

.audio-btn:hover {
  background: var(--accent-tint);
  color: var(--accent-deep);
  border-color: var(--accent-soft);
}

.audio-btn.audio-empty {
  opacity: 0.4;
  cursor: help;
}

.category-tag {
  display: inline-block;
  background: color-mix(in oklab, var(--cat) 10%, transparent);
  color: var(--cat);
  border: 1px solid color-mix(in oklab, var(--cat) 30%, transparent);
  padding: 3px 11px;
  font-size: 12px;
  border-radius: 5px;
  letter-spacing: 1.5px;
  font-weight: 500;
}

/* ============ 释义 ============ */
.entry-section { margin-bottom: 36px; }

.section-label {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 4px;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font-weight: 600;
  text-transform: uppercase;
}

.def {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 4px 0;
}

.def-layer {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  min-width: 60px;
  padding-top: 4px;
  text-align: right;
  border-right: 1px solid var(--rule);
  padding-right: 14px;
}

.def-body { flex: 1; }

.def-gloss {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
}

.def-muggle-block .def-layer {
  color: var(--accent-deep);
}

.def-muggle-block .def-body {
  background: var(--accent-tint);
  padding: 10px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.def-muggle-block .def-gloss {
  color: var(--ink);
  font-style: italic;
  font-weight: 500;
}

/* ============ 金句 ============ */
.lyric {
  padding: 18px 22px;
  background: var(--bg-codeblock);
  border-left: 3px solid var(--accent);
  margin-bottom: 14px;
  border-radius: 0 8px 8px 0;
}

.ly-line {
  margin: 0 0 12px;
  font-size: 19px;
  color: var(--ink);
  line-height: 1.85;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.ly-why {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
  font-family: 'Inter', -apple-system, 'PingFang SC', sans-serif;
}

.why-label {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  margin-right: 8px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ============ 出处 ============ */
.credits {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  font-size: 14px;
  color: var(--ink-soft);
  padding: 16px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.credits span {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.credits em {
  display: inline-block;
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ============ 注 / 上下首 ============ */
.entry-note {
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0;
  line-height: 1.8;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: 6px;
}

.entry-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}

.entry-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  transition: all 0.15s;
  letter-spacing: 0.5px;
  background: var(--bg-card);
}

.entry-nav a:hover {
  color: var(--accent-deep);
  border-color: var(--accent-soft);
  background: var(--accent-tint);
}

/* ============ 版权 ============ */
.colophon {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.95;
  letter-spacing: 0.5px;
}

.colophon p { margin: 2px 0; }

.colophon .quote {
  margin-top: 16px !important;
  font-style: italic;
  color: var(--accent);
  font-size: 15px;
  letter-spacing: 1.5px;
}

.colophon .rights {
  margin-top: 18px !important;
  font-size: 11px;
  color: var(--ink-mute);
  opacity: 0.7;
  letter-spacing: 0.3px;
  line-height: 1.7;
  max-width: 520px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-mute);
}

.empty a { color: var(--accent); text-decoration: none; }

/* ============ 移动端 ============ */
@media (max-width: 600px) {
  .cover { padding: 50px 16px 36px; }
  .seal { width: 60px; height: 60px; font-size: 34px; }
  .cover .title { font-size: 32px; letter-spacing: 1px; }
  .cover .subtitle { letter-spacing: 3px; font-size: 10px; }
  .book { padding: 24px 16px 60px; }
  .word-grid { grid-template-columns: 1fr; gap: 22px; }
  .vinyl { width: 180px; height: 180px; }
  .label-song { font-size: 14px; letter-spacing: 1.5px; }
  .entry-song { font-size: 40px; letter-spacing: 3px; }
  .page-header { padding: 14px 16px; }
  .def { flex-direction: column; gap: 4px; }
  .def-layer { text-align: left; border-right: none; border-bottom: 1px solid var(--rule); padding-right: 0; padding-bottom: 4px; min-width: auto; }
  .credits { flex-direction: column; gap: 8px; }
}
