/* =========================================================
   西门仙宗 · 仙气装饰层
   独立加载，可随时移除 <link> 完全回滚
   ========================================================= */

/* —— 1. 深夜星河多层背景 —— */
body {
    background:
        radial-gradient(ellipse at 18% -10%, rgba(34, 18, 60, 0.55), transparent 55%),
        radial-gradient(ellipse at 82% 12%, rgba(60, 30, 12, 0.42), transparent 50%),
        radial-gradient(ellipse at 50% 110%, rgba(14, 40, 50, 0.45), transparent 60%),
        linear-gradient(180deg, rgba(7, 9, 10, 0.94), rgba(10, 14, 14, 0.98)),
        var(--ink) !important;
}

/* —— 2. 渐变金箔标题 —— */
.hero-title span,
.section-heading h2,
.book-copy h2,
.feedback-copy h2,
.contact-inner h2,
.supporters-intro h2 {
    background: linear-gradient(135deg, #fbe79a 0%, #f0d990 30%, #d6b35a 60%, #f7e4a8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 22px rgba(240, 217, 144, 0.12);
}

/* —— 3. 标题"破墨"出场动画 —— */
.ink-reveal {
    display: inline-block;
    background-size: 100% 100% !important;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1600ms cubic-bezier(.55, .12, .25, 1);
}
.ink-reveal.is-revealed {
    clip-path: inset(0 0 0 0);
}
@media (prefers-reduced-motion: reduce) {
    .ink-reveal { clip-path: none; transition: none; }
}

/* —— 4. 品牌名统一字体（西门仙宗）—— */
.brand-name {
    font-family: 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'Noto Serif SC', serif !important;
    letter-spacing: 0.08em;
}
.brand-text.brand-name {
    font-size: 1.18rem;
    background: linear-gradient(135deg, #fbe79a 0%, #f0d990 50%, #d6b35a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* —— 5. 卡片如意金角装饰 —— */
.principle-card,
.path-step,
.sponsor-card {
    position: relative;
    isolation: isolate;
}
.principle-card::before,
.principle-card::after,
.path-step::before,
.path-step::after,
.sponsor-card::before,
.sponsor-card::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(214, 179, 90, 0.55);
    pointer-events: none;
    z-index: 1;
    transition: border-color 280ms ease, width 280ms ease, height 280ms ease;
}
.principle-card::before,
.path-step::before,
.sponsor-card::before {
    top: 10px;
    left: 10px;
    border-right: 0;
    border-bottom: 0;
}
.principle-card::after,
.path-step::after,
.sponsor-card::after {
    bottom: 10px;
    right: 10px;
    border-left: 0;
    border-top: 0;
}
.principle-card:hover::before,
.principle-card:hover::after,
.path-step:hover::before,
.path-step:hover::after,
.sponsor-card:hover::before,
.sponsor-card:hover::after {
    border-color: var(--gold-soft);
    width: 30px;
    height: 30px;
}

/* —— 6. 数字篆字化 path-step —— */
.path-step span {
    font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif !important;
    font-size: 2.2rem !important;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #fbe79a, #d6b35a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* —— 7. 按钮灵气光晕 —— */
.btn-primary {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: -2px;
    z-index: -1;
    border-radius: inherit;
    background: conic-gradient(
        from var(--halo-angle, 0deg),
        transparent 0deg,
        rgba(255, 232, 168, 0.0) 80deg,
        rgba(255, 232, 168, 0.55) 130deg,
        rgba(240, 217, 144, 0.9) 160deg,
        rgba(255, 232, 168, 0.55) 190deg,
        rgba(255, 232, 168, 0.0) 240deg,
        transparent 360deg
    );
    filter: blur(6px);
    opacity: 0;
    animation: halo-spin 5s linear infinite;
    transition: opacity 320ms ease;
}
@property --halo-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}
@keyframes halo-spin {
    to { --halo-angle: 360deg; }
}
.btn-primary:hover::before,
.btn-primary:focus-visible::before {
    opacity: 1;
}
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 245, 210, 0.45) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 720ms cubic-bezier(.4, .1, .3, 1);
    pointer-events: none;
}
.btn-primary:hover::after {
    transform: translateX(120%);
}

/* —— 8. 链接金光拖尾 —— */
.nav-links a {
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -2px;
    height: 1px;
    width: 0;
    background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
    box-shadow: 0 0 8px rgba(240, 217, 144, 0.6);
    transform: translateX(-50%);
    transition: width 340ms ease;
}
.nav-links a:hover::after,
.nav-links a.is-current::after {
    width: 110%;
}

