/* ============================================================
   虹梁水陌 — Global CSS
   Variables · Font · Background · Reset
   ============================================================ */

@font-face {
  font-family: 'QuanHeng';
  src: url('../Fonts/QuanHengDuLiang-OTF.otf') format('opentype'),
       url('../Fonts/QuanHengDuLiang-TTF.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── Core Design Tokens ─────────────────────────────────── */
:root {
  /* Brand palette — OKLCH for perceptual uniformity */
  --color-silk:      oklch(93% 0.018 82);    /* 绢黄 #F2EBDC */
  --color-ink-green: oklch(36% 0.055 185);   /* 黛绿 #2D585A */
  --color-ink-black: oklch(14% 0.008 260);   /* 墨黑 #1A1A1A */

  /* Tinted neutrals */
  --color-surface:   oklch(91% 0.014 82);
  --color-mist:      oklch(80% 0.022 82);
  --color-stone:     oklch(55% 0.025 185);
  --color-fog:       oklch(96% 0.010 82);

  /* Accent */
  --color-vermilion: oklch(58% 0.19 28);     /* 朱砂红 */
  --color-gold:      oklch(72% 0.12 75);     /* 金箔 */

  /* Typography */
  --font-calligraphy: 'QuanHeng', 'STKaiti', 'KaiTi', serif;
  --font-body:        'Noto Serif SC', 'Source Han Serif SC', 'STSong', Georgia, serif;
  --font-label:       'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  /* Spacing scale (4pt base) */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --duration-fast:   180ms;
  --duration-base:   320ms;
  --duration-slow:   600ms;
  --duration-xslow:  1200ms;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* body {
  font-family: var(--font-body);
  color: var(--color-ink-black);
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
} */

/* ── Page transition overlay ────────────────────────────── */
.page-veil {
  position: fixed;
  inset: 0;
  background: var(--color-ink-black);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out-quart);
}

.page-veil.fade-in {
  opacity: 1;
  pointer-events: all;
}

/* ── Utility ────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--primary-gold, #c4a46c); /* 使用主题色， fallback 为金色 */
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(62, 44, 30, 0.3);
    cursor: pointer;
    z-index: 1000;
    
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

/* 显示状态 */
.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 悬停效果 */
.back-to-top-btn:hover {
    background-color: var(--accent-red, #9e2a2b); /* 悬停变红 */
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(158, 42, 43, 0.4);
}

/* 图标样式 */
/* .back-to-top-btn svg {
    width: 20px;
    height: 20px;
    margin-bottom: 1px;
} */

/* 文字样式 (可选，如果圆圈太小可以隐藏文字只留图标) */
.back-to-top-btn .btn-text {
    font-size: 16px;
    font-family: "STKaiti", serif;
    line-height: 10;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .back-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    .back-to-top-btn .btn-text {
        display: none; /* 移动端只显示箭头 */
    }
}