/* ====================================================================
 * 主页样式 - 使用主题系统变量
 * 替换原有的硬编码颜色，支持主题切换
 * ==================================================================== */

/* 主屏幕容器 */
.altar-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    isolation: isolate;
    overflow: hidden;
    padding: 28px 12px 72px;
    font-family: var(--font-taoist);
    min-height: calc(100vh - 52px);
    position: relative;
}

.altar-particle-field {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    background:
    radial-gradient(circle at 72% 32%, rgba(172, 236, 217, 0.14), transparent 20%),
    radial-gradient(circle at 84% 86%, rgba(247, 170, 118, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(8, 5, 2, 0.01) 0%, rgba(14, 8, 4, 0.03) 34%, rgba(78, 50, 16, 0.06) 100%);
}

.altar-particle-field::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: 0.26;
}

.altar-particle-canvas {
    display: block;
    height: 100%;
    opacity: 0.98;
    width: 100%;
}

.altar-screen > :not(.altar-particle-field) {
    position: relative;
    z-index: 1;
}

/* 牌匾＋燈籠的外層容器 */
.altar-plaque-wrap {
    width: 100%;
    max-width: 900px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* 中式燈籠：絕對定位於牌匾兩側 */
.altar-candles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
}

.altar-candle {
    position: absolute;
    top: -30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.altar-candle:nth-child(1) { left: 12px; }
.altar-candle:nth-child(2) { right: 12px; }

/* 掛繩 - 固定颜色 */
.altar-candle .rope {
    width: 2px;
    height: 29px;
    background: linear-gradient(180deg,
        rgba(139, 64, 52, 0.72) 0%,
        rgba(139, 64, 52, 0.90) 100%);
}

/* 頂蓋 - 固定红色 */
.altar-candle .cap-top {
    width: 57px;
    height: 10px;
    background: linear-gradient(180deg,
        #8a1a00 0%,
        #cc3300 100%);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -1px 4px rgba(0,0,0,.5);
}

/* 燈籠主體 - 固定红色 */
.altar-candle .lantern-body {
    width: 52px;
    height: 83px;
    background: radial-gradient(
        ellipse 70% 60% at 50% 50%,
        rgba(255, 120, 10, 0.92) 0%,
        rgba(200, 40, 0, 0.97) 74%,
        rgba(140, 10, 0, 1) 100%
    );
    border-radius: 50% / 12px;
    position: relative;
    box-shadow:
        0 0 18px rgba(255, 100, 10, .65),
        0 0 36px rgba(200, 50, 0, .35),
        inset 0 0 12px rgba(255, 200, 50, .25);
    animation: hypnotic-pulse var(--pulse-alpha) ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.altar-candle:nth-child(2) .lantern-body { animation-delay: 1.1s; }

/* 燈籠橫紋 */
.altar-candle .lantern-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 11px,
        rgba(0,0,0,.18) 11px,
        rgba(0,0,0,.18) 13px
    );
    border-radius: inherit;
}

/* 燈籠文字 - 固定金黄色 */
.altar-candle .lantern-char {
    position: relative;
    z-index: 1;
    font-family: var(--font-taoist);
    font-size: 29px;
    font-weight: 900;
    color: #ffeea0;
    text-shadow: 0 0 8px rgba(255, 220, 80, .9), 0 1px 0 rgba(0,0,0,.4);
    line-height: 1;
    animation: breathe-effect 3s ease-in-out infinite;
}

.altar-candle:nth-child(2) .lantern-char { animation-delay: .6s; }

/* 底蓋 - 固定红色 */
.altar-candle .cap-bottom {
    width: 57px;
    height: 10px;
    background: linear-gradient(180deg,
        #cc3300 0%,
        #8a1a00 100%);
    border-radius: 0 0 3px 3px;
    box-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* 穗子 - 固定金黄色 */
.altar-candle .tassel {
    display: flex;
    gap: 3px;
    margin-top: 2px;
}

.altar-candle .tassel span {
    width: 2px;
    background: linear-gradient(180deg,
        #ffcc44 0%,
        rgba(255,180,20,0) 100%);
    border-radius: 1px;
    animation: incense-float 2.5s ease-in-out infinite;
}

.altar-candle .tassel span:nth-child(1) { animation-delay: 0s;   height: 31px; }
.altar-candle .tassel span:nth-child(2) { animation-delay: .3s;  height: 26px; }
.altar-candle .tassel span:nth-child(3) { animation-delay: .6s;  height: 29px; }
.altar-candle .tassel span:nth-child(4) { animation-delay: .15s; height: 23px; }
.altar-candle .tassel span:nth-child(5) { animation-delay: .45s; height: 31px; }

/* 道壇牌匾（主標題區）- 使用主题变量 + 丰富渐变 */
.altar-plaque {
    width: 100%;
    max-width: 800px;
    position: relative;
    z-index: 1;
    border: 2px solid var(--border);
    border-top: 3px solid var(--border-strong);
    border-bottom: 3px solid var(--border-strong);
    /* 丰富的渐变背景，类似商城页面 */
    background:
        radial-gradient(ellipse at top, rgba(255, 205, 126, 0.2), transparent 60%),
        radial-gradient(ellipse at bottom, rgba(157, 230, 207, 0.14), transparent 62%),
        linear-gradient(180deg, rgba(30, 18, 10, 0.42) 0%, rgba(19, 11, 7, 0.6) 100%);
    box-shadow:
        0 24px 58px rgba(9, 4, 1, 0.36),
        0 0 38px rgba(245, 184, 92, 0.08);
    padding: 22px 80px 18px;
    text-align: center;
    overflow: hidden;
    backdrop-filter: blur(16px);
}

.altar-plaque::selection,
.altar-main-title::selection,
.altar-sub-title::selection,
.altar-tagline::selection {
    background: color-mix(in srgb, var(--accent-primary) 22%, transparent);
}

.altar-plaque::after,
.altar-plaque::before {
    text-shadow: var(--plaque-corner-shadow, none);
}

.altar-plaque::after,
.altar-plaque::before,
.altar-main-title,
.altar-sub-title,
.altar-tagline {
    filter: var(--plaque-content-filter, none);
}

/* 牌匾四角朱砂符 - 使用主题变量 */
.altar-plaque::before,
.altar-plaque::after {
    content: "卍";
    position: absolute;
    color: var(--border);
    font-size: 16px;
    top: 8px;
}
.altar-plaque::before { left: 14px; }
.altar-plaque::after  { right: 14px; }

.altar-plaque > * {
    position: relative;
    z-index: 1;
}

.altar-plaque::after {
    right: 14px;
}

.altar-main-title {
    font-size: clamp(1.9rem, 6vw, 2.6rem);
    font-weight: 900;
    color: var(--text-accent);
    letter-spacing: .22em;
    text-shadow:
        2px 2px 0 var(--bg-primary),
        0 0 18px var(--glow-primary),
        0 0 40px var(--glow-secondary);
    animation: breathe-effect 4s ease-in-out infinite;
    margin: 0 0 6px;
    line-height: 1.25;
}

.altar-sub-title {
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    color: var(--text-primary);
    letter-spacing: .16em;
    margin: 0 0 4px;
    opacity: .85;
}

.altar-tagline {
    font-size: 12px;
    color: var(--text-muted, var(--muted));
    letter-spacing: .10em;
    margin-top: 10px;
}

/* 香爐裝飾分隔線 - 使用主题变量 */
.altar-divider {
    width: 100%;
    max-width: 800px;
    text-align: center;
    color: var(--border);
    font-size: 13px;
    letter-spacing: .25em;
    margin: 10px 0 6px;
    user-select: none;
}

/* 符籙服務卡片列表（豎排四欄）- 使用主题变量 + 丰富渐变 */
.altar-services {
    width: 100%;
    max-width: 720px;
    border: 1px solid var(--border);
    /* 丰富的渐变背景 */
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 204, 124, 0.18), transparent 58%),
        linear-gradient(180deg, rgba(28, 16, 10, 0.38) 0%, rgba(18, 11, 7, 0.56) 100%);
    box-shadow:
        0 22px 52px rgba(9, 4, 1, 0.3),
        0 0 32px rgba(245, 184, 92, 0.06);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.altar-services-header {
    background: linear-gradient(180deg, rgba(123, 58, 24, 0.48) 0%, rgba(70, 31, 14, 0.66) 100%);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-accent);
    letter-spacing: .28em;
}

.altar-service-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
}

