/* ======================================================
   PG平台 全站共享样式
   数字王座 · 深空蓝 x 金色 x 紫罗兰
   ====================================================== */

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

/* ---------- Design Tokens ---------- */
:root {
  --color-deep-space: #0A1B3F;
  --color-deep-sea: #0D2A5E;
  --color-gold: #C9A227;
  --color-gold-light: #E0C260;
  --color-violet: #7B2CBF;
  --color-deep-violet: #3F2A56;
  --color-ink: #1A1A2E;
  --color-cream: #F5F1E8;
  --color-gray-blue: #8A9BB7;

  --font-heading: 'Playfair Display', 'Times New Roman', serif;
  --font-body: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --header-width: 264px;
  --container-max: 1180px;
  --gutter: clamp(16px, 3vw, 32px);

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

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;
  --space-8: 6rem;

  --ease: 0.25s ease;
  --ease-slow: 0.3s ease;

  --z-skip: 300;
  --z-to-top: 150;
  --z-header: 100;
  --z-drawer: 90;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 0.5vw + 0.8rem, 1.1rem);
  line-height: 1.7;
  color: var(--color-cream);
  background-color: var(--color-deep-space);
  background-image:
    radial-gradient(ellipse at 85% -10%, rgba(123, 44, 191, 0.14), transparent 50%),
    radial-gradient(ellipse at 15% 110%, rgba(201, 162, 39, 0.07), transparent 42%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-cream);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 2vw + 1rem, 3.2rem); }
h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2.5rem); }
h3 { font-size: clamp(1.15rem, 0.5vw + 0.9rem, 1.55rem); }
h4 { font-size: clamp(1rem, 0.3vw + 0.85rem, 1.25rem); }

p {
  margin-bottom: var(--space-3);
}

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

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

/* ---------- Utilities ---------- */
.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;
}

.skip-link {
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-skip);
  background: var(--color-gold);
  color: var(--color-ink);
  padding: 12px 32px;
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  transition: top var(--ease);
}

.skip-link:focus-visible {
  top: 0;
  color: var(--color-ink);
}

/* ---------- Scroll Progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(201, 162, 39, 0.08);
  z-index: var(--z-to-top);
  pointer-events: none;
}

.scroll-progress__bar {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light) 60%, var(--color-violet));
  border-radius: 0 3px 3px 0;
}

/* ---------- Header / Sidebar ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--header-width);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(123, 44, 191, 0.12), transparent 55%),
    linear-gradient(180deg, #081530 0%, var(--color-deep-space) 38%, #0C0E24 100%);
  border-right: 1px solid rgba(201, 162, 39, 0.18);
  z-index: var(--z-header);
  display: flex;
  flex-direction: column;
}

.site-header__inner {
  display: flex;
  flex-direction: column;
  padding: 32px 28px 0;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-cream);
  transition: color var(--ease);
  width: fit-content;
}

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

.brand__mark {
  width: 38px;
  height: 38px;
  color: var(--color-gold);
  flex-shrink: 0;
  transition: color var(--ease);
}

.brand:hover .brand__mark {
  color: var(--color-gold-light);
}

.brand__text {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.brand__sub {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 400;
  font-style: normal;
  color: var(--color-gold-light);
  letter-spacing: 0.16em;
  border: 1px solid rgba(201, 162, 39, 0.4);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.brand:hover .brand__sub {
  border-color: rgba(224, 194, 96, 0.7);
}

/* Nav Toggle（移动端） */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  transition: border-color var(--ease), background-color var(--ease);
}

.nav-toggle:hover {
  border-color: var(--color-gold);
  background: rgba(201, 162, 39, 0.08);
}

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

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) 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(-7px) rotate(-45deg);
}

/* Nav */
.site-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0 20px;
}

.nav__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 30px 0 20px;
}

.nav__item {
  position: relative;
}

.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-pill);
  color: var(--color-gray-blue);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  transition: background-color var(--ease), color var(--ease);
}

.nav__link::before {
  content: attr(data-nav-index);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1;
  color: var(--color-gold);
  opacity: 0.55;
  letter-spacing: 0.05em;
  transition: opacity var(--ease);
}

.nav__link:hover {
  background: rgba(201, 162, 39, 0.08);
  color: var(--color-cream);
}

.nav__link:hover::before {
  opacity: 1;
}

.nav__link[aria-current="page"] {
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.14), rgba(201, 162, 39, 0.02));
  color: var(--color-gold-light);
  font-weight: 600;
}

.nav__link[aria-current="page"]::before {
  opacity: 1;
  color: var(--color-gold-light);
}

