/* ===== Reset / Variables ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--cream);
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(circle at 85% 8%, rgba(201,164,76,0.10), transparent 32%),
    radial-gradient(circle at 12% 88%, rgba(255,107,53,0.07), transparent 28%),
    linear-gradient(160deg, #181431 0%, var(--bg-primary) 48%, var(--bg-deep) 100%);
  background-repeat: no-repeat;
}
main, #main-content { display: block; flex: 1 0 auto; outline: none; }

:root {
  --bg-primary: #1A1638;
  --bg-deep: #0D0A1F;
  --gold: #C9A44C;
  --orange: #FF6B35;
  --cream: #F5F0E6;
  --brown-black: #2A1B0F;
  --red: #E8513A;
  --gray-light: #B0A9A0;
  --glass-white: rgba(255,255,255,0.08);
  --font-title: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Han Serif SC", "Songti SC", "Noto Serif SC", "SimSun", serif;
  --font-mono: "Roboto Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 900;
  color: var(--cream);
  line-height: 1.25;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--gold); text-decoration: none; transition: color 0.2s ease, border-color 0.2s ease; }
a:hover { color: var(--orange); }
ul, ol { padding-left: 1.4em; }

::selection { background: rgba(201,164,76,0.35); color: var(--cream); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ===== Skip Link ===== */
.skipLink {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 2000;
  background: var(--gold);
  color: var(--bg-deep);
  padding: 10px 20px;
  font-weight: 700;
  border-radius: 4px;
  transition: top 0.2s ease;
}
.skipLink:focus-visible { top: 16px; }

/* ===== Reading Progress ===== */
.readingProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 1100;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  box-shadow: 0 0 8px rgba(201,164,76,0.5);
  pointer-events: none;
  transition: width 0.12s linear;
}

/* ===== Header ===== */
.siteHeader {
  position: relative;
  background: linear-gradient(180deg, var(--bg-deep) 0%, rgba(26,22,56,0.92) 100%);
  border-bottom: 1px solid var(--glass-white);
}
.siteHeader__inner {
  max-width: 1280px;
  margin-inline: auto;
  padding: 18px clamp(16px, 4vw, 32px) 0;
}
.siteHeader__top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}
.siteHeader__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  color: var(--cream);
  text-decoration: none;
}
.siteHeader__brand:hover { color: var(--gold); }
.siteHeader__brandMark {
  position: relative;
  width: 26px;
  height: 26px;
  flex: none;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.siteHeader__brandMark::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--bg-deep);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.siteHeader__brandName { display: inline-block; }
.siteHeader__brandTag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--gold);
  border: 1px solid rgba(201,164,76,0.4);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.siteHeader__notice {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: var(--gray-light);
  display: none;
}
.siteHeader__toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--glass-white);
  border-radius: 6px;
  padding: 6px 10px 5px;
  cursor: pointer;
  color: var(--cream);
  line-height: 1;
}
.siteHeader__toggleBar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 2px 0;
  background: var(--cream);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.siteHeader__toggleText {
  display: block;
  margin-top: 3px;
  font-size: 0.62rem;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--gray-light);
}
.siteHeader__toggle[aria-expanded="true"] .siteHeader__toggleBar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.siteHeader__toggle[aria-expanded="true"] .siteHeader__toggleBar:nth-child(2) { opacity: 0; }
.siteHeader__toggle[aria-expanded="true"] .siteHeader__toggleBar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.siteHeader__nav {
  display: none;
  margin-top: 12px;
  border-top: 1px solid var(--glass-white);
}
.siteHeader__nav[data-open="true"] {
  display: block;
  animation: navFade 0.2s ease;
}
@keyframes navFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.siteHeader__list {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}
.siteHeader__link {
  position: relative;
  display: block;
  padding: 13px 6px 11px;
  color: var(--cream);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.siteHeader__link:hover { color: var(--gold); }
.siteHeader__link[aria-current="page"] { color: var(--gold); }
.siteHeader__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
}
.siteHeader__user {
  display: block;
  padding: 12px 6px;
  margin-left: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--gray-light);
}

@media (min-width: 640px) {
  .siteHeader__notice { display: block; }
}

@media (min-width: 768px) {
  .siteHeader__inner { padding-top: 24px; }
  .siteHeader__toggle { display: none; }
  .siteHeader__nav,
  .siteHeader__nav[data-open="true"] {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    animation: none;
  }
  .siteHeader__list {
    flex-direction: row;
    gap: 4px;
  }
  .siteHeader__link {
    padding: 14px 20px 12px;
    border-bottom: 2px solid transparent;
  }
  .siteHeader__link[aria-current="page"] { border-bottom-color: var(--orange); }
  .siteHeader__link[aria-current="page"]::after { display: none; }
  .siteHeader__user {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    padding: 14px 0 12px;
  }
}

