/* ============================================================
   博万娱乐官方网站 共享样式 /assets/site.css
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --c-emerald: #0F6B5A;
  --c-gold: #D4AF37;
  --c-orange: #E4582F;
  --c-deep: #0A4638;
  --c-mint: #EAF5F1;
  --c-ivory: #F7F7F2;
  --c-ink: #1A1A1A;
  --c-gray: #4A4A4A;
  --c-lightgray: #7A7A7A;

  --font-serif: "Noto Serif SC", "Source Han Serif", "Songti SC", serif;
  --font-sans: "Noto Sans SC", "Source Han Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --container: 1240px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 12px 32px rgba(10, 70, 56, 0.1);
  --shadow-header: 0 8px 24px rgba(10, 70, 56, 0.18);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--c-ivory);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  color: var(--c-ink);
  line-height: 1.25;
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 700;
}

h4 {
  font-size: 1.05rem;
  font-weight: 700;
}

p, ul, ol, dl {
  margin-top: 0;
  line-height: 1.8;
  color: var(--c-gray);
}

a {
  color: var(--c-emerald);
}

a:hover {
  color: var(--c-orange);
}

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

::selection {
  background: var(--c-gold);
  color: var(--c-deep);
}

:focus-visible {
  outline: 3px solid var(--c-orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 工具类 ---------- */
.mono {
  font-family: var(--font-mono);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 0.75rem;
}

.section-block {
  padding: clamp(3rem, 7vw, 6rem) 0;
}

/* ---------- 主内容 ---------- */
.main-content {
  min-height: calc(100vh - 420px);
  padding: 2rem 0 4.5rem;
}

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1.5rem;
  z-index: 200;
  background: var(--c-gold);
  color: var(--c-deep);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-header);
  transition: top 0.25s ease;
}

.skip-link:focus {
  top: 1.5rem;
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-emerald);
  transition: box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-header);
}

.topbar {
  background: var(--c-deep);
  color: var(--c-mint);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: var(--container);
  margin-inline: auto;
  padding: 0.45rem 1.5rem;
}

.topbar-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-gold);
  white-space: nowrap;
}

.topbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.topbar-links a {
  color: var(--c-mint);
  text-decoration: none;
  font-size: 0.78rem;
  padding: 0.15rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(212, 175, 55, 0.35);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.topbar-links a:hover {
  background: rgba(212, 175, 55, 0.12);
  color: var(--c-gold);
  border-color: rgba(212, 175, 55, 0.6);
}

.topbar-links a[aria-current="page"] {
  background: var(--c-gold);
  border-color: var(--c-gold);
  color: var(--c-deep);
  font-weight: 600;
}

.topbar-version {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(234, 245, 241, 0.55);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.mainbar {
  position: relative;
  background: var(--c-emerald);
}

.mainbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.8rem;
}

/* 品牌标识 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--c-ivory);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--c-ivory);
  box-shadow: inset 0 0 0 1px rgba(15, 107, 90, 0.1);
}

.brand-svg {
  width: 40px;
  height: 28px;
}

.brand-mountain {
  fill: var(--c-emerald);
}

.brand-sun {
  fill: var(--c-gold);
}

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

.brand-name {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  color: inherit;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: rgba(234, 245, 241, 0.55);
  margin-top: 0.3rem;
  text-transform: uppercase;
}

.brand-invert {
  color: var(--c-mint);
}

.brand-invert .brand-mark {
  background: var(--c-mint);
}

.brand-invert .brand-mountain {
  fill: var(--c-emerald);
}

.brand-invert .brand-sun {
  fill: var(--c-gold);
}

.brand-invert .brand-sub {
  color: rgba(212, 175, 55, 0.7);
}

/* 导航 */
.site-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  gap: 0.1rem;
}

.nav-list a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  color: rgba(234, 245, 241, 0.88);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.4;
  transition: background-color 0.2s, color 0.2s;
}

.nav-list a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--c-ivory);
}

.nav-list a[aria-current="page"] {
  background: var(--c-gold);
  color: var(--c-deep);
  font-weight: 600;
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.55rem;
  cursor: pointer;
  line-height: 0;
}

.nav-toggle-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 24px;
}

.nav-toggle-bar {
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.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;
}

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

/* 阅读进度条 */
.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(234, 245, 241, 0.12);
  z-index: 3;
}

.progress-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--c-gold), var(--c-orange));
  transition: width 0.1s linear;
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: linear-gradient(180deg, var(--c-deep) 0%, #073128 100%);
  color: var(--c-mint);
}

.footer-top {
  padding: clamp(2.8rem, 5vw, 4.5rem) 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1.2fr;
  gap: 2.2rem;
}

.footer-brand .brand {
  margin-bottom: 1rem;
}

.footer-trust {
  max-width: 30rem;
  margin: 1.25rem 0 0;
  border-left: 3px solid var(--c-gold);
  padding-left: 1rem;
  font-size: 0.85rem;
  line-height: 1.8;
  color: rgba(234, 245, 241, 0.62);
}