.nav__link[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--color-gold);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.5);
}

.site-header__meta {
  margin-top: auto;
  padding: var(--space-4) 4px var(--space-3);
  border-top: 1px solid rgba(201, 162, 39, 0.12);
}

.site-header__meta::before {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-gold), transparent);
  margin-bottom: 18px;
}

.site-header__tagline {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--color-gold-light);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.site-header__trust {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--color-gray-blue);
  letter-spacing: 0.02em;
  margin-bottom: 0;
}

/* ---------- To Top Button ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.4);
  color: var(--color-gold-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--ease), transform var(--ease), visibility var(--ease), background-color var(--ease), border-color var(--ease);
  z-index: var(--z-to-top);
  backdrop-filter: blur(6px);
}

.to-top:hover {
  background: rgba(201, 162, 39, 0.22);
  border-color: var(--color-gold);
}

.to-top svg {
  width: 22px;
  height: 22px;
}

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

/* ---------- Footer ---------- */
.site-footer {
  margin-left: var(--header-width);
  background:
    radial-gradient(ellipse at 85% 100%, rgba(123, 44, 191, 0.1), transparent 50%),
    var(--color-ink);
  border-top: 1px solid rgba(201, 162, 39, 0.16);
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold), var(--color-violet) 50%, transparent);
  opacity: 0.45;
}

.site-footer__inner {
  max-width: var(--container-max);
  margin-inline: auto;
  padding: var(--space-7) var(--gutter) 0;
}

.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: var(--space-6);
  padding-bottom: var(--space-6);
}

.footer__brand-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-start;
}

.brand--footer .brand__mark {
  width: 44px;
  height: 44px;
}

.brand--footer .brand__text {
  font-size: 1.4rem;
}

.footer__statement {
  color: var(--color-gray-blue);
  font-size: 0.86rem;
  max-width: 34ch;
  margin-bottom: 0;
  line-height: 1.8;
}

.footer__nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-nav__link {
  color: var(--color-gray-blue);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
}

.footer-nav__link::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--color-gold);
  opacity: 0.4;
  transition: opacity var(--ease), width var(--ease);
}

.footer-nav__link:hover {
  color: var(--color-gold-light);
}

.footer-nav__link:hover::before {
  opacity: 1;
  width: 22px;
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__contact-item {
  color: var(--color-gray-blue);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}

.footer__contact-item::before {
  content: '✦';
  color: var(--color-gold);
  font-size: 0.68rem;
  flex-shrink: 0;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--space-4) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--color-gray-blue);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

/* ---------- Main Content ---------- */
#main-content {
  margin-left: var(--header-width);
  min-height: 100vh;
}

/* ---------- Container ---------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container-max));
  margin-inline: auto;
}

.container--narrow {
  max-width: 720px;
}

/* ---------- Sections / Exhibit ---------- */
.exhibit {
  padding: var(--space-7) 0;
}

.exhibit__head {
  margin-bottom: var(--space-5);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.exhibit__title {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
}

.exhibit__title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.12em;
  width: 4px;
  height: 0.72em;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--color-gold), var(--color-violet));
}

.exhibit__lede {
  color: var(--color-gray-blue);
  max-width: 60ch;
  font-size: 0.95rem;
}

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(160deg, rgba(13, 42, 94, 0.72), rgba(30, 18, 50, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
  transition: border-color var(--ease), background-color var(--ease);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-gold), rgba(123, 44, 191, 0.6), transparent);
  opacity: 0;
  transition: opacity var(--ease);
}

.card:hover {
  border-color: rgba(201, 162, 39, 0.35);
}

.card:hover::before {
  opacity: 1;
}

.card__title {
  font-family: var(--font-heading);
  font-size: 1.18rem;
  margin-bottom: 8px;
}

.card__text {
  color: var(--color-gray-blue);
  font-size: 0.88rem;
  margin-bottom: 0;
  line-height: 1.7;
}

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  line-height: 1.4;
  white-space: nowrap;
}

