/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: #121212;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 星座背景 */
.constellation-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
}

/* 主容器 */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 引导页面 */
.intro-page {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(18, 18, 18, 0.95);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    max-width: 600px;
    width: 100%;
}

.title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 3rem;
    color: #D4AF37;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.subtitle {
    font-size: 1.2rem;
    color: #cccccc;
    margin-bottom: 3rem;
    opacity: 0.8;
}

.question-input {
    margin-bottom: 2rem;
}

.question-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.question-textarea:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.start-btn {
    background: linear-gradient(135deg, #D4AF37 0%, #BF953F 100%);
    color: #121212;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cinzel Decorative', serif;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

/* 洗牌页面 */
.shuffling-page {
    text-align: center;
    padding: 3rem 2rem;
}

.shuffling-animation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.card-shuffle {
    width: 80px;
    height: 120px;
    background: linear-gradient(135deg, #D4AF37 0%, #BF953F 100%);
    border-radius: 10px;
    animation: shuffle 1.5s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

@keyframes shuffle {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

.shuffling-text {
    font-size: 1.2rem;
    color: #D4AF37;
    opacity: 0.8;
}

/* 牌阵页面 */
.reading-page {
    text-align: center;
    width: 100%;
}

.reading-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2.5rem;
    color: #D4AF37;
    margin-bottom: 3rem;
}

.card-spread {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.tarot-card {
    width: 150px;
    height: 220px;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.tarot-card:hover {
    transform: translateY(-5px);
}

.tarot-card .card-front,
.tarot-card .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    transition: transform 0.6s ease;
}

.tarot-card .card-front {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #D4AF37;
    transform: rotateY(0deg);
}

.tarot-card .card-back {
    background: linear-gradient(135deg, #D4AF37 0%, #BF953F 100%);
    transform: rotateY(180deg);
}

.tarot-card.reversed .card-front {
    transform: rotateY(180deg);
}

.tarot-card.reversed .card-back {
    transform: rotateY(0deg);
}

.card-pattern {
    width: 80%;
    height: 80%;
    background: 
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 70%),
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.1) 0px, rgba(0, 0, 0, 0.1) 2px, transparent 2px, transparent 4px);
    border-radius: 10px;
}

.card-number {
    font-size: 0.8rem;
    color: #D4AF37;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.card-name {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.1rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: 0.5rem;
}

.card-symbol {
    font-size: 0.8rem;
    color: #cccccc;
    opacity: 0.8;
}

.interpret-btn {
    background: rgba(212, 175, 55, 0.2);
    color: #D4AF37;
    border: 1px solid #D4AF37;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.interpret-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

/* 解读页面 */
.interpretation-page {
    width: 100%;
    max-width: 900px;
}

.card-detail {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-bottom: 2rem;
    background: rgba(18, 18, 18, 0.95);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.card-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-visual {
    width: 200px;
    height: 300px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #D4AF37;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.card-visual h3 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.5rem;
    color: #D4AF37;
    text-align: center;
    margin-bottom: 1rem;
}

.card-position {
    font-size: 1rem;
    color: #ffffff;
    opacity: 0.8;
    text-align: center;
}

.interpretation-content {
    color: #ffffff;
}

.interpretation-content h2 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2rem;
    color: #D4AF37;
    margin-bottom: 2rem;
}

.meaning-section,
.contextual-section,
.reflection-section {
    margin-bottom: 2rem;
}

.meaning-section h3,
.contextual-section h3,
.reflection-section h3 {
    font-size: 1.3rem;
    color: #D4AF37;
    margin-bottom: 1rem;
    font-family: 'Cinzel Decorative', serif;
}

.meaning-section p,
.contextual-section p,
.reflection-section p {
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.reflection-textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    resize: vertical;
    margin-top: 1rem;
}

.reflection-textarea:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.navigation-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-btn.primary {
    background: rgba(212, 175, 55, 0.2);
    border-color: #D4AF37;
    color: #D4AF37;
}

.nav-btn.primary:hover {
    background: rgba(212, 175, 55, 0.3);
}

/* 法律声明 */
.legal-footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    color: #666666;
    font-size: 0.9rem;
    opacity: 0.7;
}

.legal-footer p {
    margin-bottom: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .card-spread {
        gap: 1rem;
    }
    
    .tarot-card {
        width: 120px;
        height: 180px;
    }
    
    .card-detail {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }
    
    .card-visual {
        width: 150px;
        height: 225px;
    }
    
    .navigation-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .intro-page {
        padding: 2rem 1rem;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .card-spread {
        flex-direction: column;
        align-items: center;
    }
    
    .tarot-card {
        width: 100px;
        height: 150px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro-page,
.shuffling-page,
.reading-page,
.interpretation-page {
    animation: fadeIn 0.6s ease-out;
}

/* 粒子效果增强 */
.tarot-card .card-front::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #D4AF37, transparent, #D4AF37);
    border-radius: 17px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tarot-card:hover .card-front::before {
    opacity: 0.3;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}
