/* ============================================================
   site.css — 合乐在线中心 共享样式
   1. reset  2. 变量  3. 基础排版  4. 头部  5. 页脚
   6. 通用组件  7. 网格与分区  8. 响应式  9. 无障碍
   ============================================================ */

/* ---------- 1. reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, p,
ul, ol, li, figure, blockquote,
dl, dd, figcaption { margin: 0; }

ul, ol { padding: 0; list-style: none; }

img, svg, video { display: block; max-width: 100%; height: auto; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

table { border-collapse: collapse; width: 100%; }

/* ---------- 2. 变量 ---------- */
:root {
  --ink: #0B2545;
  --ink-deep: #071A30;
  --paper: #F4EDE1;
  --paper-bright: #FBF8F2;
  --cyan: #00E5FF;
  --cyan-soft: #7FF3FF;
  --orange: #FF6B35;
  --amber: #FFB347;
  --graphite: #1C2B3A;
  --mist: #7A8A99;

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "Heiti SC", sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "Heiti SC", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;

  --shell-w: 1240px;
  --gutter: clamp(18px, 4.5vw, 64px);

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --hairline-light: rgba(11, 37, 69, 0.14);
  --hairline-dark: rgba(244, 237, 225, 0.16);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 3. 基础排版 ---------- */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.72;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection {
  background-color: var(--cyan);
  color: var(--ink-deep);
}

#main-content {
  display: block;
  min-height: 40vh;
  scroll-margin-top: 110px;
}

.shell {
  width: 100%;
  max-width: var(--shell-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- 4. 头部 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 999;
  transform: translateY(-180%);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background-color: var(--cyan);
  color: var(--ink-deep);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  transition: transform 0.25s var(--ease);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  --scroll-progress: 0%;
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--ink-deep);
  color: var(--paper);
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  transition: box-shadow 0.4s var(--ease);
}

.site-header[data-scrolled="true"] {
  box-shadow: 0 18px 38px -24px rgba(4, 14, 28, 0.95);
}

.header-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background-color: rgba(244, 237, 225, 0.08);
  overflow: hidden;
}

.header-progress span {
  display: block;
  height: 100%;
  width: var(--scroll-progress, 0%);
  background-image: linear-gradient(90deg, var(--cyan), var(--orange));
}

/* 上层刊物页眉 */
.header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-height: 56px;
  padding-block: 11px;
  overflow: hidden;
  border-bottom: 1px solid rgba(244, 237, 225, 0.1);
  transition:
    max-height 0.42s var(--ease),
    padding 0.42s var(--ease),
    opacity 0.28s var(--ease),
    border-color 0.3s var(--ease);
}

.site-header[data-scrolled="true"] .header-meta {
  max-height: 0;
  padding-block: 0;
  opacity: 0;
  border-color: transparent;
}

.meta-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(244, 237, 225, 0.58);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 9px;
  border: 1px solid rgba(0, 229, 255, 0.38);
  border-radius: var(--radius-pill);
  background-color: rgba(0, 229, 255, 0.1);
  color: var(--cyan-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--cyan);
  animation: pulseDot 2.6s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.55); opacity: 1; }
  70% { box-shadow: 0 0 0 6px rgba(0, 229, 255, 0); opacity: 0.68; }
}