.tag--gold {
  background: rgba(201, 162, 39, 0.1);
  color: var(--color-gold-light);
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.tag--violet {
  background: rgba(123, 44, 191, 0.16);
  color: #c78df0;
  border: 1px solid rgba(123, 44, 191, 0.36);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
  color: var(--color-ink);
}

.btn--primary:hover {
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
  box-shadow: 0 4px 32px rgba(201, 162, 39, 0.28);
  color: var(--color-ink);
}

.btn--ghost {
  background: transparent;
  border-color: rgba(201, 162, 39, 0.35);
  color: var(--color-gold-light);
}

.btn--ghost:hover {
  border-color: var(--color-gold);
  background: rgba(201, 162, 39, 0.06);
  color: var(--color-gold-light);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  margin-bottom: var(--space-4);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  font-size: 0.82rem;
  color: var(--color-gray-blue);
}

.breadcrumb__item {
  display: inline-flex;
  align-items: center;
}

.breadcrumb__item + .breadcrumb__item::before {
  content: '→';
  margin: 0 6px;
  color: var(--color-gold);
  opacity: 0.6;
  font-size: 0.72rem;
}

.breadcrumb__link {
  color: var(--color-gray-blue);
  text-decoration: none;
  transition: color var(--ease);
}

.breadcrumb__link:hover {
  color: var(--color-gold-light);
}

.breadcrumb__current {
  color: var(--color-cream);
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: var(--space-4);
}

/* ---------- Image Frame ---------- */
.image-frame {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-deep-sea), var(--color-deep-violet));
  border: 1px solid rgba(201, 162, 39, 0.12);
}

.image-frame::before {
  content: '';
  display: block;
  padding-top: 56.25%;
}

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

.image-frame--wide::before {
  padding-top: 42%;
}

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

.image-frame__caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(10, 27, 63, 0.85);
  color: var(--color-gold-light);
  font-size: 0.74rem;
  font-family: var(--font-mono);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(201, 162, 39, 0.3);
  backdrop-filter: blur(6px);
}

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  border: none;
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.4), rgba(201, 162, 39, 0.04) 70%, transparent);
  margin: var(--space-6) 0;
}

/* ---------- Prose ---------- */
.prose {
  max-width: 72ch;
  color: var(--color-cream);
}

.prose p {
  margin-bottom: var(--space-4);
  color: rgba(245, 241, 232, 0.85);
}

.prose h2,
.prose h3 {
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
  margin-bottom: var(--space-4);
  color: rgba(245, 241, 232, 0.85);
}

.prose li {
  margin-bottom: var(--space-2);
}

/* ---------- Page Title ---------- */
.page-title {
  font-size: clamp(2rem, 2vw + 1rem, 3.2rem);
  margin-bottom: var(--space-2);
}

.page-subtitle {
  color: var(--color-gray-blue);
  font-size: 1rem;
  max-width: 60ch;
}

/* ---------- Steps ---------- */
.step {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.step__number {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-gold);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: var(--radius-pill);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step__content {
  flex: 1;
  padding-top: 2px;
}

/* ---------- Body Lock ---------- */
.has-open-nav {
  overflow: hidden;
}

/* ---------- Mobile ---------- */
@media (max-width: 1023px) {
  body {
    background-attachment: scroll;
  }

  .site-header {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: 60px;
    border-right: none;
    border-bottom: 1px solid rgba(201, 162, 39, 0.18);
    background: rgba(10, 27, 63, 0.94);
    backdrop-filter: blur(10px);
    flex-direction: row;
    align-items: center;
  }

  .site-header__inner {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    width: 100%;
    height: 100%;
    padding: 0 16px;
  }

  .site-header__inner .brand__mark {
    width: 30px;
    height: 30px;
  }

  .site-header__inner .brand__text {
    font-size: 1.06rem;
  }

  .nav-toggle {
    display: flex;
    order: -1;
  }

  .site-nav {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: min(300px, 85vw);
    background: linear-gradient(180deg, #081530 0%, var(--color-ink) 80%);
    border-right: 1px solid rgba(201, 162, 39, 0.15);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform var(--ease-slow), visibility var(--ease-slow);
    padding: var(--space-3) var(--space-4) var(--space-4);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.4);
    z-index: var(--z-drawer);
  }

  .site-nav[data-open] {
    transform: translateX(0);
    visibility: visible;
  }

  .nav__list {
    padding: var(--space-4) 0;
  }

  #main-content,
  .site-footer {
    margin-left: 0;
  }

  #main-content {
    padding-top: 60px;
  }

  .site-footer__inner {
    padding-top: var(--space-5);
  }

  .footer__top {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

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

  .to-top {
    right: 16px;
    bottom: 16px;
  }

  .exhibit {
    padding: var(--space-5) 0;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .footer__top {
    grid-template-columns: 1fr 1fr;
  }

  .footer__brand-block {
    grid-column: 1 / -1;
  }
}

@media (max-width: 380px) {
  .site-header__inner .brand__sub {
    display: none;
  }

  .nav-toggle {
    width: 40px;
    height: 40px;
  }
}

/* ---------- Reduced Motion ---------- */
@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;
  }
}
