/* ============================================================
   万博MAX · /assets/site.css
   共享外壳：悬浮胶囊导航 + 深夜书桌页脚
   ============================================================ */

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

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd { margin: 0; }

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

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

button, input, select, textarea { font: inherit; color: inherit; }

button { background: none; border: 0; cursor: pointer; }

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

/* ---------- 2. Tokens ---------- */
:root {
  --ink-950: #0B1220;
  --ink-900: #101B2E;
  --ink-800: #16243D;
  --slate-600: #3A4A63;
  --slate-300: #A9B4C4;
  --paper-100: #F4EFE6;
  --amber-500: #E8A33D;
  --amber-200: #F6D9A8;
  --coral-500: #F26B4E;
  --teal-400: #2EC4B6;

  --ink-deep: #1B2740;
  --ink-muted: #5C6B85;
  --amber-deep: #96590F;

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

  --shell-max: 1240px;
  --gutter: clamp(16px, 4vw, 48px);

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

  --hairline: rgba(169, 180, 196, .18);
  --hairline-strong: rgba(169, 180, 196, .32);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow-float: 0 14px 34px rgba(0, 0, 0, .34);
}

/* ---------- 3. Base / 中文排版 ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink-950);
  background-image:
    radial-gradient(1100px 620px at 84% -8%, rgba(232, 163, 61, .14), transparent 62%),
    radial-gradient(820px 540px at 2% 104%, rgba(242, 107, 78, .10), transparent 66%),
    radial-gradient(rgba(244, 239, 230, .05) 1px, transparent 1.4px);
  background-size: auto, auto, 6px 6px;
  color: var(--paper-100);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: .01em;
  word-break: break-word;
}

p, li { word-break: break-word; }

a, button { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--amber-500);
  outline-offset: 3px;
  border-radius: 6px;
}

#main-content { scroll-margin-top: 110px; }

/* ---------- 4. 通用布局 ---------- */
.container {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(38px, 6.5vw, 84px); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 30px;
  margin-bottom: clamp(20px, 3vw, 34px);
}

.grid {
  display: grid;
  gap: clamp(16px, 2vw, 26px);
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(20px, 3.4vw, 48px);
  align-items: start;
}

/* ---------- 5. 排版器件 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber-500);
  line-height: 1.4;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: .85;
  flex: none;
}

.display-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1.14;
  letter-spacing: .005em;
  color: var(--paper-100);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.32;
  color: var(--paper-100);
}

.lede {
  max-width: 56ch;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.82;
  color: var(--slate-300);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 14px;
  border: 1px solid rgba(232, 163, 61, .55);
  border-radius: 10px;
  background: rgba(232, 163, 61, .10);
  color: var(--amber-200);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  line-height: 1.35;
  text-align: center;
}

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  transition: transform .18s var(--ease), background-color .18s var(--ease),
              color .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.btn-primary {
  background: var(--coral-500);
  color: var(--ink-950);
  box-shadow: 0 12px 26px rgba(242, 107, 78, .26);
}

.btn-primary:hover { background: #FF8266; transform: translateY(-1px); }

.btn-ghost {
  background: rgba(22, 36, 61, .6);
  border-color: var(--hairline-strong);
  color: var(--paper-100);
}

.btn-ghost:hover {
  border-color: var(--amber-500);
  color: var(--amber-200);
  transform: translateY(-1px);
}

/* ---------- 7. 卡片与图片容器 ---------- */
.card {
  background: rgba(22, 36, 61, .72);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 2.4vw, 28px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .22);
}

.paper-card {
  background: var(--paper-100);
  color: var(--ink-deep);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 2.6vw, 30px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, .3);
}

.paper-card h2,
.paper-card h3,
.paper-card p,
.paper-card li { color: var(--ink-deep); }

.paper-card .mono { color: var(--ink-muted); }

.media-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline);
  background:
    linear-gradient(150deg, rgba(58, 74, 99, .6), rgba(16, 27, 46, .94)),
    radial-gradient(280px 180px at 78% 14%, rgba(232, 163, 61, .22), transparent 70%);
}

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

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

/* ---------- 8. 面包屑 ---------- */
.breadcrumb { margin-bottom: clamp(14px, 2vw, 22px); }

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .05em;
  color: var(--slate-300);
}

.breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-list li + li::before {
  content: "/";
  color: var(--slate-600);
}

