/* ============================================================
   易胜博平台 · 共享站点样式 /assets/site.css
   结构：reset → 变量 → 基础排版 → 头部 → 页脚 → 通用组件
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 112px;
}

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

ul, ol { list-style: none; }

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

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

a { color: inherit; }

:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- 设计变量 ---------- */
:root {
  --c-bg: #F6EFE2;
  --c-surface: #FFFDF8;
  --c-ink: #17211D;
  --c-ink-soft: #4E6B5C;
  --c-head: #143C32;
  --c-accent: #D9622B;
  --c-hot: #F0A13A;
  --c-line: #B4864C;
  --c-line-soft: rgba(180, 134, 76, 0.4);
  --c-soft: #F9E1D2;
  --c-warn: #A63D2F;
  --c-ondark: #FFF6E5;

  --fs-body: 18px;
  --fs-small: 16px;

  --font-sans: "HarmonyOS Sans SC", "Noto Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Menlo", "Consolas", monospace;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 18px;
  --radius-sm: 10px;
  --shadow-paper: 0 1px 0 rgba(23, 33, 29, 0.05), 0 16px 30px -24px rgba(20, 60, 50, 0.55);
  --dur: 220ms;
}

/* 长辈模式：整页色板反转 + 字号放大 */
html[data-elder="on"] {
  --c-bg: #0E2A23;
  --c-surface: #15463A;
  --c-ink: #FFF6E5;
  --c-ink-soft: #E2D1B0;
  --c-head: #08211B;
  --c-accent: #F0A13A;
  --c-hot: #F7B65C;
  --c-line: rgba(240, 161, 58, 0.55);
  --c-line-soft: rgba(240, 161, 58, 0.28);
  --c-soft: #1D4B3D;
  --c-warn: #F08070;
  --fs-body: 22px;
  --fs-small: 19px;
  --shadow-paper: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 30px -22px rgba(0, 0, 0, 0.8);
}

/* ---------- 基础排版 ---------- */
body {
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.8;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p { max-width: 68ch; }

a { text-decoration-thickness: 1px; }

/* ---------- 骨架容器 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 300;
  padding: 12px 20px;
  background: var(--c-head);
  color: var(--c-ondark);
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 12px 0;
  transform: translateY(-180%);
  transition: transform var(--dur) ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid var(--c-hot);
  outline-offset: 2px;
}

/* ---------- 头部：双层命令栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--c-surface);
  box-shadow: 0 1px 0 var(--c-line-soft), 0 20px 32px -32px rgba(0, 0, 0, 0.85);
  transition: background-color var(--dur) ease;
}

/* 深墨绿信封条 */
.cmd-strip {
  background: var(--c-head);
  color: var(--c-ondark);
}

.cmd-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 6px var(--gutter);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.08em;
}

.cmd-strip-line { font-weight: 600; }

.cmd-strip-meta {
  color: rgba(255, 246, 229, 0.72);
  white-space: nowrap;
}

/* 米白命令栏 */
.cmd-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 24px);
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 10px var(--gutter);
}

.cmd-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
}

.cmd-brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--c-accent);
  color: #FFF6E5;
  font-size: 18px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255, 246, 229, 0.35);
  transition: background-color var(--dur) ease;
}

.cmd-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.cmd-brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--c-ink);
}

.cmd-brand-sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--c-ink-soft);
}

/* 主导航 */
.cmd-nav {
  flex: 1 1 auto;
  min-width: 0;
}

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

.cmd-nav-item { display: block; }

.cmd-nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--c-ink);
  text-decoration: none;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}

.cmd-idx {
  font-family: var(--font-mono);
  font-size: 0.66em;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--c-accent);
  transition: color var(--dur) ease;
}

.cmd-nav-link:hover { background: var(--c-soft); }

.cmd-nav-link[aria-current="page"] {
  background: var(--c-hot);
  color: #10251F;
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--c-accent);
}

.cmd-nav-link[aria-current="page"] .cmd-idx { color: #10251F; }

/* 右侧动作 */
.cmd-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}

.elder-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1.5px solid var(--c-line-soft);
  border-radius: 999px;
  background: transparent;
  color: var(--c-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  transition: background-color var(--dur) ease, color var(--dur) ease,
    border-color var(--dur) ease;
}