.altar-service-item {
    flex: 1;
    border-right: 1px solid var(--border);
    animation: incense-float .6s ease both;
}
.altar-service-item:last-child { border-right: none; }
.altar-service-item:nth-child(1) { animation-delay: .05s; }
.altar-service-item:nth-child(2) { animation-delay: .13s; }
.altar-service-item:nth-child(3) { animation-delay: .21s; }
.altar-service-item:nth-child(4) { animation-delay: .29s; }

.altar-service-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 3px 6px;
    text-decoration: none;
    color: var(--text-primary);
    letter-spacing: .12em;
    border-top: 3px solid transparent;
    border-left: none;
    min-height: 144px;
    transition: all var(--transition-normal);
    position: relative;
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--card) 58%, transparent) 0%,
            color-mix(in srgb, var(--card-2, var(--card)) 44%, transparent) 100%);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 42%, transparent);
}

.altar-service-link:hover,
.altar-service-link:focus {
    /* 更丰富的hover效果 */
    background:
        radial-gradient(circle at 50% 50%, var(--glow-intense), transparent 80%),
        linear-gradient(180deg,
            color-mix(in srgb, var(--card) 68%, transparent) 0%,
            color-mix(in srgb, var(--card-2, var(--card)) 54%, transparent) 100%);
    color: var(--text-accent);
    border-top-color: var(--border-strong);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--accent-primary) 28%, transparent),
        inset 0 0 40px var(--glow-primary),
        0 0 20px var(--glow-secondary);
    outline: none;
}