.breadcrumb-list a { color: var(--slate-300); }
.breadcrumb-list a:hover { color: var(--amber-200); }

/* ---------- 9. 动效器件 ---------- */
.reveal { transition: opacity .5s var(--ease), transform .5s var(--ease); }

.js-enabled .reveal {
  opacity: 0;
  transform: translateY(14px);
}

.js-enabled .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%,
    var(--glow-color, rgba(232, 163, 61, .34)),
    rgba(232, 163, 61, 0) 68%);
  filter: blur(4px);
  animation: lamp-breathe 9s var(--ease) infinite;
  z-index: 0;
}

@keyframes lamp-breathe {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: .85; transform: scale(1.06); }
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--amber-500), var(--coral-500));
  z-index: 200;
  pointer-events: none;
  transition: transform .08s linear;
}

/* ---------- 10. 头部：悬浮胶囊浮岛 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: 12px var(--gutter) 10px;
  background: linear-gradient(180deg,
    rgba(11, 18, 32, .95) 0%,
    rgba(11, 18, 32, .82) 58%,
    rgba(11, 18, 32, 0) 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.skip-link {
  position: fixed;
  top: -90px;
  left: 16px;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  background: var(--paper-100);
  color: var(--ink-950);
  font-weight: 700;
  font-size: 15px;
  transition: top .2s var(--ease);
}

.skip-link:focus {
  top: 0;
  outline-offset: -4px;
}

.header-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
}

/* 品牌浮岛 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 18px 6px 7px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: rgba(22, 36, 61, .88);
  box-shadow: var(--shadow-float);
  justify-self: start;
  transition: border-color .18s var(--ease);
}

.brand:hover { border-color: rgba(232, 163, 61, .5); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(120deg, var(--amber-200), var(--amber-500));
  color: var(--ink-950);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.3;
  white-space: nowrap;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--slate-300);
  white-space: nowrap;
}

/* 导航浮岛 */
.site-nav {
  display: flex;
  align-items: center;
  justify-self: center;
  padding: 5px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: rgba(16, 27, 46, .84);
  box-shadow: var(--shadow-float);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

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

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 15px;
  border-radius: var(--radius-pill);
  color: var(--slate-300);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .18s var(--ease), background-color .18s var(--ease);
}

.nav-link:hover {
  color: var(--paper-100);
  background: rgba(58, 74, 99, .55);
}

.nav-link[aria-current="page"] {
  color: var(--ink-950);
  font-weight: 700;
  background: linear-gradient(120deg, var(--amber-200), var(--amber-500));
  box-shadow: inset 0 0 0 1px rgba(11, 18, 32, .16);
}

/* 右侧行动区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.version-badge {
  padding: 7px 12px;
  border: 1px dashed rgba(232, 163, 61, .55);
  border-radius: var(--radius-pill);
  background: rgba(232, 163, 61, .08);
  color: var(--amber-200);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  line-height: 1.4;
  white-space: nowrap;
}

.saved-entry {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--coral-500);
  color: var(--ink-950);
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(242, 107, 78, .26);
  transition: transform .18s var(--ease), background-color .18s var(--ease);
}

.saved-entry:hover {
  background: #FF8266;
  transform: translateY(-1px);
}

.saved-entry-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-950);
  box-shadow: 0 0 0 3px rgba(11, 18, 32, .16);
  flex: none;
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-pill);
  background: rgba(22, 36, 61, .88);
  color: var(--paper-100);
  box-shadow: var(--shadow-float);
  transition: border-color .18s var(--ease), color .18s var(--ease);
}

.nav-toggle:hover {
  border-color: var(--amber-500);
  color: var(--amber-200);
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}

.nav-toggle-bars { position: relative; }

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- 11. 页脚：深夜书桌与纸面卡 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(44px, 8vw, 100px);
  padding: clamp(34px, 5vw, 58px) 0 26px;
  overflow: hidden;
  border-top: 1px solid rgba(232, 163, 61, .26);
  background:
    radial-gradient(720px 340px at 88% 0%, rgba(232, 163, 61, .13), transparent 70%),
    radial-gradient(560px 300px at 6% 100%, rgba(46, 196, 182, .07), transparent 72%),
    linear-gradient(180deg, var(--ink-900) 0%, var(--ink-950) 100%);
  color: var(--paper-100);
}

.footer-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.footer-mark {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--amber-200);
  line-height: 1.3;
  border-bottom: 2px solid rgba(232, 163, 61, .5);
  padding-bottom: 4px;
}

.footer-tag {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  color: var(--amber-500);
}

.footer-note {
  margin-top: 12px;
  max-width: 42ch;
  font-size: 14.5px;
  line-height: 1.85;
  color: rgba(244, 239, 230, .74);
}

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

.footer-heading {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber-500);
  line-height: 1.4;
}

.footer-links li + li { margin-top: 6px; }

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  font-size: 15px;
  color: rgba(244, 239, 230, .8);
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}

.footer-links a:hover {
  color: var(--amber-200);
  border-bottom-color: rgba(232, 163, 61, .6);
}

/* 纸面联系卡：向右错位 */
.footer-contact {
  max-width: 780px;
  margin: clamp(26px, 4vw, 44px) 0 0 auto;
  padding: clamp(18px, 2.6vw, 30px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(320px 180px at 92% -10%, rgba(232, 163, 61, .22), transparent 70%),
    var(--paper-100);
  color: var(--ink-deep);
  box-shadow: 0 26px 54px rgba(0, 0, 0, .38);
}

.footer-contact .footer-heading { color: var(--amber-deep); }

.contact-list { border-top: 1px dashed rgba(27, 39, 64, .22); }

.contact-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 11px 0;
  border-bottom: 1px dashed rgba(27, 39, 64, .22);
}