.elder-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--c-line);
  box-shadow: 0 0 0 3px rgba(180, 134, 76, 0.18);
  transition: background-color var(--dur) ease, box-shadow var(--dur) ease;
}

.elder-toggle:hover { background: var(--c-soft); }

.elder-toggle[aria-pressed="true"] {
  background: var(--c-hot);
  border-color: transparent;
  color: #10251F;
}

.elder-toggle[aria-pressed="true"] .elder-dot {
  background: #10251F;
  box-shadow: 0 0 0 3px rgba(16, 37, 31, 0.22);
}

/* 移动导航按钮 */
.cmd-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1.5px solid var(--c-ink);
  border-radius: 999px;
  background: var(--c-surface);
  color: var(--c-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.cmd-toggle-bars {
  display: grid;
  gap: 3px;
  width: 16px;
}

.cmd-toggle-bars i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

/* 阅读进度 */
.cmd-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  pointer-events: none;
  background: transparent;
}

.cmd-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--c-accent), var(--c-hot));
  transition: transform 80ms linear;
}

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 8vw, 96px);
  background: var(--c-head);
  color: #F3E9D8;
  transition: background-color var(--dur) ease;
}

.site-footer::before {
  content: "";
  display: block;
  height: 10px;
  background: repeating-linear-gradient(
    90deg,
    var(--c-hot) 0 2px,
    transparent 2px 14px
  );
  opacity: 0.5;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 0.9fr 1.35fr;
  gap: clamp(24px, 4vw, 48px);
  padding-block: clamp(34px, 6vw, 64px);
}

.footer-brand { max-width: 24em; }

.footer-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #D9622B;
  color: #FFFDF8;
  font-size: 20px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 248, 0.34);
}

.footer-name {
  margin-top: 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #FFF6E5;
}

.footer-note {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.8;
  color: rgba(243, 233, 216, 0.78);
}

.footer-col-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--c-hot);
}

.footer-list {
  display: grid;
  gap: 9px;
  font-size: 16px;
  line-height: 1.7;
}

.footer-list a {
  display: inline-block;
  padding-block: 2px;
  color: #EDE3D2;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) ease, border-color var(--dur) ease;
}

.footer-list a:hover {
  color: var(--c-hot);
  border-bottom-color: var(--c-hot);
}

.footer-list-plain li {
  color: rgba(243, 233, 216, 0.86);
  font-family: var(--font-mono);
  font-size: 14.5px;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.footer-tip {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.75;
  color: rgba(243, 233, 216, 0.66);
}

.footer-base {
  border-top: 1px solid rgba(243, 233, 216, 0.18);
}

.footer-base-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 18px;
  font-size: 14px;
  color: rgba(243, 233, 216, 0.72);
}

.footer-copy { max-width: none; }

.footer-base-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  max-width: none;
}

.footer-base-links a {
  text-decoration: none;
  border-bottom: 1px solid rgba(243, 233, 216, 0.3);
  transition: color var(--dur) ease, border-color var(--dur) ease;
}

.footer-base-links a:hover {
  color: var(--c-hot);
  border-bottom-color: var(--c-hot);
}

.footer-icp {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  max-width: none;
}

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 12px 22px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background-color var(--dur) ease,
    color var(--dur) ease, border-color var(--dur) ease;
}

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

.btn-amber {
  background: var(--c-hot);
  color: #10251F;
  border-color: rgba(16, 37, 31, 0.18);
}

.btn-pine {
  background: #143C32;
  color: #FFF6E5;
}

.btn-ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-line);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 14.5px;
}

/* ---------- 面包屑 ---------- */
.breadcrumb { margin-block: clamp(18px, 3vw, 30px) 0; }

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  color: var(--c-ink-soft);
}

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

.breadcrumb li + li::before {
  content: "›";
  color: var(--c-line);
}

.breadcrumb a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.breadcrumb a:hover { border-bottom-color: var(--c-line); }

.breadcrumb [aria-current="page"] {
  color: var(--c-ink);
  font-weight: 600;
}

/* ---------- 章节与标题 ---------- */
.section { padding-block: clamp(28px, 5vw, 64px); }

.section-band {
  background: var(--c-soft);
  padding-block: clamp(24px, 4.5vw, 56px);
  transition: background-color var(--dur) ease;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--c-accent);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
}