.util-link {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(244, 237, 225, 0.3);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.util-link:hover {
  border-color: var(--orange);
  background-color: var(--orange);
  color: var(--ink-deep);
}

/* 主行 */
.header-main {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 66px;
  padding-block: 12px;
  transition: min-height 0.42s var(--ease), padding 0.42s var(--ease);
}

.site-header[data-scrolled="true"] .header-main {
  min-height: 56px;
  padding-block: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-glyph {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background-image: linear-gradient(150deg, var(--cyan), #00A9C4);
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  line-height: 1;
  transition: border-radius 0.3s var(--ease);
}

.brand:hover .brand-glyph { border-radius: 50%; }

.brand-lockup {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-cn {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.04em;
  color: var(--paper);
}

.brand-en {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--cyan);
}

/* 移动菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 9px 16px;
  border: 1px solid rgba(0, 229, 255, 0.36);
  border-radius: var(--radius-pill);
  background-color: rgba(0, 229, 255, 0.08);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-toggle:hover { background-color: rgba(0, 229, 255, 0.18); }

.nav-toggle-mark {
  display: grid;
  gap: 5px;
  width: 14px;
}

.nav-toggle-bar {
  display: block;
  height: 1.5px;
  background-color: currentColor;
  transition: transform 0.3s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(3.25px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  transform: translateY(-3.25px) rotate(-45deg);
}

.nav-toggle-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
}

/* 导航 */
.site-nav { margin-left: auto; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-item { display: block; }

.nav-link {
  display: block;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: rgba(244, 237, 225, 0.78);
  white-space: nowrap;
  transition:
    color 0.2s var(--ease),
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.nav-link:hover {
  color: var(--cyan-soft);
  background-color: rgba(0, 229, 255, 0.1);
}

.nav-link[aria-current="page"] {
  color: var(--ink-deep);
  background-color: var(--cyan);
  border-color: var(--cyan);
  font-weight: 600;
}

/* ---------- 5. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 7vw, 96px);
  padding-block: clamp(40px, 6vw, 76px) 0;
  background-color: var(--ink);
  color: var(--paper);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background-image: linear-gradient(90deg, var(--cyan), var(--orange) 58%, rgba(255, 107, 53, 0));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr 0.8fr;
  gap: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(32px, 4vw, 52px);
}

.footer-brand { min-width: 0; }

.footer-lock {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--paper);
}

.footer-lock span {
  display: block;
  margin-top: 7px;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--cyan);
}

.footer-note {
  margin-top: 16px;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(244, 237, 225, 0.66);
}

.footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.footer-tag {
  padding: 5px 11px;
  border: 1px solid rgba(244, 237, 225, 0.2);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(244, 237, 225, 0.72);
}

.footer-col { min-width: 0; }

.footer-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--cyan);
}

.footer-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: rgba(0, 229, 255, 0.28);
}

.footer-list {
  display: grid;
  gap: 12px;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(244, 237, 225, 0.76);
}

.footer-item {
  display: grid;
  gap: 3px;
  overflow-wrap: anywhere;
}

.footer-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(244, 237, 225, 0.44);
}

.footer-item-note {
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(244, 237, 225, 0.5);
}

.footer-list-links { gap: 10px; }

.footer-link {
  text-decoration: underline;
  text-decoration-color: rgba(0, 229, 255, 0.3);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

.footer-link:hover {
  color: var(--cyan-soft);
  text-decoration-color: var(--cyan);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 18px 24px;
  border-top: 1px solid rgba(244, 237, 225, 0.12);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(244, 237, 225, 0.5);
}

/* ---------- 6. 通用组件 ---------- */
.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--mist);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  transition:
    transform 0.22s var(--ease),
    background-color 0.22s var(--ease),
    border-color 0.22s var(--ease),
    color 0.22s var(--ease);
}

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

.btn-primary {
  background-color: var(--orange);
  border-color: var(--orange);
  color: var(--ink-deep);
}

.btn-primary:hover {
  background-color: var(--amber);
  border-color: var(--amber);
}

.btn-ghost {
  border-color: rgba(11, 37, 69, 0.28);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.section--ink .btn-ghost,
.section--deep .btn-ghost {
  border-color: rgba(244, 237, 225, 0.36);
  color: var(--paper);
}

.section--ink .btn-ghost:hover,
.section--deep .btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  padding: 8px 17px;
  border: 1px solid var(--hairline-light);
  border-radius: var(--radius-pill);
  background-color: var(--paper-bright);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.pill:hover {
  transform: translateY(-2px);
  border-color: var(--orange);
  color: var(--orange);
}

.pill[aria-pressed="true"] {
  background-color: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.plate {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(20px, 2.4vw, 30px);
  border: 1px solid var(--hairline-light);
  border-radius: var(--radius-lg);
  background-color: var(--paper-bright);
  transition:
    transform 0.28s var(--ease),
    border-color 0.28s var(--ease),
    box-shadow 0.28s var(--ease);
}

.plate:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 107, 53, 0.55);
  box-shadow: 0 22px 42px -30px rgba(11, 37, 69, 0.7);
}

.plate-no {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--orange);
}

.section--ink .plate,
.section--deep .plate {
  background-color: rgba(251, 248, 242, 0.06);
  border-color: rgba(244, 237, 225, 0.16);
  color: var(--paper);
}

.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: var(--ink);
  aspect-ratio: 16 / 10;
}

.media-frame--square { aspect-ratio: 1 / 1; }

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--mist);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55em;
}

.breadcrumb li { display: inline-flex; align-items: center; gap: 0.55em; }

.breadcrumb li + li::before {
  content: "/";
  color: rgba(122, 138, 153, 0.6);
}

.breadcrumb a { transition: color 0.2s var(--ease); }

.breadcrumb a:hover { color: var(--orange); }

.prose {
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.8;
  color: var(--graphite);
}

