* {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f5f5;
  --text: #242424;
  --text-strong: #111111;
  --muted: #898989;
  --ring: rgba(34, 42, 53, 0.08);
  --shadow-card:
    rgba(19, 19, 22, 0.7) 0 1px 5px -4px,
    rgba(34, 42, 53, 0.08) 0 0 0 1px,
    rgba(34, 42, 53, 0.05) 0 4px 8px 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--page-bg, none);
  background-size: cover;
  background-position: center;
}

.container {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.site-header,
.site-footer {
  margin: 0 0 16px;
  padding: 22px 24px;
  border-radius: 16px;
  background: #ffffff;
  color: var(--text);
  font-size: 15px;
  line-height: 1.9;
  text-align: left;
  box-shadow: var(--shadow-card);
}

.site-footer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.site-header h2,
.site-header h3 {
  margin: 0 0 12px;
  color: var(--text-strong);
  line-height: 1.25;
}

.site-header h2 {
  font-size: 26px;
}

.site-header h3 {
  font-size: 20px;
}

.site-header p,
.site-header ul,
.site-header ol,
.site-header blockquote {
  margin-top: 0;
  margin-bottom: 12px;
}

.site-header ul,
.site-header ol {
  padding-left: 22px;
}

.site-header blockquote {
  padding: 10px 14px;
  border-left: 3px solid #242424;
  background: #f5f5f5;
  color: #444444;
}

.site-header img,
#description img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px 0;
  border-radius: 8px;
  box-shadow: var(--shadow-card);
}

.site-header > :last-child,
.site-footer > :last-child {
  margin-bottom: 0;
}

.guide-card,
.loading-panel,
.error-panel {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.guide-header {
  padding: 42px 34px 30px;
  box-shadow: rgba(34, 42, 53, 0.08) 0 1px 0 0;
  background: #ffffff;
}

.section-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

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

.audio-mode-status {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 9999px;
  background: #f5f5f5;
  color: #666666;
  font-size: 12px;
  line-height: 26px;
  white-space: nowrap;
}

.guide-header h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 8vw, 56px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: 0;
}

.audio-section,
.images-section,
.description-section {
  padding: 26px 34px;
  box-shadow: rgba(34, 42, 53, 0.08) 0 -1px 0 0 inset;
}

.images-section {
  box-shadow: none;
}

.section-title {
  margin-bottom: 12px;
}

#audio-player {
  display: none;
}

.player-container {
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow:
    rgba(34, 42, 53, 0.1) 0 0 0 1px,
    rgba(34, 42, 53, 0.05) 0 4px 8px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.play-button {
  flex: 0 0 auto;
  min-width: 64px;
  height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 9999px;
  background: #242424;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  box-shadow: rgba(255, 255, 255, 0.15) 0 2px 0 inset;
}

.time-info {
  flex: 1;
  min-width: 0;
}

.time-display {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.progress-bar,
.volume-slider {
  position: relative;
  overflow: hidden;
  height: 8px;
  border-radius: 9999px;
  background: #eeeeee;
  cursor: pointer;
}

.progress-fill,
.volume-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: #242424;
}

.volume-fill {
  width: 100%;
}

.player-extra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.playback-speed {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.speed-button,
.volume-icon {
  min-height: 30px;
  padding: 5px 9px;
  border: 0;
  border-radius: 9999px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  box-shadow: rgba(34, 42, 53, 0.1) 0 0 0 1px;
}

.speed-button.active {
  color: #ffffff;
  background: #242424;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 142px;
}

.volume-slider {
  flex: 1;
  height: 6px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.image-item {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #f5f5f5;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.image-item:first-child:nth-last-child(1),
.image-item:first-child:nth-last-child(2) {
  aspect-ratio: 16 / 9;
}

.image-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 17, 17, 0.9);
}

.image-lightbox img {
  max-width: 100%;
  max-height: 86vh;
  border-radius: 8px;
  object-fit: contain;
  background: #111;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 9999px;
  background: #ffffff;
  color: #242424;
  cursor: pointer;
}

#description {
  color: var(--text);
  font-size: 17px;
  line-height: 2;
  white-space: normal;
  word-break: break-word;
}

#description p,
#description ul,
#description ol,
#description blockquote,
#description h2,
#description h3 {
  margin-top: 0;
  margin-bottom: 16px;
}

#description ul,
#description ol {
  padding-left: 22px;
}

#description blockquote {
  padding: 10px 14px;
  border-left: 3px solid #242424;
  background: #f5f5f5;
  color: #444444;
}

#description h2,
#description h3 {
  color: var(--text-strong);
  line-height: 1.35;
}

.loading-panel {
  padding: 26px;
}

.skeleton {
  border-radius: 8px;
  background: #eeeeee;
}

.skeleton-title {
  width: 62%;
  height: 36px;
  margin-bottom: 14px;
}

.skeleton-line {
  width: 42%;
  height: 18px;
  margin-bottom: 22px;
}

.skeleton-audio {
  height: 78px;
  margin-bottom: 18px;
}

.skeleton-text {
  height: 18px;
  margin-bottom: 10px;
}

.skeleton-text.short {
  width: 70%;
}

.error-panel {
  padding: 48px 24px;
  text-align: center;
}

.error-panel h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.error-panel p {
  margin: 0;
  color: var(--muted);
}

.not-found-page {
  display: block;
  margin-top: 18vh;
  text-align: left;
}

.back-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 22px;
  padding: 9px 14px;
  border-radius: 8px;
  background: #242424;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: rgba(255, 255, 255, 0.15) 0 2px 0 inset;
}

#error {
  padding: 32px 24px;
}

@media (max-width: 520px) {
  .container {
    padding: 10px 10px 28px;
  }

  .guide-header,
  .audio-section,
  .images-section,
  .description-section {
    padding-left: 18px;
    padding-right: 18px;
  }

  .player-controls,
  .player-extra {
    align-items: stretch;
    flex-direction: column;
  }

  .play-button {
    width: 100%;
  }

  .volume-control {
    width: 100%;
  }

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

}