.index-no {
  font-family: var(--font-mono);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--c-accent);
}

.display-title {
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.text-soft {
  color: var(--c-ink-soft);
  font-size: var(--fs-small);
}

/* ---------- 卡片与档案组件 ---------- */
.card {
  position: relative;
  padding: clamp(18px, 2.6vw, 28px);
  background: var(--c-surface);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-paper);
  transition: background-color var(--dur) ease, border-color var(--dur) ease,
    box-shadow var(--dur) ease;
}

.card-title {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
}

.card-tools {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--c-line-soft);
  border-radius: 999px;
  background: var(--c-soft);
  color: var(--c-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

.step-badge {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #D9622B;
  color: #FFF6E5;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 0 0 4px rgba(217, 98, 43, 0.16);
}

/* 印刷框景 */
.frame-box {
  position: relative;
  padding: clamp(20px, 3vw, 36px);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 22px;
}

.frame-box::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--c-line-soft);
  border-radius: 16px;
  pointer-events: none;
}

/* ---------- 栅格 ---------- */
.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 28px);
}

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

/* ---------- 图片容器（页面阶段放真实场景照片） ---------- */
.img-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--c-line-soft);
  border-radius: var(--radius);
  background: var(--c-soft);
}

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

.img-frame--wide { aspect-ratio: 16 / 9; }
.img-frame--portrait { aspect-ratio: 4 / 5; }
.img-frame--square { aspect-ratio: 1 / 1; }
.img-frame--tall { aspect-ratio: 3 / 4; }

/* ---------- 显现动效 ---------- */
[data-reveal] {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

html[data-animate="on"] [data-reveal]:not(.is-in) {
  opacity: 0;
  transform: translateY(16px);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .cmd-toggle { display: inline-flex; margin-left: auto; }

  .cmd-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    z-index: 70;
    display: none;
    padding: 10px var(--gutter) 18px;
    background: var(--c-head);
    border-bottom: 3px solid var(--c-hot);
    box-shadow: 0 22px 34px -26px rgba(0, 0, 0, 0.7);
  }

  .cmd-nav[data-open] {
    display: block;
    animation: navDrop 0.22s ease-out;
  }

  .cmd-nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .cmd-nav-link {
    width: 100%;
    padding: 12px 12px;
    font-size: 16px;
    color: #FFF6E5;
    border-radius: var(--radius-sm);
  }

  .cmd-nav-link .cmd-idx { color: var(--c-hot); }

  .cmd-nav-link:hover { background: rgba(255, 246, 229, 0.1); }

  .cmd-nav-link[aria-current="page"] {
    background: var(--c-hot);
    color: #10251F;
    box-shadow: inset 4px 0 0 var(--c-accent);
  }

  .cmd-nav-link[aria-current="page"] .cmd-idx { color: #10251F; }

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

@keyframes navDrop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .cmd-strip-meta { display: none; }
  .cmd-brand-sub { display: none; }
  .footer-base-inner { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3 { grid-template-columns: minmax(0, 1fr); }

  .img-frame--portrait,
  .img-frame--tall { aspect-ratio: 4 / 3; }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-block: 32px;
  }

  .display-title { font-size: clamp(32px, 9vw, 46px); }
  .card-title { font-size: 20px; }
}

@media (max-width: 480px) {
  .cmd-toggle-text { display: none; }
  .cmd-toggle { padding: 9px 12px; }
  .cmd-brand-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
  .cmd-brand-name { font-size: 14.5px; }
  .elder-toggle { padding: 7px 10px; font-size: 13px; }
  .btn-sm { padding: 8px 12px; font-size: 13.5px; }
  .footer-list { font-size: 15.5px; }
}

@media (max-width: 420px) {
  .cmd-bar { flex-wrap: wrap; row-gap: 8px; }
  .cmd-brand { order: 1; }
  .cmd-toggle { order: 2; }
  .cmd-actions {
    order: 3;
    flex: 1 0 100%;
    margin-left: 0;
    justify-content: space-between;
  }
}

/* ---------- 减少动态 ---------- */
@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;
  }

  html[data-animate="on"] [data-reveal]:not(.is-in) {
    opacity: 1;
    transform: none;
  }

  .cmd-progress-bar { transition: none; }
}
