/* ============================================================
   如意CN中国站 · 共享外壳样式 /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, p, figure, blockquote, ol, ul, dl, dd {
  margin: 0;
  padding: 0;
}

ul, ol { list-style: none; }

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

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

a { color: inherit; }

table { border-collapse: collapse; }

/* ---------- 2. Variables ---------- */
:root {
  --red: #C8102E;
  --red-deep: #8E1028;
  --gold: #D9A441;
  --gold-light: #F2D28B;
  --ink: #151515;
  --paper: #F7F1E6;
  --grey: #D8D0C2;
  --celadon: #2E6B5E;
  --white: #FFFFFF;

  --muted: #8A8175;
  --muted-ink: #6B6357;

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

  --rail: 244px;
  --topbar: 64px;
  --gutter: clamp(1.15rem, 4vw, 3.6rem);
  --shell-max: 1180px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 3. Base & 中文排版 ---------- */
body {
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, rgba(21, 21, 21, .03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(21, 21, 21, .03) 1px, transparent 1px);
  background-size: 72px 72px;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(15px, .35vw + 14px, 17px);
  line-height: 1.7;
  letter-spacing: .012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }

p { text-wrap: pretty; }

strong, b { font-weight: 700; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

::selection {
  background: var(--red);
  color: var(--white);
}

/* ---------- 4. 骨架 ---------- */
#main-content:focus,
#main-content:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 6px;
}

.page-body {
  display: block;
  min-height: 60vh;
  padding-block: clamp(1.6rem, 4vw, 3rem) 0;
}

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

.rule-slant {
  height: 1px;
  border: 0;
  margin: clamp(1.6rem, 4vw, 2.6rem) 0;
  background: linear-gradient(90deg, var(--red) 0 18%, var(--gold) 18% 30%, var(--grey) 30% 100%);
}

/* ---------- 5. 通用文字组件 ---------- */
.annotation {
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .18em;
  color: var(--muted);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .12rem .45rem;
  border: 1px solid var(--gold);
  background: rgba(242, 210, 139, .38);
  color: var(--red-deep);
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .1em;
  line-height: 1.6;
}

.prose {
  max-width: 62ch;
}

.prose p { margin-bottom: 1.05em; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 { margin: 1.9em 0 .55em; }
.prose h3 { margin: 1.5em 0 .45em; }
.prose ul {
  list-style: none;
  display: grid;
  gap: .45rem;
  margin-bottom: 1.1em;
}
.prose ul li {
  position: relative;
  padding-left: 1.1rem;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: .55rem;
  height: 2px;
  background: var(--gold);
}

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.15rem;
  border: 1px solid transparent;
  background: none;
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}

.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -3px;
}

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

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

.btn--gold {
  background: var(--gold);
  color: var(--ink);
}
.btn--gold:hover { background: var(--gold-light); }

/* ---------- 7. 面包屑 ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--muted-ink);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.breadcrumb li + li::before {
  content: "/";
  color: var(--gold);
}
.breadcrumb a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.breadcrumb a:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}

/* ---------- 8. 切角面与图片容器 ---------- */
.surface-cut {
  background: var(--white);
  border: 1px solid var(--grey);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.figure {
  margin: 0;
  display: grid;
  gap: .6rem;
}
.figure__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--grey);
  background-color: #EFE8DA;
  background-image:
    linear-gradient(135deg, rgba(200, 16, 46, .07) 0 12%, transparent 12% 100%),
    linear-gradient(to right, rgba(21, 21, 21, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(21, 21, 21, .05) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}
.figure__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure__caption {
  padding-left: .6rem;
  border-left: 2px solid var(--gold);
  font-size: .78rem;
  line-height: 1.6;
  color: var(--muted-ink);
  letter-spacing: .03em;
}
.figure--wide .figure__frame { aspect-ratio: 21 / 9; }
.figure--portrait .figure__frame { aspect-ratio: 3 / 4; }

/* ---------- 9. Skip link ---------- */
.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 300;
  padding: .6rem 1rem;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform .18s var(--ease);
}
.skip-link:focus {
  transform: translateY(0);
}

