/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    overflow: hidden;
}

/* 容器样式 */
.tarot-container {
    width: 90%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}



/* 背景效果 */
.tarot-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    z-index: -1;
}

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

/* 章节样式 */
.section {
    display: none;
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

.section.active {
    display: block;
}

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

/* 标题样式 */
h1, h2 {
    color: #ffd700;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.8rem;
}

/* 问题输入区域 */
#question {
    width: 100%;
    height: 120px;
    padding: 15px;
    margin: 20px 0;
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    resize: none;
}

#question::placeholder {
    color: rgba(255, 255, 255, 0.5);
}



/* 占卜方式选择样式 */
.spread-selection {
    margin: 20px 0;
}

.spread-selection h3 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.spread-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.spread-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.spread-options label:hover {
    background: rgba(255, 215, 0, 0.1);
}

.spread-options input[type="radio"] {
    accent-color: #ffd700;
    transform: scale(1.2);
}

.spread-options span {
    font-size: 1rem;
}

/* 按钮样式 */
button {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

button:active {
    transform: translateY(0);
}

/* 牌堆样式 */
.card-deck {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 30px 0;
    overflow: hidden;
}

/* 塔罗牌样式 */
.tarot-card {
    width: 100px;
    height: 150px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.tarot-card {
    background-image: url('taluo_img/bei.webp');
    background-size: cover;
    background-position: center;
}

.tarot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.tarot-card:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 6px 15px rgba(255, 215, 0, 0.4);
}

.tarot-card.selected {
    animation: cardSelect 1s ease-in-out;
}

@keyframes cardSelect {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1.1) rotate(0deg); }
}

/* 选中的牌展示 */
.selected-cards {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.selected-card {
    width: 110px;
    height: 220px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    animation: fadeInUp 0.8s ease-out;
    flex: 0 0 auto;
    text-align: center;
}

/* 对于凯尔特十字等多张牌的情况 */
#result-section.celtic-cross .selected-card {
    width: 90px;
    height: 180px;
    padding: 6px;
}

#result-section.celtic-cross .selected-card h3 {
    font-size: 0.8rem;
}

#result-section.celtic-cross .selected-card p {
    font-size: 0.6rem;
}

#result-section.celtic-cross .card-image {
    width: 60px;
    height: 110px;
}

#result-section.celtic-cross .card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #fff;
}

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

.selected-card h3 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 1rem;
}

.selected-card p {
    font-size: 0.8rem;
    line-height: 1.3;
}

/* 卡片图片样式 */
.card-image {
    width: 80px;
    height: 140px;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #fff;
}

.selected-card.reversed {
    transform: rotate(180deg);
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.selected-card.reversed h3,
.selected-card.reversed p {
    transform: rotate(180deg);
}

/* 解读结果样式 */
.reading {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin: 30px 0;
    border: 1px solid rgba(255, 215, 0, 0.3);
    animation: fadeIn 1s ease-in;
    max-height: 400px;
    overflow-y: auto;
}

/* 滚动条样式 */
.reading::-webkit-scrollbar {
    width: 8px;
}

.reading::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.reading::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 10px;
}

.reading::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.8);
}

.reading p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.reading strong {
    color: #ffd700;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tarot-container {
        width: 95%;
        padding: 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    h3 {
        font-size: 1rem;
    }

    .card-deck {
        height: 350px;
    }

    .tarot-card {
        width: 70px;
        height: 105px;
    }

    .selected-card {
        width: 100px;
        height: 180px;
    }

    .selected-cards {
        gap: 12px;
    }

    .card-image {
        width: 70px;
        height: 120px;
    }

    .reading {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .tarot-container {
        width: 98%;
        padding: 10px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 0.9rem;
    }

    .card-deck {
        height: 300px;
    }

    .tarot-card {
        width: 60px;
        height: 90px;
    }

    .selected-card {
        width: 85px;
        height: 180px;
        padding: 8px;
    }

    .selected-cards {
        gap: 10px;
    }

    .card-image {
        width: 60px;
        height: 110px;
    }

    .selected-card p {
        font-size: 0.7rem;
    }

    .reading {
        max-height: 250px;
        padding: 15px;
    }

    .reading p {
        font-size: 0.9rem;
    }

    /* 凯尔特十字在小屏幕上的调整 */
    #result-section.celtic-cross .selected-card {
        width: 75px;
        height: 140px;
    }

    #result-section.celtic-cross .card-image {
        width: 50px;
        height: 90px;
    }

    #result-section.celtic-cross .selected-card h3 {
        font-size: 0.7rem;
    }

    #result-section.celtic-cross .selected-card p {
        font-size: 0.5rem;
    }
}

/* 横屏模式调整 */
@media (orientation: landscape) and (max-height: 500px) {
    .tarot-container {
        height: 95vh;
        overflow-y: auto;
    }

    .card-deck {
        height: 250px;
    }

    .selected-cards {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .selected-card {
        width: 90px;
        height: 160px;
    }

    .reading {
        max-height: 200px;
    }
}