/* ================================================================
   麻将胡了官网 · 全站共享样式  /assets/site.css
   ================================================================ */

/* ---------- 1. CSS 变量 ---------- */
:root {
  --color-red: #C4161C;
  --color-gold: #D4AF37;
  --color-ink: #1A1A1A;
  --color-emerald: #00A86B;
  --color-ivory: #FAF3E0;
  --color-carmine: #E63946;
  --color-brass: #B8860B;
  --color-gray: #5A5A5A;
  --color-line: rgba(212, 175, 55, 0.28);

  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-title: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --container-w: 1200px;
  --header-h: 72px;
  --radius: 4px;
  --radius-lg: 10px;

  --shadow-card: 0 2px 10px rgba(26, 26, 26, 0.08);
  --shadow-panel: 0 10px 30px rgba(26, 26, 26, 0.14);
  --shadow-gold: 0 0 12px rgba(212, 175, 55, 0.35);

  --transition: 0.22s ease;
}

/* ---------- 2. 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 900;
  line-height: 1.25;
}

p {
  margin: 0;
}

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

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

button {
  font-family: var(--font-body);
  font-size: 100%;
  line-height: 1.2;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

/* ---------- 3. 通用布局 ---------- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 20px;
}

@media (min-width: 769px) {
  .container {
    padding-inline: 32px;
  }
}

/* ---------- 4. 可访问性：跳转链接 ---------- */
.site-skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 3000;
  background: var(--color-ink);
  color: var(--color-ivory);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-220%);
  transition: transform 0.22s ease;
}

.site-skip:focus {
  transform: translateY(0);
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

/* ---------- 5. 滚动进度条 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 4000;
  pointer-events: none;
}

.scroll-progress__bar {
  display: block;
  width: var(--scroll-progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-carmine));
  transition: width 0.08s linear;
}

/* ---------- 6. 页头 ---------- */
.site-header {
  position: relative;
  z-index: 500;
}

/* 6a. 顶部公告条 */
.header-ticker {
  background-color: var(--color-ink);
  background-image:
    linear-gradient(rgba(212, 175, 55, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.header-ticker__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-gold);
  text-align: center;
  transition: color 0.2s ease, background 0.2s ease;
}

.header-ticker__link:hover {
  color: #fff;
  background: rgba(212, 175, 55, 0.06);
}

.header-ticker__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-emerald);
  box-shadow: 0 0 8px var(--color-emerald);
  flex-shrink: 0;
  animation: ticker-pulse 2.4s ease-in-out infinite;
}

.header-ticker__text {
  letter-spacing: 0.03em;
}

.header-ticker__arrow {
  flex-shrink: 0;
  font-size: 14px;
  transition: transform 0.2s ease;
}

.header-ticker__link:hover .header-ticker__arrow {
  transform: translateX(3px);
}

@keyframes ticker-pulse {
  0%, 100% {
    box-shadow: 0 0 4px var(--color-emerald);
  }
  50% {
    box-shadow: 0 0 10px var(--color-emerald), 0 0 4px var(--color-emerald);
  }
}

/* 6b. 主红区 */
.header-main {
  position: relative;
  background: var(--color-red);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.22);
}

.header-main::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-gold) 0%,
    var(--color-gold) 35%,
    rgba(212, 175, 55, 0.35) 70%,
    transparent 100%
  );
}

.header-main__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

/* 6c. 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 52px;
  background: var(--color-ink);
  border: 2px solid var(--color-gold);
  border-radius: 6px;
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 900;
  color: var(--color-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3), 2px 2px 0 rgba(0, 0, 0, 0.35);
  clip-path: polygon(0 0, 100% 0, 90% 100%, 0 100%);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.brand__title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--color-ivory);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.28);
}

.brand__subtitle {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: rgba(250, 243, 224, 0.78);
}

/* 6d. 导航 */
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.site-nav__link {
  display: block;
  position: relative;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-ivory);
  border-radius: 3px;
  transition: background 0.2s ease, color 0.2s ease;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--color-gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s ease;
}

.site-nav__link:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.14);
}

.site-nav__link:hover::after {
  transform: scaleX(1);
}

.site-nav__link[aria-current="page"] {
  background: var(--color-gold);
  color: var(--color-ink);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.site-nav__link[aria-current="page"]::after {
  display: none;
}

/* 6e. 移动端导航按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(250, 243, 224, 0.42);
  border-radius: var(--radius);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(0, 0, 0, 0.12);
  border-color: var(--color-gold);
}

.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-ivory);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.nav-toggle__label {
  font-size: 10px;
  line-height: 1;
  color: var(--color-ivory);
  letter-spacing: 0.14em;
}

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

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.4);
}

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

/* ---------- 7. 页脚 ---------- */
.site-footer {
  background: var(--color-ink);
  color: rgba(250, 243, 224, 0.78);
  border-top: 3px solid var(--color-gold);
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 34%;
  height: 3px;
  background: var(--color-carmine);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.3fr;
  gap: 44px;
  padding: 48px 0 40px;
}

.footer-brand .brand__title {
  color: var(--color-gold);
  font-size: 22px;
}

.footer-brand .brand__mark {
  width: 36px;
  height: 44px;
  font-size: 20px;
  background: var(--color-red);
  border-color: rgba(212, 175, 55, 0.7);
}

.footer-trust {
  margin-top: 18px;
  max-width: 34em;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(250, 243, 224, 0.62);
}

.footer-nav__title {
  margin-bottom: 14px;
  padding-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-gold);
  position: relative;
}