.contact-label {
  min-width: 72px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--ink-muted);
  flex: none;
}

.contact-value {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-deep);
  word-break: break-word;
}

.copy-btn {
  margin-left: auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(27, 39, 64, .3);
  border-radius: var(--radius-pill);
  background: rgba(232, 163, 61, .18);
  color: var(--ink-deep);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  transition: background-color .18s var(--ease), border-color .18s var(--ease);
}

.copy-btn:hover {
  background: rgba(232, 163, 61, .38);
  border-color: rgba(27, 39, 64, .5);
}

.contact-note {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-muted);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 26px;
  margin-top: clamp(22px, 3vw, 34px);
  padding-top: 18px;
  border-top: 1px solid rgba(169, 180, 196, .18);
  font-size: 13px;
  color: rgba(244, 239, 230, .62);
}

.footer-copyright { margin: 0; }

.footer-year {
  font-variant-numeric: tabular-nums;
  color: rgba(244, 239, 230, .8);
}

.footer-icp {
  margin: 0;
  letter-spacing: .04em;
  color: rgba(244, 239, 230, .55);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-legal a {
  color: rgba(244, 239, 230, .66);
  transition: color .18s var(--ease);
}

.footer-legal a:hover { color: var(--amber-200); }

/* ---------- 12. 响应式 ---------- */
@media (max-width: 1100px) {
  .brand-tag { display: none; }
  .version-badge { display: none; }
  .nav-link { padding: 0 12px; font-size: 14px; }
}

@media (max-width: 900px) {
  .site-header { padding: 10px var(--gutter) 6px; }

  .header-shell {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px 10px;
  }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    margin-top: 4px;
    padding: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar { display: none; }

  .site-nav[data-open="true"] { display: flex; }

  .nav-list { gap: 4px; }

  .nav-link { min-height: 44px; font-size: 14px; }

  .grid-2,
  .grid-3,
  .split { grid-template-columns: minmax(0, 1fr); }

  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-contact { margin-left: 0; max-width: none; }
}

@media (max-width: 620px) {
  body { font-size: 16px; line-height: 1.72; }

  .brand { min-height: 48px; padding: 5px 14px 5px 6px; }
  .brand-mark { font-size: 15.5px; padding: 4px 10px; }

  .saved-entry { padding: 0 14px; font-size: 13.5px; }
  .saved-entry-dot { display: none; }

  .footer-columns { grid-template-columns: minmax(0, 1fr); gap: 18px; }

  .contact-line { align-items: flex-start; }
  .contact-label { min-width: 100%; }

  .copy-btn {
    margin-left: 0;
    min-height: 44px;
    padding: 0 18px;
    font-size: 13px;
  }

  .footer-base { justify-content: flex-start; }
}

@media (max-width: 400px) {
  .saved-entry { padding: 0 12px; font-size: 13px; }
}

/* ---------- 13. 减少动态偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .glow { animation: none; opacity: .7; }

  .js-enabled .reveal,
  .js-enabled .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  .scroll-progress { transition: none; }
}