/* ---------- 10. Header 轨道 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--grey);
  box-shadow: 1px 0 0 rgba(21, 21, 21, .04);
}

.rail-brand {
  position: relative;
  flex: 0 0 auto;
  padding: 1.45rem 1.25rem 1.05rem;
  border-bottom: 1px solid var(--grey);
}
.rail-brand::after {
  content: "";
  position: absolute;
  left: 1.25rem;
  bottom: -2px;
  width: 56px;
  height: 3px;
  background: var(--red);
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 100% 68%, 68% 100%, 0 100%);
}
.brand-mark__dot {
  position: absolute;
  inset: 9px;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1.2;
  letter-spacing: .02em;
  color: var(--ink);
}
.brand-tagline {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--red);
}
.brand:hover .brand-name { color: var(--red-deep); }

.nav-toggle { display: none; }
.nav-close { display: none; }
.nav-scrim { display: none; }

.site-nav {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 1.05rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: none;
}

.nav-caption {
  display: flex;
  gap: .35rem;
  padding: 0 1.5rem .35rem;
  font-family: var(--font-mono);
  font-size: .63rem;
  letter-spacing: .2em;
  color: var(--muted);
}

.nav-list {
  display: block;
}

.nav-link {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: .55rem 1.4rem .55rem 1.5rem;
  border-left: 3px solid transparent;
  color: var(--ink);
  font-size: .94rem;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.nav-link:hover {
  background: #EFE7D8;
  color: var(--red-deep);
}
.nav-num {
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .06em;
  color: var(--gold);
}
.nav-text { display: inline-block; }

.nav-link[aria-current="page"] {
  border-left-color: var(--red);
  background: var(--white);
  color: var(--red);
  font-weight: 700;
}
.nav-link[aria-current="page"] .nav-num { color: var(--red); }

.nav-extra {
  margin-top: auto;
  padding: 1rem 0 .6rem;
  display: grid;
  gap: .6rem;
  border-top: 1px solid var(--grey);
}

.announce {
  display: block;
  margin: 0 1.25rem;
  padding: .55rem .7rem;
  border-left: 3px solid var(--red);
  background: var(--gold-light);
  color: var(--ink);
  text-decoration: none;
  transition: background-color .18s var(--ease);
}
.announce:hover { background: #F7DFAE; }
.announce__tag {
  display: block;
  margin-bottom: .15rem;
  font-family: var(--font-mono);
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--red-deep);
}
.announce__text {
  display: block;
  font-size: .77rem;
  line-height: 1.55;
}

.rail-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin: 0 1.25rem;
  padding: .62rem .8rem;
  background: var(--red);
  color: var(--white);
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: background-color .18s var(--ease);
}
.rail-cta:hover { background: var(--red-deep); }
.rail-cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -3px;
}

.rail-footnote {
  margin: 0 1.25rem;
  font-size: .71rem;
  letter-spacing: .08em;
  color: var(--muted);
}

.rail-progress {
  position: absolute;
  top: 0;
  right: -1px;
  width: 3px;
  height: 100%;
  background: rgba(21, 21, 21, .08);
  overflow: hidden;
}
.rail-progress__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--red);
  transform-origin: top center;
  transform: scaleY(var(--p, 0));
  transition: transform .12s linear;
}

@media (min-width: 1024px) {
  body { padding-left: var(--rail); }
}

/* ---------- 11. Footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(2.6rem, 7vw, 5.5rem);
  padding: clamp(2.2rem, 5vw, 3.6rem) 0 1.4rem;
  background: var(--ink);
  color: #E9E2D6;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--red) 0 20%, var(--gold) 20% 32%, #2A2A2A 32% 100%);
}

.footer-top {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1.35fr 1fr .95fr 1.3fr;
  gap: clamp(1.6rem, 4vw, 3rem);
}

.footer-logo {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: .02em;
  color: var(--paper);
  text-decoration: none;
}
.footer-logo::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: .55rem;
  background: var(--red);
}
.footer-logo:hover { color: var(--gold-light); }

.footer-note {
  margin-top: .85rem;
  max-width: 34ch;
  font-size: .84rem;
  line-height: 1.75;
  color: #BDB4A6;
}

.footer-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-top: 1.1rem;
  border: 1px solid rgba(217, 164, 65, .55);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: .95rem;
  letter-spacing: .06em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}

.footer-heading {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .9rem;
  font-family: var(--font-body);
  font-size: .71rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--gold);
}
.footer-heading::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(217, 164, 65, .32);
}

.footer-list {
  display: grid;
  gap: .45rem;
}
.footer-list a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: #E9E2D6;
  font-size: .88rem;
  line-height: 1.6;
  text-decoration: none;
  transition: color .18s var(--ease);
}
.footer-list a::before {
  content: "";
  width: 6px;
  height: 1px;
  background: var(--gold);
  transition: width .18s var(--ease), background-color .18s var(--ease);
}
.footer-list a:hover { color: var(--gold-light); }
.footer-list a:hover::before {
  width: 15px;
  background: var(--red);
}

.contact-list {
  display: grid;
  gap: .7rem;
}
.contact-item {
  display: grid;
  gap: .12rem;
  padding-bottom: .6rem;
  border-bottom: 1px dashed rgba(247, 241, 230, .16);
}
.contact-label {
  font-family: var(--font-mono);
  font-size: .61rem;
  letter-spacing: .16em;
  color: var(--gold);
}
.contact-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  font-size: .87rem;
  line-height: 1.6;
  color: #F1EADF;
}
.contact-text {
  word-break: break-all;
}

.copy-btn {
  padding: .16rem .45rem;
  border: 1px solid rgba(217, 164, 65, .5);
  background: transparent;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .1em;
  line-height: 1.6;
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.copy-btn:hover {
  background: var(--gold);
  color: var(--ink);
}
.copy-btn[data-copied="true"] {
  border-color: var(--celadon);
  background: var(--celadon);
  color: var(--white);
}

.footer-contact .footer-note {
  max-width: 40ch;
  font-size: .78rem;
}

.footer-bottom {
  width: 100%;
  max-width: var(--shell-max);
  margin: clamp(1.8rem, 4vw, 2.8rem) auto 0;
  padding: 1.1rem var(--gutter) 0;
  border-top: 1px solid rgba(247, 241, 230, .14);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.4rem;
  font-size: .76rem;
  color: #A79E90;
}
.footer-copy { margin-right: auto; }
.footer-icp {
  font-family: var(--font-mono);
  letter-spacing: .04em;
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1rem;
}
.footer-legal a {
  color: #D9CFC0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.footer-legal a:hover {
  color: var(--gold-light);
  border-bottom-color: var(--red);
}

/* ---------- 12. 显现协议 ---------- */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.js-reveal [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ---------- 13. 平板 ---------- */
@media (max-width: 1023px) {
  body { padding-left: 0; padding-top: var(--topbar); }

  .site-header {
    top: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: var(--topbar);
    flex-direction: row;
    align-items: center;
    gap: .5rem;
    padding: 0 .85rem 0 1rem;
    background: var(--ink);
    border-right: 0;
    border-bottom: 1px solid #2A2A2A;
    box-shadow: none;
  }

  .rail-brand {
    padding: 0;
    border-bottom: 0;
  }
  .rail-brand::after { display: none; }

  .brand-mark { width: 30px; height: 30px; }
  .brand-mark__dot { inset: 7px; }
  .brand-name {
    font-size: .98rem;
    color: var(--paper);
  }
  .brand:hover .brand-name { color: var(--gold-light); }
  .brand-tagline {
    font-size: .58rem;
    letter-spacing: .16em;
    color: var(--gold);
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
    padding: .42rem .65rem;
    border: 1px solid rgba(247, 241, 230, .38);
    background: transparent;
    color: var(--paper);
    font-size: .76rem;
    letter-spacing: .1em;
    cursor: pointer;
    transition: border-color .18s var(--ease), color .18s var(--ease);
  }
  .nav-toggle:hover {
    border-color: var(--gold);
    color: var(--gold);
  }
  .nav-toggle__bars {
    display: inline-block;
    width: 18px;
  }
  .nav-toggle__bars span {
    display: block;
    height: 2px;
    background: currentColor;
    transition: transform .18s var(--ease);
  }
  .nav-toggle__bars span + span { margin-top: 5px; }
  .site-header[data-open="true"] .nav-toggle__bars span:first-child {
    transform: translateY(3.5px) rotate(45deg);
  }
  .site-header[data-open="true"] .nav-toggle__bars span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
  }

  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 3;
    width: min(88vw, 350px);
    max-height: 100dvh;
    padding: 1.1rem 0 1.4rem;
    background: var(--paper);
    border-right: 1px solid var(--grey);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform .24s var(--ease), visibility 0s linear .24s;
  }
  .site-header[data-open="true"] .site-nav {
    transform: translateX(0);
    visibility: visible;
    transition: transform .24s var(--ease), visibility 0s linear 0s;
  }

  .nav-caption {
    padding-right: 3.4rem;
    color: var(--muted);
  }

  .nav-close {
    position: absolute;
    top: .85rem;
    right: .85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--grey);
    background: transparent;
    color: var(--ink);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
  }
  .nav-close:hover {
    border-color: var(--red);
    color: var(--red);
  }

  .nav-list { margin-top: .3rem; }
  .nav-link { padding-block: .62rem; font-size: .95rem; }

  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2;
    background: rgba(21, 21, 21, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s var(--ease);
  }
  .site-header[data-open="true"] .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .rail-progress { display: none; }

  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-contact { grid-column: 1 / -1; }
}

/* ---------- 14. 手机 ---------- */
@media (max-width: 639px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-brand,
  .footer-contact { grid-column: auto; }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: .55rem;
  }
  .footer-copy { margin-right: 0; }
  .footer-seal { margin-top: .9rem; }
  .site-footer { padding-bottom: 1.6rem; }
}

/* ---------- 15. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .js-reveal [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .rail-progress__fill { transition: none; }
}
