:root {
  --bg: #080e11;
  --card: rgba(12, 22, 24, 0.62);
  --card-inner: rgba(9, 16, 19, 0.72);
  --border: rgba(212, 175, 106, 0.2);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(212, 175, 106, 0.52);
  --accent: #dfc082;
  --accent-soft: rgba(212, 175, 106, 0.16);
  --text: #f4f1ea;
  --muted: #9aaab0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Nano Banana Ambient Studio Background */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 88% 10%, rgba(212, 175, 106, 0.14), transparent 42%),
    radial-gradient(circle at 10% 86%, rgba(26, 92, 74, 0.22), transparent 46%),
    linear-gradient(180deg, rgba(6, 12, 15, 0.24) 0%, rgba(7, 14, 17, 0.38) 55%, rgba(6, 11, 14, 0.56) 100%),
    url("./assets/posters/bg_atmosphere.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.topbar,
.main-stage,
.footer {
  position: relative;
  z-index: 1;
}

.container {
  width: min(1140px, calc(100% - 40px));
  margin: 0 auto;
}

/* Top Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 14, 17, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(145deg, #1a4738, #102a21);
  border: 1px solid rgba(212, 175, 106, 0.6);
  color: #f2d497;
  font-weight: 700;
  font-size: 0.78rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.brand-title {
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-btn.active {
  background: rgba(212, 175, 106, 0.24);
  color: #f6dc9f;
}

/* Main Stage */
.main-stage {
  flex: 1;
  padding: 24px 0 48px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Top Hero Banner */
.hero-banner {
  position: relative;
  min-height: 292px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 106, 0.3);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  background: #0a1412;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  display: block;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(7, 14, 13, 0.94) 0%,
    rgba(8, 17, 15, 0.82) 34%,
    rgba(8, 16, 15, 0.22) 66%,
    rgba(8, 14, 15, 0.04) 100%
  );
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 490px;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(212, 175, 106, 0.15);
  border: 1px solid rgba(212, 175, 106, 0.38);
  color: #f2d494;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fbf8f1;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.hero-desc {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.65;
  color: rgba(235, 239, 238, 0.84);
}

/* Interleaved Chapter Bands (Images Inserted Per Section, Alternating Left/Right) */
.chapter-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.chapter-band {
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 20px;
  border-radius: 18px;
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chapter-band.is-reversed {
  grid-template-columns: minmax(0, 1fr) 370px;
}

.chapter-band.is-reversed .chapter-visual {
  order: 2;
}

.chapter-band.is-reversed .chapter-content {
  order: 1;
}

/* Embedded Chapter Visual Card */
.chapter-visual {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 13px;
  overflow: hidden;
  background: var(--card-inner);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.chapter-visual:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
}

.visual-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b1215;
}

.visual-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.chapter-visual:hover .visual-frame img {
  transform: scale(1.03);
}

.visual-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(8, 14, 17, 0.82);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(212, 175, 106, 0.4);
  color: #f3d596;
  font-size: 0.72rem;
  font-weight: 600;
}

.visual-caption {
  padding: 11px 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.visual-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: #efeae0;
}

.visual-cta {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}

/* Chapter Lesson List */
.chapter-content {
  min-width: 0;
  padding: 2px 4px;
}

.chapter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.chapter-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 650;
  color: #f0d394;
  letter-spacing: 0.01em;
}

.chapter-range {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  color: var(--muted);
}

.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 11px;
  border-radius: 9px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, transform 0.15s ease;
}

.lesson-row:hover {
  background: rgba(212, 175, 106, 0.1);
}

.lesson-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.lesson-week {
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--accent);
  width: 54px;
}

.lesson-name {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}

.lesson-arrow {
  flex-shrink: 0;
  font-size: 0.86rem;
  color: var(--muted);
  transition: transform 0.15s ease, color 0.15s ease;
}

.lesson-row:hover .lesson-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(7, 12, 15, 0.72);
  backdrop-filter: blur(12px);
  padding: 15px 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-lang {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.footer-lang:hover {
  color: var(--text);
}

@media (max-width: 880px) {
  .hero-banner {
    min-height: 250px;
  }
  .hero-shade {
    background: linear-gradient(
      180deg,
      rgba(7, 14, 13, 0.62) 0%,
      rgba(7, 14, 13, 0.9) 100%
    );
  }
  .hero-copy {
    padding: 26px 24px;
  }
  .chapter-band,
  .chapter-band.is-reversed {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  .chapter-band.is-reversed .chapter-visual {
    order: 1;
  }
  .chapter-band.is-reversed .chapter-content {
    order: 2;
  }
}
