* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    position: relative;
}

.header-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
}

.header-decorations {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.decoration {
    font-size: 1.5rem;
    animation: float 3s ease-in-out infinite;
    opacity: 0.9;
}

.decoration:nth-child(1) { animation-delay: 0s; }
.decoration:nth-child(2) { animation-delay: 0.5s; }
.decoration:nth-child(3) { animation-delay: 1s; }
.decoration:nth-child(4) { animation-delay: 1.5s; }
.decoration:nth-child(5) { animation-delay: 2s; }

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

section {
    margin-bottom: 40px;
}

h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a5568;
    font-size: 2rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    background: #f7fafc;
    border-radius: 15px;
}

.tarot-card {
    aspect-ratio: 2/3;
    background: linear-gradient(145deg, #e2e8f0, #cbd5e0);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    padding: 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tarot-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.tarot-card:hover::before {
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); opacity: 0; }
}

.tarot-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border-color: #667eea;
}

.card-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    animation: pulse 2s ease-in-out infinite;
    z-index: 1;
    position: relative;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.tarot-card .card-number {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
    z-index: 1;
    position: relative;
}

.tarot-card .card-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: #2d3748;
    line-height: 1.2;
    z-index: 1;
    position: relative;
}

.card-detail {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-info {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
}

.card-image {
    display: flex;
    justify-content: center;
}

.card-back {
    width: 200px;
    height: 300px;
    background: linear-gradient(145deg, #4a5568, #2d3748);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: gold;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.card-back:hover {
    transform: rotateY(10deg);
}

.card-content h3 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.card-type {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 20px;
}

.card-meaning h4 {
    color: #4a5568;
    margin: 15px 0 10px 0;
    font-size: 1.2rem;
}

.card-meaning p {
    line-height: 1.6;
    color: #2d3748;
    margin-bottom: 15px;
}

.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.back-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.divination-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.divination-btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.divination-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.reading-result {
    background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%);
    border-radius: 15px;
    padding: 25px;
    min-height: 200px;
    border-left: 5px solid #667eea;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.reading-header {
    text-align: center;
    margin-bottom: 25px;
}

.reading-header h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.mystical-border {
    font-size: 1.2rem;
    margin: 10px 0;
    animation: sparkleFlow 3s ease-in-out infinite;
}

@keyframes sparkleFlow {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.celtic-description {
    font-style: italic;
    color: #667eea;
    margin-top: 10px;
    font-size: 1rem;
}

.mystical-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 1.1rem;
    animation: twinkle 2s ease-in-out infinite;
}

.reading-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reading-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.8s ease;
}

.reading-card:hover::before {
    left: 100%;
}

.reading-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.celtic-card {
    border-left: 4px solid #667eea;
}

.position-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.position-icon {
    font-size: 1.8rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.card-result-icon {
    font-size: 2rem;
    animation: rotate 4s linear infinite;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.reading-card h4 {
    color: #2d3748;
    margin-bottom: 10px;
}

.reading-card p {
    line-height: 1.6;
    color: #4a5568;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

.footer-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-icons span {
    animation: twinkle 2s ease-in-out infinite;
}

.footer-icons span:nth-child(1) { animation-delay: 0s; }
.footer-icons span:nth-child(2) { animation-delay: 0.4s; }
.footer-icons span:nth-child(3) { animation-delay: 0.8s; }
.footer-icons span:nth-child(4) { animation-delay: 1.2s; }
.footer-icons span:nth-child(5) { animation-delay: 1.6s; }

@keyframes twinkle {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.footer-blessing {
    font-style: italic;
    margin-top: 10px;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* 选牌动画样式 */
.card-selection-animation {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.animation-text {
    font-size: 1.5em;
    color: #ffd700;
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
}

.flying-cards {
    position: relative;
    height: 150px;
    margin: 20px 0;
}

.flying-card {
    position: absolute;
    font-size: 3em;
    color: #ffd700;
    animation: flyAround 2s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 30px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e, #ffd700);
    border-radius: 4px;
    width: 0%;
    transition: width 2.5s ease-in-out;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

@keyframes flyAround {
    0% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-30px) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-60px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translateY(-30px) rotate(270deg);
        opacity: 1;
    }
    100% {
        transform: translateY(0px) rotate(360deg);
        opacity: 0.7;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card-info {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .card-back {
        width: 150px;
        height: 225px;
    }
    
    .divination-options {
        flex-direction: column;
        align-items: center;
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}