/**
 * 赛博寺庙 - 许愿页面样式
 */

/* ========================================
   页面基础
   ======================================== */
body {
    background-color: #05070b;
    overflow: hidden;
    cursor: default;
}

/* ========================================
   寺庙背景
   ======================================== */
#templeBackground {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #2b0505, #1a0202);
    overflow: hidden;
    z-index: 0;
}

#cardsContainer {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

#cardsContainer .wish-card-wrapper,
#cardsContainer .wish-card-simple {
    pointer-events: auto;
}

/* ========================================
   立柱
   ======================================== */
.pillar {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(90deg, #1a0202, #3d0a0a, #1a0202);
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    z-index: 1;
}

.pillar.left {
    left: 0;
}

.pillar.right {
    right: 0;
}

/* ========================================
   灵索（挂绳）
   ======================================== */
.spirit-rope {
    position: absolute;
    left: 80px;
    right: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #8B4513 10%, #8B4513 90%, transparent);
    opacity: 0.5;
    z-index: 1;
}

/* ========================================
   许愿卡片 - 3D 翻转容器
   ======================================== */
.wish-card-wrapper {
    position: absolute;
    width: 70px;
    height: 140px;
    perspective: 800px;
    transform-origin: center -20px;
    user-select: none;
    z-index: 10;
    cursor: pointer;
}

.wish-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 翻转后的状态 */
.wish-card.flipped {
    transform: rotateY(180deg);
}

/* 卡片正面（未翻转时显示 - 模糊状态） */
.card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: rgba(245, 240, 230, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 2px;
    opacity: 0.6;
    filter: grayscale(0.4);
}

/* 卡片背面（翻转后显示 - 真实内容） */
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    background: rgba(255, 251, 240, 0.98);
    border: 1px solid #d4af37;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3), 0 4px 15px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 2px;
}

/* 非翻转卡片（自己的愿望）使用旧样式 */
.wish-card-simple {
    position: absolute;
    width: 70px;
    height: 140px;
    background: rgba(245, 240, 230, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: center -20px;
    transition: transform 0.2s;
    user-select: none;
    z-index: 10;
    backdrop-filter: blur(2px);
}

/* 挂绳视觉连接 */
.card-string {
    position: absolute;
    top: -30px;
    left: 50%;
    width: 1px;
    height: 30px;
    background: linear-gradient(to top, rgba(139, 69, 19, 0.8), transparent);
    z-index: -1;
}

/* 挂孔 - 正面 */
.card-front .card-hole,
.card-back .card-hole,
.wish-card-simple::before {
    content: '';
    position: absolute;
    top: 6px;
    width: 6px;
    height: 6px;
    background: #111;
    border-radius: 50%;
    border: 1px solid #cfaa56;
}

.card-hole {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #111;
    border-radius: 50%;
    border: 1px solid #cfaa56;
}

/* 摇摆动画 */
@keyframes swing {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

/* ========================================
   鼠标跟随卡片
   ======================================== */
#cursorFollower {
    position: fixed;
    width: 70px;
    height: 140px;
    background: #fffbf0;
    border: 1px solid #d4af37;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, 10px);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4), 0 4px 15px rgba(0,0,0,0.4);
}

#cursorFollower::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #111;
    border-radius: 50%;
    border: 1px solid #cfaa56;
}

/* ========================================
   粒子效果
   ======================================== */
.dust {
    position: absolute;
    background: #d4af37;
    border-radius: 50%;
    opacity: 0;
    animation: glow 4s infinite;
}

/* ========================================
   右上角浮动许愿按钮
   ======================================== */
.wish-float-btn {
    position: fixed;
    top: 75px;  /* 在導航欄下方 */
    right: 20px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.9), rgba(74, 14, 14, 0.9));
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
    cursor: pointer;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.wish-float-btn:hover {
    background: linear-gradient(135deg, rgba(160, 82, 45, 0.95), rgba(90, 20, 20, 0.95));
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.wish-float-btn i {
    font-size: 16px;
}

/* 隐藏状态 */
.wish-float-btn.hidden {
    display: none;
}

/* ========================================
   卡片悬停效果
   ======================================== */
.wish-card-wrapper:hover .wish-card:not(.flipped) {
    transform: scale(1.08);
}

.wish-card-wrapper:hover .card-front {
    opacity: 0.8;
    filter: grayscale(0.2);
}

/* 点击提示 */
.card-front .click-hint {
    position: absolute;
    bottom: 8px;
    font-size: 8px;
    color: rgba(100, 80, 60, 0.5);
    letter-spacing: 1px;
}

