/*
 * Fraunces is served from this site so the interface does not depend on
 * Google Fonts or any other third-party resource at runtime.
 */
@font-face {
  font-family: "Fraunces Local";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../assets/fonts/fraunces-latin.woff2") format("woff2");
}

:root {
  --ink: #12202a;
  --ink-soft: #3a4a56;
  --muted: #5c6b76;
  --paper: #e8eef2;
  --surface: #f6fafb;
  --line: rgba(18, 32, 42, 0.12);
  --teal: #0e6a6a;
  --teal-deep: #0a4c4c;
  --ember: #c45e2c;
  --mist: #b9ccd9;
  --white: #ffffff;
  --font-display: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --font-en: "Fraunces Local", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --max: 1080px;
  --header-h: 4rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 85% 55% at 100% -8%, rgba(14, 106, 106, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 45% at -8% 35%, rgba(185, 204, 217, 0.5), transparent 50%),
    linear-gradient(180deg, #e4ebf0 0%, var(--paper) 45%, #e3e9e6 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.65;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--teal-deep);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ember);
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.65rem 1.25rem;
  background: rgba(246, 250, 251, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.logo {
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-zh {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.logo-en {
  font-family: var(--font-en);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--teal-deep);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
  font-size: 1.1rem;
}

@media (max-width: 640px) {
  .nav-toggle {
    display: grid;
    place-items: center;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.85rem 1.25rem 1rem;
    gap: 0.75rem;
  }
  .nav-links.is-open {
    display: flex;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: min(88vh, 720px);
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 32, 42, 0.15) 0%, rgba(18, 32, 42, 0.62) 100%),
    radial-gradient(ellipse 70% 50% at 70% 30%, rgba(14, 106, 106, 0.45), transparent 60%),
    linear-gradient(135deg, #1a3a48 0%, #0e6a6a 42%, #1c4a5c 100%);
  animation: hero-shift 14s ease-in-out infinite alternate;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 20%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 28% 55%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 55% 18%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 72% 42%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 88% 28%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 40% 78%, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0.85;
  animation: star-drift 18s linear infinite;
}

@keyframes hero-shift {
  from { filter: saturate(1) brightness(1); }
  to { filter: saturate(1.08) brightness(1.05); }
}

@keyframes star-drift {
  from { transform: translateY(0); }
  to { transform: translateY(-12px); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 3.25rem;
  color: var(--white);
  animation: rise-in 0.9s ease-out both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-camp {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
  margin-bottom: 0.75rem;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.75rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.35rem;
}

.hero-brand-en {
  display: block;
  font-family: var(--font-en);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.88;
  margin-top: 0.35rem;
}

.hero-lead {
  max-width: 28rem;
  font-size: 1.05rem;
  opacity: 0.92;
  margin: 1.1rem 0 1.6rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--white);
  color: var(--teal-deep);
}

.btn-primary:hover {
  background: #f0f7f7;
  color: var(--teal-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.btn-teal {
  background: var(--teal);
  color: var(--white);
}

.btn-teal:hover {
  background: var(--teal-deep);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--teal-deep);
  border-color: var(--line);
}

.btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-head {
  margin-bottom: 1.5rem;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.section-head p {
  color: var(--muted);
  max-width: 36rem;
}

/* Day grid 九宫格 */
.day-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 560px) {
  .day-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
  }
}

.day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  padding: 0.75rem;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.day-cell:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--teal);
  transform: translateY(-2px);
  color: var(--ink);
}

.day-cell.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

.day-cell.is-active .day-status {
  color: rgba(255, 255, 255, 0.8);
}

.day-cell.is-locked {
  opacity: 0.55;
  cursor: default;
}

.day-cell.is-locked:hover {
  transform: none;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.day-num {
  font-family: var(--font-en);
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  font-weight: 700;
  line-height: 1;
}

.day-label {
  font-size: 0.75rem;
  margin-top: 0.35rem;
  font-weight: 500;
}

.day-status {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Subject chips */
.subject-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
  border-color: var(--teal);
  color: var(--teal-deep);
}

.chip.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

/* Entry list */
.entry-list {
  display: grid;
  gap: 0.85rem;
}

.entry {
  display: grid;
  gap: 0.35rem;
  padding: 1.15rem 1.25rem;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  animation: rise-in 0.45s ease-out both;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.entry-tag {
  color: var(--teal-deep);
  font-weight: 600;
}

.entry h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
}

.entry p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.entry-link {
  margin-top: 0.35rem;
  font-weight: 600;
  text-decoration: none;
  width: fit-content;
}

.entry-link:hover {
  text-decoration: underline;
}

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  background: rgba(14, 106, 106, 0.12);
  color: var(--teal-deep);
}

.empty-hint {
  padding: 1.5rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.4);
}

/* Day detail panel */
.day-panel {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.day-panel h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  margin-bottom: 0.5rem;
}

.day-theme {
  font-family: var(--font-en);
  font-style: italic;
  color: var(--teal-deep);
  margin-bottom: 0.25rem;
}

.day-theme-zh {
  color: var(--muted);
  margin-bottom: 1rem;
}

.section-block {
  margin: 1.35rem 0;
}

.section-block h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.section-block p {
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.q-list {
  margin: 0.75rem 0 0 1.15rem;
  color: var(--ink-soft);
}

.sources-block {
  margin-top: 1.75rem;
  padding: 1.25rem;
  background: rgba(14, 106, 106, 0.06);
  border: 1px solid var(--line);
}

.sources-block h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

.source-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

.source-item:first-of-type {
  border-top: none;
  padding-top: 0;
}

.source-item a {
  font-weight: 600;
  text-decoration: none;
}

.source-item a:hover {
  text-decoration: underline;
}

.source-item p {
  font-size: 0.9rem;
  color: var(--muted);
}

.upcoming-note {
  padding: 1.25rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  border: 1px dashed var(--line);
}

/* Page hero (knowledge) */
.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  animation: rise-in 0.7s ease-out both;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  margin-bottom: 0.4rem;
}

.page-hero p {
  color: var(--muted);
  max-width: 34rem;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0 1rem;
}

.filter-tabs .btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.filter-panel[hidden] {
  display: none;
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  padding: 1.75rem 0 2.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-footer strong {
  color: var(--ink-soft);
  font-weight: 600;
}