/* ===== Footer ===== */
.siteFooter {
  position: relative;
  flex-shrink: 0;
  padding-top: 64px;
  background:
    radial-gradient(circle at 18% 0%, rgba(201,164,76,0.07), transparent 36%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-deep) 100%);
  border-top: 1px solid var(--glass-white);
}
.siteFooter::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,164,76,0.7) 20%, rgba(255,107,53,0.5) 80%, transparent);
}
.siteFooter__inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1280px;
  margin-inline: auto;
  padding: 0 clamp(16px, 4vw, 32px) 24px;
}
.siteFooter__brand { display: block; }
.siteFooter__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--cream);
}
.siteFooter__logo::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.siteFooter__slogan {
  margin: 0;
  font-size: 0.95rem;
  color: var(--gray-light);
}
.siteFooter__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.siteFooter__list a {
  display: inline-block;
  padding: 6px 0;
  color: var(--gray-light);
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
}
.siteFooter__list a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.siteFooter__contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--gray-light);
}
.siteFooter__contactLine {
  display: flex;
  gap: 8px;
  margin: 0;
}
.siteFooter__contactLabel {
  flex: none;
  min-width: 3em;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.siteFooter__bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--glass-white);
  padding-top: 18px;
  font-size: 0.8rem;
  color: var(--gray-light);
}

@media (min-width: 768px) {
  .siteFooter__inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    align-items: start;
    gap: 32px;
  }
  .siteFooter__bottom {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ===== Common Containers ===== */
.container {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}
.pageHero {
  position: relative;
  isolation: isolate;
  padding: 48px 0 24px;
}
.pageTitle {
  position: relative;
  width: fit-content;
  max-width: 100%;
  padding: 0.2em 0.5em 0.2em 0;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.15;
  color: var(--cream);
}
.pageTitle::before {
  content: "";
  position: absolute;
  top: 0.08em;
  bottom: 0.08em;
  left: 0;
  right: 0.4em;
  z-index: -1;
  background: linear-gradient(90deg, rgba(201,164,76,0.18), transparent 70%);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 14px 100%);
}
.pageLead {
  font-size: 1.1rem;
  max-width: 60ch;
  color: var(--gray-light);
}
.textLead {
  font-size: 1.1rem;
  color: var(--gray-light);
  max-width: 60ch;
}
.textMono {
  font-family: var(--font-mono);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 16px 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gray-light);
}
.breadcrumb__item { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  color: var(--gray-light);
  opacity: 0.6;
}
.breadcrumb__item[aria-current="page"] { color: var(--cream); }
.breadcrumb a { color: var(--gray-light); }
.breadcrumb a:hover { color: var(--gold); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--gold { background: var(--gold); color: var(--bg-deep); }
.btn--gold:hover { background: #dbb95f; color: var(--bg-deep); }
.btn--orange { background: var(--orange); color: #fff; }
.btn--orange:hover { background: #ff8354; color: #fff; }
.btn--ghost { border-color: var(--glass-white); color: var(--cream); background: transparent; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ===== Grids ===== */
.gridBase {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 768px) {
  .gridBase--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gridBase--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.editorGrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
@media (min-width: 768px) {
  .editorGrid--magazine { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .editorGrid--magazine .editorGrid__aside {
    order: -1;
    border-left: 3px solid var(--gold);
    padding-left: 16px;
  }
}

/* ===== Cards / Figure Placeholder ===== */
.cardBase {
  position: relative;
  background: linear-gradient(145deg, rgba(42,27,15,0.9), rgba(13,10,31,0.9));
  border: 1px solid var(--glass-white);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.cardBase:hover {
  transform: translateY(-3px);
  border-color: rgba(201,164,76,0.55);
  box-shadow: 0 12px 34px rgba(0,0,0,0.4);
}
.figFrame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-white);
  border-radius: 8px;
  background-color: var(--bg-deep);
}
.figFrame--landscape { aspect-ratio: 16 / 9; }
.figFrame--portrait { aspect-ratio: 3 / 4; }
.figFrame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 32% 28%, rgba(201,164,76,0.14), transparent 42%),
    linear-gradient(135deg, rgba(13,10,31,0.8), rgba(26,22,56,0.3)),
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(245,240,230,0.03) 14px 15px);
}
.figFrame::after {
  content: "";
  position: absolute;
  left: 8%;
  bottom: 8%;
  width: 30%;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* ===== Notes ===== */
.noteInfo {
  border-left: 3px solid var(--gold);
  background: rgba(201,164,76,0.06);
  padding: 12px 18px;
  border-radius: 0 6px 6px 0;
  font-size: 0.92rem;
  color: var(--cream);
}
.noteWarn {
  border-left-color: var(--red);
  background: rgba(232,81,58,0.08);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .readingProgress { transition: none; }
}