.prose > * + * { margin-top: 1.1em; }

.prose h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  color: var(--ink);
}

.prose h3 {
  font-size: clamp(19px, 2vw, 23px);
  color: var(--ink);
}

.prose ul,
.prose ol {
  padding-left: 1.2em;
  list-style: disc;
}

.prose ol { list-style: decimal; }

.prose li + li { margin-top: 0.45em; }

.prose a {
  text-decoration: underline;
  text-decoration-color: rgba(255, 107, 53, 0.5);
  text-underline-offset: 4px;
}

.prose a:hover { color: var(--orange); }

.section--ink .prose,
.section--deep .prose { color: rgba(244, 237, 225, 0.84); }

.section--ink .prose h2,
.section--ink .prose h3,
.section--deep .prose h2,
.section--deep .prose h3 { color: var(--paper); }

/* 展开组 */
.disclosure {
  overflow: hidden;
  border: 1px solid var(--hairline-light);
  border-radius: var(--radius-md);
  background-color: var(--paper-bright);
}

.disclosure + .disclosure { margin-top: 10px; }

.disclosure-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 22px;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  transition: color 0.2s var(--ease);
}

.disclosure-trigger:hover { color: var(--orange); }

.disclosure-trigger::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1;
  color: var(--orange);
  transition: transform 0.32s var(--ease);
}

.disclosure-trigger[aria-expanded="true"]::after { transform: rotate(45deg); }

.disclosure-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.42s var(--ease),
    opacity 0.3s var(--ease);
}

.disclosure-trigger[aria-expanded="true"] + .disclosure-panel {
  max-height: 720px;
  opacity: 1;
}

.disclosure-body {
  padding: 0 22px 20px;
  font-size: 15px;
  line-height: 1.78;
  color: var(--graphite);
}

/* ---------- 7. 网格与分区 ---------- */
.section { padding-block: clamp(48px, 7vw, 96px); }

.section--ink {
  background-color: var(--ink);
  color: var(--paper);
}

.section--deep {
  background-color: var(--ink-deep);
  color: var(--paper);
}

.section--paper {
  background-color: var(--paper-bright);
  color: var(--ink);
}

.section-head {
  display: grid;
  gap: 12px;
  max-width: 72ch;
  margin-bottom: clamp(24px, 3.2vw, 44px);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--orange);
}

.section--ink .section-eyebrow,
.section--deep .section-eyebrow { color: var(--cyan); }

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: inherit;
}

.section-note {
  max-width: 62ch;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.75;
  color: var(--graphite);
}

.section--ink .section-note,
.section--deep .section-note { color: rgba(244, 237, 225, 0.78); }

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

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }

/* ---------- 8. 响应式 ---------- */
@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-left: 0;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    background-color: var(--ink-deep);
    border-top: 1px solid rgba(0, 229, 255, 0.22);
    border-bottom: 1px solid rgba(0, 229, 255, 0.22);
    transition:
      max-height 0.44s var(--ease),
      opacity 0.28s var(--ease),
      visibility 0.44s var(--ease);
  }

  .site-nav[data-open="true"] {
    max-height: min(72vh, 540px);
    overflow-y: auto;
    visibility: visible;
    opacity: 1;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px var(--gutter) 22px;
  }

  .nav-link {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    letter-spacing: 0.08em;
    color: rgba(244, 237, 225, 0.88);
  }

  .nav-item + .nav-item .nav-link {
    border-top: 1px solid rgba(244, 237, 225, 0.08);
  }

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

  .footer-col-contact { grid-column: span 2; }
}

@media (max-width: 900px) {
  .col-3,
  .col-4 { grid-column: span 6; }

  .col-5,
  .col-6,
  .col-7,
  .col-8,
  .col-9 { grid-column: span 12; }
}

@media (max-width: 640px) {
  .header-main { gap: 14px; }

  .brand-glyph { width: 34px; height: 34px; border-radius: 12px; font-size: 17px; }

  .brand-cn { font-size: 15px; }

  .brand-en { font-size: 9px; letter-spacing: 0.28em; }

  .meta-note { display: none; }

  .header-meta { justify-content: flex-end; }

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

  .footer-col-contact { grid-column: auto; }

  .footer-base { flex-direction: column; align-items: flex-start; }

  .btn { width: 100%; }

  [class*="col-"] { grid-column: span 12; }
}

/* ---------- 9. 无障碍 ---------- */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

.site-header :focus-visible { outline-color: var(--cyan); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .btn:hover,
  .plate:hover,
  .pill:hover { transform: none; }
}
