/* ============================================================
   麻将胡了官网 / assets/site.css
   共享外壳：reset · 变量 · 中文排版 · 头部 · 页脚 · 基础组件
   ============================================================ */

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

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

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

/* ---------- 设计变量 ---------- */
:root {
  --ivory: #F5F0E6;
  --paper: #FBF8F1;
  --bamboo: #4F6F52;
  --bamboo-deep: #2E4634;
  --cinnabar: #B6402A;
  --cinnabar-deep: #7A2E22;
  --gold: #C9A227;
  --ink: #171A17;
  --mist: #A9B7A4;
  --tile: #E8DCC4;

  --font-heading: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, "Times New Roman", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1240px;
  --gutter: 24px;
  --line: 3px;
  --radius: 2px;
  --shadow-soft: 6px 6px 0 rgba(23, 26, 23, 0.16);
  --shadow-hard: 8px 8px 0 var(--bamboo-deep);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --t-fast: 180ms;
  --t-base: 220ms;
}

/* ---------- 中文排版基础 ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--bamboo-deep);
}

h1 { font-size: clamp(40px, 6vw, 72px); }
h2 { font-size: clamp(28px, 3.4vw, 40px); }
h3 { font-size: clamp(20px, 2vw, 26px); }
h4 { font-size: 18px; }

strong { font-weight: 700; }

/* ---------- 工具类 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bamboo);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 3px;
  background: var(--cinnabar);
}

.annotation {
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--bamboo);
}

.v-note {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--mist);
}

.rule {
  border: 0;
  border-top: var(--line) solid var(--ink);
  margin: clamp(32px, 5vw, 56px) 0;
}

.rule--dashed {
  border-top: 1px dashed var(--mist);
}

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--paper);
  border-bottom: var(--line) solid var(--ink);
  box-shadow: 0 6px 0 rgba(46, 70, 52, 0.08);
}

.header-batch {
  background: var(--bamboo-deep);
  color: var(--ivory);
  border-bottom: 1px solid rgba(245, 240, 230, 0.22);
}

.header-batch-inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 6px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 12.5px;
}

.batch-chip {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.header-batch .annotation {
  color: rgba(245, 240, 230, 0.72);
  font-size: 12.5px;
}

.header-bar {
  position: relative;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 14px var(--gutter);
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 58px;
  background: var(--ivory);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--cinnabar);
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--cinnabar);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--bamboo-deep);
}

.brand-line {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bamboo);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 44px;
  padding: 0 10px;
  margin-left: auto;
  background: var(--ivory);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--bamboo-deep);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.nav-toggle:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--bamboo-deep);
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--ink);
  transition: transform var(--t-base) var(--ease), opacity var(--t-fast) linear;
}

.site-header[data-nav-open="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.site-header[data-nav-open="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-header[data-nav-open="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1 1 auto;
  margin-left: 26px;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-group--end { margin-left: auto; }

.nav-link {
  display: inline-block;
  position: relative;
  padding: 6px 2px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.nav-link:hover {
  color: var(--bamboo);
  border-bottom-color: var(--gold);
}

.nav-link[aria-current="page"] {
  color: var(--cinnabar);
  border-bottom-color: var(--cinnabar);
}

.nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: translateY(-50%) rotate(45deg);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  background: var(--cinnabar);
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.nav-cta:hover {
  background: var(--cinnabar-deep);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.nav-cta:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 3px;
  background: var(--tile);
  pointer-events: none;
  overflow: hidden;
}

.scroll-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cinnabar), var(--gold));
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: clamp(48px, 7vw, 96px);
  background: var(--ink);
  color: var(--paper);
  border-top: var(--line) solid var(--ink);
}

.site-footer::before {
  content: "";
  display: block;
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--cinnabar) 0 18%,
    var(--gold) 18% 34%,
    var(--bamboo) 34% 64%,
    var(--bamboo-deep) 64% 100%
  );
}

.footer-inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) 0;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 340px;
}

.footer-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 50px;
  background: var(--tile);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--cinnabar-deep);
}

.footer-name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--paper);
}

.footer-batch {
  display: inline-flex;
  width: fit-content;
  padding: 4px 10px;
  border: 1px solid rgba(201, 162, 39, 0.55);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.footer-lede {
  max-width: 32ch;
  font-size: 14.5px;
  line-height: 1.8;
  color: rgba(251, 248, 241, 0.72);
}

.footer-col-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-link {
  display: inline-block;
  padding: 5px 0;
  font-size: 15px;
  color: rgba(251, 248, 241, 0.86);
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.footer-link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.footer-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px 40px;
  margin-top: clamp(32px, 5vw, 56px);
  padding-top: 24px;
  border-top: 1px solid rgba(251, 248, 241, 0.18);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-contact-line {
  font-size: 14px;
  line-height: 1.9;
  color: rgba(251, 248, 241, 0.8);
}

.footer-contact-line a {
  color: var(--gold);
  border-bottom: 1px solid rgba(201, 162, 39, 0.5);
}

.footer-contact-line a:hover {
  border-bottom-color: var(--gold);
}

.footer-note {
  max-width: 56ch;
  font-size: 13px;
  line-height: 1.85;
  color: rgba(251, 248, 241, 0.6);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 28px;
  padding: 18px 0 28px;
  border-top: 1px solid rgba(251, 248, 241, 0.18);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(251, 248, 241, 0.6);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn--primary {
  background: var(--cinnabar);
  color: var(--paper);
}

.btn--primary:hover { background: var(--cinnabar-deep); }

.btn--ghost {
  background: transparent;
  color: var(--bamboo-deep);
}

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

/* ---------- 面包屑 ---------- */
.breadcrumbs { padding: 22px 0 0; }

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

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