.altar-service-link:hover .altar-service-arrow {
    opacity: 1;
    transform: translateY(0);
}

/* 符咒游標 */
.altar-service-arrow {
    color: var(--text-accent);
    margin-right: 10px;
    font-size: 13px;
    opacity: 0;
    transform: translateX(-6px);
    transition: all var(--transition-fast);
    width: 16px;
    flex-shrink: 0;
}

.altar-service-icon {
    font-size: 4.4em;
    text-align: center;
    filter: drop-shadow(0 0 14px var(--glow-primary));
    transition: all var(--transition-normal);
}

.altar-service-link:hover .altar-service-icon,
.altar-service-item.altar-active .altar-service-link .altar-service-icon {
    transform: scale(1.12);
    filter: drop-shadow(0 0 16px var(--glow-intense));
}

.altar-service-label {
    font-weight: 700;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: .18em;
    font-size: 2.1rem;
    line-height: 1.4;
}

.altar-service-desc {
    font-size: 12px;
    color: var(--muted);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: .10em;
}

/* 分隔線已由 border-right 取代，保留空規則避免 HTML 殘留 */
.altar-service-sep { display: none; }

/* 商城項目特效 */
.altar-service-item.featured .altar-service-link {
    color: var(--text-accent);
}

/* 底欄 - 使用主题变量 + 渐变 */
.altar-footer-bar {
    width: 100%;
    max-width: 720px;
    border: 1px solid var(--border);
    border-top: none;
    background:
        linear-gradient(180deg, rgba(28, 16, 10, 0.34) 0%, rgba(18, 11, 7, 0.52) 100%);
    padding: 6px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow:
        0 12px 24px rgba(9, 4, 1, 0.24),
        0 0 20px rgba(245, 184, 92, 0.05);
    backdrop-filter: blur(12px);
}

.altar-footer-bar span {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: .06em;
}

/* 底部香爐提示 */
.altar-hint {
    margin-top: 22px;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .10em;
    text-align: center;
    animation: hypnotic-pulse 3s ease-in-out infinite;
}

/* 鍵盤選中高亮 */
.altar-service-item.altar-active .altar-service-link {
    background:
        radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--accent-primary) 18%, transparent), transparent 72%),
        linear-gradient(180deg,
            color-mix(in srgb, var(--card) 64%, transparent) 0%,
            color-mix(in srgb, var(--card-2, var(--card)) 50%, transparent) 100%);
    color: var(--text-accent);
    border-top-color: var(--border-strong);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--accent-primary) 34%, transparent),
        inset 0 0 30px var(--glow-primary);
}

.altar-service-item.altar-active .altar-service-arrow {
    opacity: 1;
    transform: translateY(0);
}