.footer-nav__title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 26px;
  height: 2px;
  background: var(--color-red);
}

.footer-nav__list li a {
  display: inline-block;
  padding: 3px 0;
  font-size: 14px;
  color: rgba(250, 243, 224, 0.7);
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-nav__list li a:hover {
  color: var(--color-gold);
  transform: translateX(3px);
}

.footer-contact__list li {
  display: flex;
  padding: 3px 0;
  font-size: 14px;
  line-height: 1.6;
}

.footer-contact__label {
  flex-shrink: 0;
  min-width: 40px;
  font-weight: 600;
  color: var(--color-gold);
}

.footer-bottom {
  border-top: 1px solid rgba(212, 175, 55, 0.16);
}

.footer-bottom__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 16px 0;
  font-size: 13px;
  color: rgba(250, 243, 224, 0.5);
}

.footer-copyright {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-icp {
  letter-spacing: 0.04em;
}

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

.footer-legal a {
  color: rgba(250, 243, 224, 0.6);
  transition: color 0.2s ease;
}

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

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  border: 2px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn--primary {
  background: var(--color-red);
  border-color: var(--color-red);
  color: #fff;
}

.btn--primary:hover {
  background: #a01216;
  border-color: #a01216;
  box-shadow: 0 5px 14px rgba(196, 22, 28, 0.32);
}

.btn--ghost {
  background: transparent;
  border-color: var(--color-red);
  color: var(--color-red);
}

.btn--ghost:hover {
  background: var(--color-red);
  color: #fff;
}

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

.btn--gold:hover {
  background: var(--color-brass);
  border-color: var(--color-brass);
  color: #fff;
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.32);
}

/* ---------- 9. 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-gray);
}

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

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

.breadcrumb__sep {
  color: rgba(26, 26, 26, 0.3);
}

/* ---------- 10. 章节标题 ---------- */
.section-head {
  margin-bottom: 32px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  padding-left: 12px;
  border-left: 3px solid var(--color-gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-brass);
}

.section-head__title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: 0.02em;
  color: var(--color-ink);
}

.section-head__title--cut {
  display: inline-block;
  padding-right: 0.42em;
  clip-path: polygon(0 0, 100% 0, 94% 100%, 0 100%);
}

/* ---------- 11. 卡片 ---------- */
.card {
  background: #fff;
  border: 1px solid rgba(184, 134, 11, 0.22);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--color-gold);
  box-shadow: var(--shadow-panel);
}

/* ---------- 12. 分隔线 ---------- */
.divider-gold {
  height: 2px;
  border: none;
  background: linear-gradient(90deg, var(--color-gold), rgba(212, 175, 55, 0.2) 70%, transparent);
  margin: 28px 0;
}

/* ---------- 13. 图片占位容器 ---------- */
.figure-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(212, 175, 55, 0.3);
  background-color: var(--color-ink);
  background-image:
    linear-gradient(rgba(212, 175, 55, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.05) 1px, transparent 1px),
    linear-gradient(145deg, #1a1a1a, #2b2b2b);
  background-size: 24px 24px, 24px 24px, 100% 100%;
}

.figure-frame::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.figure-frame--square::before {
  padding-top: 100%;
}

.figure-frame--portrait::before {
  padding-top: 125%;
}

.figure-frame--tile::before {
  padding-top: 75%;
}

.figure-frame::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 16px;
  height: 16px;
  border-top: 2px solid rgba(212, 175, 55, 0.45);
  border-right: 2px solid rgba(212, 175, 55, 0.45);
  border-radius: 0 4px 0 0;
}

.figure-frame__placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: rgba(212, 175, 55, 0.45);
}

/* ---------- 14. 数据数字 ---------- */
.stat-number {
  font-family: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-red);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---------- 15. 聚焦状态 ---------- */
:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

/* ---------- 16. 响应式 ---------- */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 32px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 600;
    background: var(--color-red);
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.26);
  }

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

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 20px 14px;
  }

  .site-nav__item {
    border-bottom: 1px solid rgba(250, 243, 224, 0.13);
  }

  .site-nav__item:last-child {
    border-bottom: 0;
  }

  .site-nav__link {
    padding: 14px 10px;
    font-size: 16px;
  }

  .site-nav__link::after {
    left: 10px;
    right: auto;
    width: 26px;
  }

  .header-main__inner {
    min-height: 64px;
  }

  .brand__title {
    font-size: 21px;
  }

  .brand__mark {
    width: 36px;
    height: 46px;
    font-size: 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 36px 0 32px;
  }

  .footer-bottom__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .container {
    padding-inline: 16px;
  }

  .brand__subtitle {
    letter-spacing: 0.16em;
  }

  .header-ticker__text {
    font-size: 12px;
  }
}

/* ---------- 17. 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .header-ticker__dot {
    animation: none;
  }

  .scroll-progress__bar {
    transition: none;
  }
}