.breadcrumb-item:not(:last-child)::after {
  content: "/";
  color: var(--mist);
}

.breadcrumb-item a {
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.breadcrumb-item a:hover {
  color: var(--bamboo-deep);
  border-bottom-color: var(--gold);
}

.breadcrumb-item[aria-current="page"] {
  color: var(--cinnabar-deep);
  font-weight: 700;
}

/* ---------- 基础布局 ---------- */
.main-content { display: block; }

.section { padding: clamp(48px, 7vw, 96px) 0; }

.section-band {
  padding: clamp(36px, 5vw, 64px) 0;
  background: var(--bamboo-deep);
  color: var(--paper);
  border-top: var(--line) solid var(--ink);
  border-bottom: var(--line) solid var(--ink);
}

.section-band h2,
.section-band h3 {
  color: var(--paper);
}

.section-band .annotation { color: var(--mist); }

.grid {
  display: grid;
  gap: clamp(20px, 3vw, 36px);
}

.grid--split { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); }
.grid--aside { grid-template-columns: minmax(0, 180px) minmax(0, 1fr); }

.prose {
  max-width: 700px;
  font-size: 17.5px;
  line-height: 1.85;
  color: var(--ink);
}

.prose p { max-width: 680px; }
.prose p + p { margin-top: 1.1em; }
.prose h2 { margin-top: 2.2em; margin-bottom: 0.6em; }
.prose h3 { margin-top: 1.8em; margin-bottom: 0.5em; }
.prose ul,
.prose ol {
  margin: 1.1em 0;
  padding-left: 1.4em;
  list-style: disc;
}
.prose ol { list-style: decimal; }
.prose li { margin: 0.45em 0; }
.prose strong { color: var(--bamboo-deep); }
.prose a {
  color: var(--cinnabar-deep);
  border-bottom: 2px solid var(--gold);
}

/* ---------- 牌面卡片 ---------- */
.tile {
  position: relative;
  padding: 22px;
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.tile-stack {
  display: grid;
  gap: 14px;
}

.tile-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- 图片容器 ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--tile);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
}

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

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

.media-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--bamboo);
  background: repeating-linear-gradient(135deg, var(--tile) 0 14px, var(--ivory) 14px 28px);
}

.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--bamboo);
}

/* ---------- 标签页 ---------- */
.tabs { margin-top: 24px; }

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: var(--line) solid var(--ink);
}

.tab-btn {
  position: relative;
  top: 3px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  color: var(--bamboo-deep);
  background: var(--tile);
  border: var(--line) solid var(--ink);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.tab-btn:hover { background: var(--ivory); }

.tab-btn[aria-selected="true"] {
  background: var(--cinnabar);
  color: var(--paper);
}

.tab-panel {
  padding: clamp(18px, 3vw, 28px);
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-soft);
}

.tab-panel[hidden] { display: none; }

/* ---------- 渐显 ---------- */
html.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 550ms var(--ease), transform 550ms var(--ease);
}

html.reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 平板 ---------- */
@media (max-width: 960px) {
  html { scroll-padding-top: 110px; }

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

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 12px 0 18px;
    background: var(--paper);
    border-top: 1px solid var(--mist);
    border-bottom: var(--line) solid var(--ink);
    box-shadow: 0 10px 0 rgba(46, 70, 52, 0.1);
  }

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

  .nav-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-group--end {
    margin-left: 0;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--mist);
  }

  .nav-link {
    display: block;
    padding: 13px var(--gutter);
    font-size: 16px;
    border-bottom: 1px solid rgba(169, 183, 164, 0.4);
  }

  .nav-link[aria-current="page"] {
    background: var(--tile);
    border-bottom-color: var(--cinnabar);
  }

  .nav-link[aria-current="page"]::before { left: 8px; }

  .nav-cta {
    margin: 14px var(--gutter) 0;
    padding: 13px 18px;
  }

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

  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-meta { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 手机 ---------- */
@media (max-width: 640px) {
  body { font-size: 16.5px; }

  .header-bar {
    gap: 12px;
    padding: 10px var(--gutter);
    min-height: 76px;
  }

  .brand-mark { width: 40px; height: 50px; font-size: 22px; }
  .brand-name { font-size: 17px; }
  .brand-line { font-size: 10px; letter-spacing: 0.1em; }

  .header-batch-inner { font-size: 11.5px; padding: 5px var(--gutter); }

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

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .btn { width: 100%; }

  .tile-hand {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }

  .tile-hand > * {
    flex: 0 0 auto;
    width: min(78vw, 300px);
    scroll-snap-align: start;
  }
}

@media (max-width: 420px) {
  .brand-line { display: none; }
}

/* ---------- 动效降级 ---------- */
@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;
    scroll-behavior: auto !important;
  }

  html.reveal-ready [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