.footer-col {
  min-width: 0;
}

.footer-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-gold);
  margin: 0 0 0.8rem;
  letter-spacing: 0.06em;
}

.footer-title-mt {
  margin-top: 2rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-links a {
  color: rgba(234, 245, 241, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s, padding-left 0.2s;
}

.footer-links a:hover {
  color: var(--c-gold);
  padding-left: 4px;
}

.footer-links-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.footer-links-inline li {
  margin: 0;
}

.footer-links-inline a {
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.6rem;
  font-size: 0.74rem;
  color: rgba(234, 245, 241, 0.75);
}

.footer-links-inline a:hover {
  color: var(--c-gold);
  border-color: rgba(212, 175, 55, 0.7);
  padding-left: 0.6rem;
}

.footer-info {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: rgba(234, 245, 241, 0.75);
}

.footer-bottom {
  border-top: 1px solid rgba(234, 245, 241, 0.12);
  padding: 1rem 0;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(234, 245, 241, 0.6);
  margin: 0;
}

.footer-mono {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(212, 175, 55, 0.55);
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---------- 返回顶部 ---------- */
.back-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--c-gold);
  background: var(--c-emerald);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.3rem;
  box-shadow: var(--shadow-header);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background-color 0.3s;
  z-index: 70;
}

.back-top:hover {
  transform: translateY(-4px);
  background: var(--c-deep);
}

body.is-scrolled .back-top {
  opacity: 1;
  visibility: visible;
}

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.6rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

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

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

.btn-gold:hover {
  background: #e1c15e;
  color: var(--c-deep);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35);
}

.btn-orange {
  background: var(--c-orange);
  color: var(--c-ivory);
}

.btn-orange:hover {
  background: #ef6b44;
  color: #fff;
  box-shadow: 0 6px 18px rgba(228, 88, 47, 0.35);
}

.btn-outline {
  border-color: var(--c-emerald);
  color: var(--c-emerald);
  background: transparent;
}

.btn-outline:hover {
  background: var(--c-emerald);
  color: #fff;
}

.btn-block {
  width: 100%;
}

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--c-mint);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid rgba(15, 107, 90, 0.08);
  box-shadow: var(--shadow-card);
}

.card-index {
  border-top: 4px solid var(--c-gold);
}

.card-plain {
  background: var(--c-ivory);
}

/* ---------- 胶囊标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  background: var(--c-mint);
  color: var(--c-deep);
  text-decoration: none;
}

.tag-gold {
  background: var(--c-gold);
  color: var(--c-deep);
  font-weight: 600;
}

.tag-orange {
  background: var(--c-orange);
  color: #fff;
}

.tag-emerald {
  background: var(--c-emerald);
  color: #fff;
}

.tag-outline {
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: transparent;
  color: var(--c-gold);
}

/* ---------- 栅格 ---------- */
.grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.grid-2,
.grid-3,
.grid-4 {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (min-width: 992px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- 面包屑 ---------- */
.breadcrumbs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2rem;
  padding: 0.6rem 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c-lightgray);
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--c-lightgray);
}

.breadcrumbs a {
  color: var(--c-emerald);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--c-orange);
}

.breadcrumbs .is-current {
  color: var(--c-gray);
}

/* ---------- 时间轴 ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  position: relative;
  margin: 0;
  padding: 0 0 2rem 1.8rem;
  border-left: 1px solid rgba(15, 107, 90, 0.18);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.2rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--c-orange);
  border: 2px solid var(--c-gold);
}

.timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

/* ---------- 斜切背景带 ---------- */
.tilt-strip {
  background: var(--c-mint);
  transform: skewY(-1.4deg);
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.tilt-strip > .container {
  transform: skewY(1.4deg);
}

/* ---------- 章节目录 spy ---------- */
.spy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.spy-links a {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--c-mint);
  color: var(--c-deep);
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid rgba(15, 107, 90, 0.08);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.spy-links a:hover {
  background: var(--c-emerald);
  color: #fff;
}

.spy-links a.is-active,
.spy-links a[aria-current="true"] {
  background: var(--c-emerald);
  color: #fff;
  border-color: var(--c-emerald);
}

/* ---------- 滚动显现 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
  will-change: opacity, transform;
}

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

/* ---------- 响应式 ---------- */
@media (max-width: 991px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    flex: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-width: none;
    margin: 0;
    padding: 0.8rem 1.25rem 1.25rem;
    background: var(--c-deep);
    border-top: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 20;
  }

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

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

  .nav-list a {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    padding: 0.4rem 1rem;
    gap: 0.5rem;
  }

  .topbar-version {
    display: none;
  }

  .topbar-label {
    font-size: 0.62rem;
  }

  .topbar-links a {
    font-size: 0.7rem;
    padding: 0.12rem 0.55rem;
  }

  .mainbar-inner {
    padding-block: 0.6rem;
    gap: 0.6rem;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .brand-svg {
    width: 34px;
    height: 24px;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .back-top:hover {
    transform: none;
  }
}
