/* =========================================================
   开元盛典 · 共享 Site CSS
   存为 /assets/site.css
   ========================================================= */

/* ---------- 变量 ---------- */
:root {
  --bg: #F5F5F5;
  --bg-warm: #F0E9DC;
  --bg-dark: #0F2440;
  --primary: #1B3A5C;
  --accent: #D4A843;
  --warn: #A63A2B;
  --success: #2E7D6B;
  --line: #C8C8C8;
  --ink: #2E3E50;
  --ink-soft: #5A6B7F;

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;

  --container: 1200px;
  --container-wide: 1400px;
  --space-section: 72px;

  --shadow-1: 0 4px 14px rgba(15, 36, 64, 0.08);
  --shadow-2: 0 12px 40px rgba(15, 36, 64, 0.16);
  --shadow-3: 0 24px 56px rgba(15, 36, 64, 0.22);
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(200, 200, 200, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 200, 200, 0.13) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
ol,
ul,
dl,
dd {
  margin: 0;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--warn);
}

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

::selection {
  background: var(--accent);
  color: var(--bg-dark);
}

/* ---------- 可访问性 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.skip-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 999;
  transform: translateY(-320%);
  background: var(--bg-dark);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-3);
  transition: transform 0.2s ease;
}

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

/* ---------- 排版 ---------- */
h1,
h2,
h3 {
  font-family: var(--serif);
  color: var(--primary);
}

h1 {
  font-size: 36px;
  line-height: 1.35;
}

h2 {
  font-size: 28px;
  line-height: 1.4;
}

h3 {
  font-size: 22px;
  line-height: 1.5;
}

.display {
  font-family: var(--serif);
  font-size: 48px;
  line-height: 1.25;
  color: var(--primary);
  font-weight: 700;
}

.lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.small {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: var(--space-section);
}

.section-tight {
  padding-block: 36px;
}

.grid {
  display: grid;
  gap: 24px;
}

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

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

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

.divider {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 32px 0;
}

.divider-gold {
  background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.6), transparent);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-gold {
  background: var(--accent);
  color: var(--primary);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(212, 168, 67, 0.3);
}

.btn-gold:hover {
  background: #DFB453;
  color: var(--bg-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 168, 67, 0.42);
}

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

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.btn-dark {
  background: var(--bg-dark);
  color: #fff;
  border-color: var(--bg-dark);
}

.btn-dark:hover {
  background: var(--primary);
  transform: translateY(-1px);
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(212, 168, 67, 0.16);
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
}

.tag-red {
  background: rgba(166, 58, 43, 0.09);
  border-color: rgba(166, 58, 43, 0.3);
  color: var(--warn);
}

.tag-green {
  background: rgba(46, 125, 107, 0.1);
  border-color: rgba(46, 125, 107, 0.3);
  color: var(--success);
}

/* ---------- 章节注记 ---------- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.section-label::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  margin: 0 0 24px;
  font-size: 14px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb li:not(:last-child)::after {
  content: "·";
  margin: 0 10px;
  color: var(--accent);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

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

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

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-warm);
  border: 1px solid rgba(200, 200, 200, 0.6);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  box-shadow: var(--shadow-1);
  transform: translateY(-2px);
  border-color: rgba(212, 168, 67, 0.5);
}

/* ---------- 标签页 ---------- */
.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 2px solid rgba(200, 200, 200, 0.5);
}

.tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: var(--radius-pill) var(--radius-pill) 12px 12px;
  margin-bottom: -2px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tab:hover {
  background: rgba(212, 168, 67, 0.18);
}

.tab[aria-selected="true"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

.tab-panel {
  padding: 32px 4px;
}

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

/* ---------- 图片容器 ---------- */
.img-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-warm);
  border: 1px solid var(--line);
}

.img-frame-4x3 {
  aspect-ratio: 4 / 3;
  min-height: 200px;
}

.img-frame-16x9 {
  aspect-ratio: 16 / 9;
  min-height: 180px;
}

.img-frame-1x1 {
  aspect-ratio: 1 / 1;
  min-height: 220px;
}

.img-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 滚动显现 ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

html.js [data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 滚动进度 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 400;
  background: linear-gradient(90deg, var(--accent), #E8C87A, var(--warn));
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.4);
  pointer-events: none;
}

/* ---------- 坐标条 ---------- */
.coord-strip {
  position: relative;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--line);
}

.coord-strip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 12%, var(--accent) 88%, transparent);
  opacity: 0.8;
}

.coord-strip-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 24px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
}

.coord-index {
  font-weight: 600;
  letter-spacing: 0.24em;
}

.coord-city {
  opacity: 0.72;
}

.coord-dot {
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.18);
}

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 12px;
  z-index: 100;
  margin-top: 12px;
  padding: 0 24px 12px;
}

.header-inner {
  position: relative;
  max-width: var(--container-wide);
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 20px;
  background: var(--primary);
  border: 1px solid rgba(212, 168, 67, 0.28);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-2);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--primary);
}