/* —— 9. 卷轴金线滚动条 —— */
@supports (scrollbar-color: red blue) {
    html {
        scrollbar-color: rgba(214, 179, 90, 0.45) rgba(7, 9, 10, 0.4);
        scrollbar-width: thin;
    }
}
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(7, 9, 10, 0.5);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d6b35a, #8d6a26 50%, #d6b35a);
    border: 2px solid rgba(7, 9, 10, 0.7);
    border-radius: 8px;
    box-shadow: inset 0 0 4px rgba(255, 232, 168, 0.4);
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f0d990, #d6b35a 50%, #f0d990);
}

/* —— 10. 章节分隔线 (上下双线 + 中央纹样，无方框光) —— */
.section-divider {
    display: block;
    width: 100%;
    height: 72px;
    margin: 0;
    background-image:
        url('../images/divider-ornament.png'),
        linear-gradient(90deg,
            transparent 0%,
            rgba(214, 179, 90, 0) 4%,
            rgba(214, 179, 90, 0.55) 22%,
            rgba(240, 217, 144, 0.92) 50%,
            rgba(214, 179, 90, 0.55) 78%,
            rgba(214, 179, 90, 0) 96%,
            transparent 100%),
        linear-gradient(90deg,
            transparent 0%,
            rgba(214, 179, 90, 0) 4%,
            rgba(214, 179, 90, 0.55) 22%,
            rgba(240, 217, 144, 0.92) 50%,
            rgba(214, 179, 90, 0.55) 78%,
            rgba(214, 179, 90, 0) 96%,
            transparent 100%);
    background-repeat: no-repeat;
    background-position:
        center,
        center top 10px,
        center bottom 10px;
    background-size:
        auto 100%,
        100% 1px,
        100% 1px;
    mix-blend-mode: screen;
    pointer-events: none;
    position: relative;
    z-index: 3;
}

@media (max-width: 760px) {
    .section-divider {
        height: 52px;
    }
    .section-divider {
        background-position:
            center,
            center top 6px,
            center bottom 6px;
    }
}

/* —— 11. 八卦旋转角标 (左下，避让 feedback-float) —— */
.bagua-corner {
    position: fixed;
    left: 22px;
    bottom: 22px;
    width: 86px;
    height: 86px;
    pointer-events: none;
    opacity: 0.32;
    z-index: 5;
    animation: bagua-rotate 90s linear infinite;
    filter: drop-shadow(0 0 12px rgba(240, 217, 144, 0.28));
}
.bagua-corner svg {
    width: 100%;
    height: 100%;
}
@keyframes bagua-rotate {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .bagua-corner { animation: none; }
}
@media (max-width: 760px) {
    .bagua-corner {
        width: 54px;
        height: 54px;
        left: 12px;
        bottom: 12px;
        opacity: 0.22;
    }
}

/* —— 12. 云雾飘动 (hero) —— */
.hero-mist {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8%;
    height: 38%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.55;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(220, 200, 180, 0.18), transparent 55%),
        radial-gradient(ellipse at 70% 70%, rgba(240, 217, 144, 0.12), transparent 60%),
        radial-gradient(ellipse at 50% 95%, rgba(255, 240, 210, 0.10), transparent 60%);
    filter: blur(2px);
    animation: mist-drift 26s ease-in-out infinite alternate;
}
@keyframes mist-drift {
    0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 0.45; }
    50%  { opacity: 0.6; }
    100% { transform: translate3d(-30px, -10px, 0) scale(1.06); opacity: 0.5; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-mist { animation: none; }
}

/* —— 13. 重要段落首字下沉金边 —— */
.hero-desc::first-letter,
.book-lead::first-letter {
    float: left;
    font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
    font-size: 2.6em;
    line-height: 0.95;
    padding: 0.06em 0.18em 0 0;
    margin-right: 0.06em;
    color: var(--gold-soft);
    text-shadow: 0 0 14px rgba(240, 217, 144, 0.4);
}

/* —— 14. 书法字体加载（hero-title 主字）—— */
.hero-title span {
    font-family: 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'Noto Serif SC', serif !important;
    letter-spacing: 0.12em;
}

/* —— 15. brand-seal 增强：金光呼吸 —— */
.brand-seal {
    animation: seal-breath 4.5s ease-in-out infinite;
}
@keyframes seal-breath {
    0%, 100% { box-shadow: 0 0 18px rgba(214, 179, 90, 0.16), inset 0 0 0 rgba(214, 179, 90, 0); }
    50%      { box-shadow: 0 0 32px rgba(240, 217, 144, 0.38), inset 0 0 10px rgba(240, 217, 144, 0.18); }
}
@media (prefers-reduced-motion: reduce) {
    .brand-seal { animation: none; }
}

/* —— 16. 让粒子画布不挡交互 —— */
#spirit-particles,
#shooting-stars {
    mix-blend-mode: screen;
}

/* —— 17. dialog 表单底色微金 —— */
.feedback-dialog {
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(214, 179, 90, 0.25),
        0 0 80px rgba(214, 179, 90, 0.08);
}