.brand:hover {
  color: var(--primary);
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), inset 0 0 0 1px rgba(27, 58, 92, 0.06);
}

.brand-mark::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--primary);
  transform: rotate(45deg);
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

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

.brand-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: inherit;
}

.brand-slogan {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.brand-light {
  color: #fff;
}

.brand-light:hover {
  color: #fff;
}

.brand-light .brand-slogan {
  color: rgba(245, 245, 245, 0.62);
}

/* 主导航 */
.main-nav {
  display: flex;
  align-items: center;
}

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

.nav-item {
  display: block;
}

.nav-link {
  display: block;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-link[aria-current="page"] {
  background: var(--accent);
  color: var(--primary);
  font-weight: 600;
}

.nav-login-mobile {
  display: none;
}

/* 头部操作区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.btn-login {
  padding-block: 9px;
}

/* 移动菜单按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.nav-toggle-line {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

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

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

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

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  background: var(--bg-dark);
  color: rgba(245, 245, 245, 0.82);
  padding: 72px 24px 32px;
  overflow: hidden;
}

.footer-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.footer-geo {
  position: absolute;
  border: 1px solid rgba(212, 168, 67, 0.14);
  background: linear-gradient(135deg, transparent 60%, rgba(212, 168, 67, 0.06));
  transform: rotate(45deg);
}

.footer-geo-a {
  width: 260px;
  height: 260px;
  top: -140px;
  right: 18%;
  border-radius: var(--radius-lg);
}

.footer-geo-b {
  width: 170px;
  height: 170px;
  top: -80px;
  right: 13%;
  border-radius: 50%;
}

.footer-geo-c {
  width: 220px;
  height: 220px;
  bottom: -120px;
  left: 4%;
  border-radius: var(--radius-lg);
}

.footer-inner {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(212, 168, 67, 0.18);
}

.footer-brand .brand {
  margin-bottom: 18px;
}

.footer-statement {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
  color: #fff;
  margin: 18px 0 12px;
  max-width: 520px;
}

.footer-trust {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(245, 245, 245, 0.62);
  max-width: 480px;
}

.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.footer-heading {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: rgba(245, 245, 245, 0.78);
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

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

.footer-contact li {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  color: rgba(245, 245, 245, 0.78);
}

.contact-label {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 600;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  padding-top: 28px;
  font-size: 13px;
  color: rgba(245, 245, 245, 0.6);
}

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

.footer-legal a {
  color: rgba(245, 245, 245, 0.7);
  text-decoration: none;
}

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

.legal-sep {
  margin: 0 4px;
  color: var(--accent);
  opacity: 0.55;
}

/* ---------- 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  border: 1px solid rgba(212, 168, 67, 0.4);
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
  box-shadow: var(--shadow-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--bg-dark);
  color: #fff;
}

/* ---------- 平板 ---------- */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .header-actions .btn-login {
    display: none;
  }

  .nav-login-mobile {
    display: inline-flex;
    width: 100%;
    margin-top: 12px;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    right: 0;
    justify-content: center;
    background: var(--bg-dark);
    border: 1px solid rgba(212, 168, 67, 0.35);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-16px);
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
  }

  .main-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
  }

  .nav-link {
    display: block;
    padding: 13px 16px;
    border-radius: 14px;
    text-align: left;
    font-size: 16px;
    color: rgba(245, 245, 245, 0.85);
  }

  .nav-link:hover {
    background: rgba(212, 168, 67, 0.16);
    color: #fff;
  }

  .nav-link[aria-current="page"] {
    background: var(--accent);
    color: var(--bg-dark);
  }

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

/* ---------- 手机 ---------- */
@media (max-width: 768px) {
  .container,
  .container-wide {
    padding-inline: 16px;
  }

  .section {
    padding-block: 48px;
  }

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

  .site-header {
    top: 8px;
    margin-top: 8px;
    padding: 0 12px 8px;
  }

  .header-inner {
    gap: 8px;
    padding: 8px 10px 8px 12px;
    border-radius: 20px;
  }

  .brand {
    gap: 10px;
  }

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

  .brand-mark::before {
    width: 15px;
    height: 15px;
  }

  .brand-name {
    font-size: 17px;
  }

  .brand-slogan {
    display: none;
  }

  .coord-strip-inner {
    padding: 5px 16px;
    font-size: 10px;
    gap: 10px;
  }

  .coord-city {
    display: none;
  }

  .site-footer {
    padding: 56px 16px 28px;
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

  .footer-statement {
    font-size: 18px;
  }

  .to-top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .scroll-progress {
    height: 2px;
  }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 480px) {
  .coord-locale {
    display: none;
  }

  .coord-index {
    letter-spacing: 0.16em;
  }

  .display {
    font-size: 38px;
    line-height: 1.3;
  }

  .header-inner {
    border-radius: 18px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 16px;
  }
}

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

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