/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #0a1a2e 100%);
    color: #e0d4ff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 星空背景 */
#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* 容器 */
.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 标题 */
header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.title {
    font-size: 3em;
    background: linear-gradient(135deg, #ffd700 0%, #ff69b4 50%, #9370db 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    margin-bottom: 10px;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.subtitle {
    font-size: 1.2em;
    color: #b8a8d8;
    font-style: italic;
}

/* 屏幕 */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 开始界面 */
.intro {
    text-align: center;
    padding: 60px 20px;
}

.intro h2 {
    font-size: 2.5em;
    color: #ffd700;
    margin-bottom: 20px;
}

.intro p {
    font-size: 1.3em;
    color: #c8b8e8;
    margin-bottom: 30px;
}

/* 问题输入区域 */
.question-input-container {
    max-width: 600px;
    margin: 0 auto 40px;
    text-align: center;
}

.question-label {
    display: block;
    color: #ffd700;
    font-size: 1.2em;
    margin-bottom: 15px;
}

.question-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    background: rgba(42, 26, 74, 0.8);
    border: 2px solid #9370db;
    border-radius: 10px;
    color: #e0d4ff;
    resize: none;
    font-family: inherit;
    transition: all 0.3s ease;
}

.question-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.question-input::placeholder {
    color: #8a7ab8;
}

.card-preview {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 50px;
}

.preview-card {
    width: 120px;
    height: 200px;
    background-image: url('../images/8059ab61e97e3cb1383d456d291812e1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid #ffd700;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    animation: float 3s ease-in-out infinite;
}

.preview-card:nth-child(2) {
    animation-delay: 0.5s;
}

.preview-card:nth-child(3) {
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* 神秘按钮 */
.mystical-btn {
    background: linear-gradient(135deg, #6a0dad 0%, #9b30ff 50%, #ba55d3 100%);
    border: 2px solid #ffd700;
    color: #fff;
    padding: 15px 50px;
    font-size: 1.3em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(154, 48, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.mystical-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.mystical-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(154, 48, 255, 0.7);
}

.mystical-btn:hover::before {
    left: 100%;
}

/* 抽牌界面 */
#draw-screen {
    padding: 20px;
}

#draw-screen h2 {
    text-align: center;
    font-size: 2em;
    color: #ffd700;
    margin-bottom: 10px;
}

.instruction {
    text-align: center;
    color: #c8b8e8;
    margin-bottom: 30px;
    font-size: 1.1em;
}

/* 牌网格 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 20px;
}

.tarot-card {
    width: 80px;
    height: 120px;
    background-image: url('../images/8059ab61e97e3cb1383d456d291812e1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid #9370db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tarot-card::before {
    content: '';
}

.tarot-card:hover:not(.selected):not(.disabled) {
    transform: translateY(-10px) scale(1.05);
    border-color: #ffd700;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

.tarot-card.selected {
    opacity: 0.3;
    cursor: not-allowed;
}

.tarot-card.reversed {
    transform: rotate(180deg);
}

.tarot-card.reversed:hover:not(.selected):not(.disabled) {
    transform: rotate(180deg) translateY(-10px) scale(1.05);
}

.tarot-card.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 已选择的牌 */
.selected-cards {
    background: rgba(42, 26, 74, 0.5);
    border-radius: 15px;
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #9370db;
}

.selected-cards h3 {
    text-align: center;
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.selected-slots {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.slot {
    text-align: center;
}

.slot-label {
    display: block;
    color: #ffd700;
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: bold;
}

.slot-card {
    width: 100px;
    height: 150px;
    background: rgba(74, 42, 106, 0.5);
    border: 2px dashed #9370db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.slot-card.filled {
    background-image: url('../images/8059ab61e97e3cb1383d456d291812e1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid #ffd700;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.slot-card.filled::after {
    content: '✦';
    font-size: 2.5em;
    color: #ffd700;
}

/* 结果界面 */
#result-screen {
    padding: 20px;
}

#result-screen h2 {
    text-align: center;
    font-size: 2.5em;
    color: #ffd700;
    margin-bottom: 20px;
}

/* 问题显示 */
.question-display {
    text-align: center;
    background: rgba(42, 26, 74, 0.6);
    border: 1px solid #9370db;
    border-radius: 10px;
    padding: 15px 30px;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.question-icon {
    font-size: 1.5em;
    margin-right: 10px;
}

#user-question {
    color: #ffd700;
    font-size: 1.2em;
    font-style: italic;
}

/* 分析区域 */
.analysis-section {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background: rgba(42, 26, 74, 0.6);
    border: 2px solid #9370db;
    border-radius: 15px;
    text-align: center;
}

.analysis-section h3 {
    color: #ffd700;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.analysis-text {
    color: #c8b8e8;
    font-size: 1.1em;
    line-height: 1.8;
    text-align: left;
}

.result-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

/* 多牌阵结果卡片适配 */
.result-container .result-card {
    flex: 0 0 auto;
    min-width: 180px;
}

/* 6张牌以上时的紧凑布局 */
.result-container.compact .result-card {
    min-width: 150px;
}

.result-container.compact .card-image {
    width: 150px;
}

.result-container.compact .card-info {
    max-width: 150px;
}

/* 凯尔特十字和生命之树特殊布局 */
.result-container.celtic-layout {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto 50px;
}

.result-container.celtic-layout .result-card {
    min-width: auto;
}

.result-container.celtic-layout .card-image {
    width: 140px;
}

.result-container.celtic-layout .card-info {
    max-width: 140px;
}

.result-card {
    text-align: center;
    padding: 20px;
    background: rgba(42, 26, 74, 0.6);
    border-radius: 15px;
    border: 2px solid #9370db;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(147, 112, 219, 0.5);
}

.result-card h3 {
    color: #ffd700;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.card-canvas {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.card-image {
    width: 200px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    border: 3px solid #FFD700;
    transition: transform 0.3s ease;
}

.card-image:hover {
    transform: scale(1.05);
}

.card-info {
    max-width: 200px;
}

.card-name {
    color: #ffd700;
    font-size: 1.3em;
    margin-bottom: 10px;
}

.card-meaning {
    color: #c8b8e8;
    font-size: 0.95em;
    line-height: 1.6;
}

.result-actions {
    text-align: center;
}

/* 牌阵选择界面 */
#spread-select-screen {
    padding: 20px;
}

.spread-intro {
    text-align: center;
    margin-bottom: 50px;
}

.spread-intro h2 {
    font-size: 2.5em;
    color: #ffd700;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.spread-subtitle {
    font-size: 1.2em;
    color: #c8b8e8;
}

/* 牌阵网格 */
.spread-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 牌阵卡片 */
.spread-card {
    background: linear-gradient(145deg, rgba(42, 26, 74, 0.8), rgba(26, 13, 46, 0.9));
    border: 2px solid #9370db;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.spread-card::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%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spread-card:hover::before {
    opacity: 1;
}

.spread-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: #ffd700;
    box-shadow: 0 20px 50px rgba(255, 215, 0, 0.3),
                0 0 30px rgba(147, 112, 219, 0.5);
}

.spread-card.premium {
    border-color: #ffd700;
    background: linear-gradient(145deg, rgba(74, 42, 106, 0.9), rgba(42, 26, 74, 0.95));
}

.spread-card.premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 215, 0, 0.05) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.spread-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

.spread-card h3 {
    color: #ffd700;
    font-size: 1.5em;
    margin-bottom: 15px;
}

/* 牌阵预览 */
.spread-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    min-height: 80px;
    flex-wrap: wrap;
}

.mini-card {
    width: 35px;
    height: 50px;
    background-image: url('../images/8059ab61e97e3cb1383d456d291812e1.png');
    background-size: cover;
    background-position: center;
    border: 1px solid #ffd700;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.spread-card:hover .mini-card {
    animation: cardPulse 1s ease-in-out infinite;
}

@keyframes cardPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 特殊牌阵布局 */
.choice-preview {
    gap: 20px;
}

.choice-preview .mini-card {
    width: 40px;
    height: 55px;
}

.three-preview .mini-card:nth-child(1) { animation-delay: 0s; }
.three-preview .mini-card:nth-child(2) { animation-delay: 0.2s; }
.three-preview .mini-card:nth-child(3) { animation-delay: 0.4s; }

.elements-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 100px;
    margin: 20px auto;
    justify-content: center;
    justify-self: center;
}

.pentagram-preview {
    position: relative;
    width: 120px;
    height: 100px;
    margin: 20px auto;
    left: 50%;
    transform: translateX(-50%);
}

.pentagram-preview .mini-card {
    position: absolute;
}

.pentagram-preview .mini-card:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.pentagram-preview .mini-card:nth-child(2) { top: 35%; right: 0; }
.pentagram-preview .mini-card:nth-child(3) { bottom: 0; right: 15%; }
.pentagram-preview .mini-card:nth-child(4) { bottom: 0; left: 15%; }
.pentagram-preview .mini-card:nth-child(5) { top: 35%; left: 0; }

.relationship-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 140px;
    margin: 20px auto;
    justify-content: center;
    justify-self: center;
}

.celtic-preview, .tree-preview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-width: 200px;
    margin: 20px auto;
    justify-content: center;
    justify-self: center;
}

.celtic-preview .mini-card, .tree-preview .mini-card {
    width: 30px;
    height: 42px;
}

.spread-desc {
    color: #e0d4ff;
    font-size: 1.1em;
    margin-bottom: 8px;
    font-weight: 500;
}

.spread-detail {
    color: #a898c8;
    font-size: 0.9em;
    margin-bottom: 15px;
    min-height: 40px;
}

.spread-count {
    display: inline-block;
    background: linear-gradient(135deg, #6a0dad, #9b30ff);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
}

.premium-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #1a0a2e;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
}

/* 次要按钮 */
.secondary-btn {
    background: transparent;
    border: 2px solid #9370db;
    color: #c8b8e8;
    padding: 12px 40px;
    font-size: 1.1em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.secondary-btn:hover {
    background: rgba(147, 112, 219, 0.2);
    border-color: #ffd700;
    color: #ffd700;
    transform: translateY(-2px);
}

/* 牌阵名称显示 */
.spread-name-display {
    text-align: center;
    margin-bottom: 20px;
}

#spread-name {
    display: inline-block;
    background: linear-gradient(135deg, rgba(106, 13, 173, 0.3), rgba(155, 48, 255, 0.3));
    border: 1px solid #9370db;
    padding: 8px 25px;
    border-radius: 25px;
    color: #ffd700;
    font-size: 1.1em;
}

/* ==================== 响应式设计 ==================== */

/* 平板设备 */
@media (max-width: 1024px) {
    .spread-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }
    
    .result-container.celtic-layout {
        grid-template-columns: repeat(5, 1fr);
        gap: 15px;
    }
}

/* 移动设备 - 通用 */
@media (max-width: 768px) {
    /* 全局 */
    .container {
        padding: 15px;
    }
    
    /* 标题 */
    header {
        padding: 20px 10px;
        margin-bottom: 20px;
    }
    
    .title {
        font-size: 1.8em;
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
    
    .subtitle {
        font-size: 0.95em;
    }
    
    /* 开始界面 */
    .intro {
        padding: 30px 15px;
    }
    
    .intro h2 {
        font-size: 1.6em;
    }
    
    .intro p {
        font-size: 1.1em;
        margin-bottom: 20px;
    }
    
    .question-input-container {
        margin-bottom: 30px;
    }
    
    .question-label {
        font-size: 1em;
        margin-bottom: 10px;
    }
    
    .question-input {
        padding: 12px 15px;
        font-size: 1em;
    }
    
    .card-preview {
        gap: 10px;
        margin-bottom: 30px;
        flex-wrap: wrap;
    }
    
    .preview-card {
        width: 70px;
        height: 110px;
    }
    
    /* 按钮 */
    .mystical-btn {
        padding: 12px 35px;
        font-size: 1.1em;
    }
    
    .secondary-btn {
        padding: 10px 30px;
        font-size: 1em;
    }
    
    /* 牌阵选择界面 */
    .spread-intro h2 {
        font-size: 1.8em;
    }
    
    .spread-subtitle {
        font-size: 1em;
        padding: 0 10px;
    }
    
    .spread-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px;
    }
    
    .spread-card {
        padding: 20px 15px;
    }
    
    .spread-icon {
        font-size: 2.5em;
    }
    
    .spread-card h3 {
        font-size: 1.3em;
    }
    
    .spread-desc {
        font-size: 1em;
    }
    
    .spread-detail {
        font-size: 0.85em;
        min-height: auto;
    }
    
    /* 牌阵预览适配 */
    .mini-card {
        width: 30px;
        height: 42px;
    }
    
    .choice-preview .mini-card {
        width: 35px;
        height: 48px;
    }
    
    .elements-preview {
        gap: 8px;
        max-width: 80px;
        justify-content: center;
        justify-self: center;
    }
    
    .pentagram-preview {
        width: 100px;
        height: 85px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .relationship-preview {
        gap: 6px;
        max-width: 110px;
        justify-content: center;
        justify-self: center;
    }
    
    .celtic-preview, .tree-preview {
        gap: 5px;
        max-width: 170px;
        justify-content: center;
        justify-self: center;
    }
    
    .celtic-preview .mini-card, .tree-preview .mini-card {
        width: 28px;
        height: 38px;
    }
    
    .premium-badge {
        top: 10px;
        right: 10px;
        padding: 3px 10px;
        font-size: 0.7em;
    }
    
    /* 抽牌界面 */
    #draw-screen {
        padding: 15px 10px;
    }
    
    #draw-screen h2 {
        font-size: 1.5em;
    }
    
    .instruction {
        font-size: 1em;
        margin-bottom: 20px;
        padding: 0 10px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
        gap: 8px;
        padding: 10px;
    }
    
    .tarot-card {
        width: 55px;
        height: 82px;
    }
    
    .tarot-card:hover:not(.selected):not(.disabled) {
        transform: translateY(-5px) scale(1.03);
    }
    
    /* 已选择的牌区域 */
    .selected-cards {
        padding: 20px 15px;
        margin: 0 5px;
    }
    
    .selected-cards h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .selected-slots {
        gap: 15px;
    }
    
    .slot-label {
        font-size: 0.9em;
        margin-bottom: 8px;
    }
    
    .slot-card {
        width: 70px;
        height: 105px;
    }
    
    .slot-card.filled::after {
        font-size: 1.8em;
    }
    
    /* 结果界面 */
    #result-screen {
        padding: 15px 10px;
    }
    
    #result-screen h2 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    .question-display {
        padding: 12px 20px;
        margin-bottom: 25px;
    }
    
    .question-icon {
        font-size: 1.2em;
    }
    
    #user-question {
        font-size: 1em;
    }
    
    .spread-name-display {
        margin-bottom: 15px;
    }
    
    #spread-name {
        padding: 6px 20px;
        font-size: 1em;
    }
    
    /* 结果卡片布局 */
    .result-container {
        gap: 20px;
        padding: 0 5px;
    }
    
    .result-container .result-card {
        min-width: 140px;
        padding: 15px 10px;
    }
    
    .result-container.compact .result-card {
        min-width: 120px;
    }
    
    .result-card h3 {
        font-size: 1.1em;
        margin-bottom: 12px;
    }
    
    .card-image {
        width: 130px;
        margin-bottom: 12px;
    }
    
    .result-container.compact .card-image {
        width: 110px;
    }
    
    .card-info {
        max-width: 140px;
    }
    
    .result-container.compact .card-info {
        max-width: 120px;
    }
    
    .card-name {
        font-size: 1.1em;
        margin-bottom: 8px;
    }
    
    .card-meaning {
        font-size: 0.85em;
        line-height: 1.5;
    }
    
    /* 凯尔特十字和生命之树布局 */
    .result-container.celtic-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .result-container.celtic-layout .card-image {
        width: 100px;
    }
    
    .result-container.celtic-layout .card-info {
        max-width: 100px;
    }
    
    /* 分析区域 */
    .analysis-section {
        margin: 25px 10px;
        padding: 20px 15px;
    }
    
    .analysis-section h3 {
        font-size: 1.4em;
        margin-bottom: 15px;
    }
    
    .analysis-text {
        font-size: 1em;
        line-height: 1.7;
    }
    
    /* 结果操作按钮 */
    .result-actions {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .result-actions .mystical-btn,
    .result-actions .secondary-btn {
        width: 100%;
        max-width: 280px;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    /* 标题 */
    .title {
        font-size: 1.5em;
    }
    
    .subtitle {
        font-size: 0.85em;
    }
    
    /* 开始界面 */
    .intro h2 {
        font-size: 1.4em;
    }
    
    .intro p {
        font-size: 1em;
    }
    
    .preview-card {
        width: 60px;
        height: 95px;
    }
    
    /* 牌阵选择 */
    .spread-intro h2 {
        font-size: 1.5em;
    }
    
    .spread-card {
        padding: 15px 12px;
    }
    
    .spread-icon {
        font-size: 2em;
        margin-bottom: 10px;
    }
    
    .spread-card h3 {
        font-size: 1.2em;
        margin-bottom: 10px;
    }
    
    .spread-preview {
        min-height: 60px;
        margin: 15px 0;
    }
    
    .mini-card {
        width: 26px;
        height: 36px;
    }
    
    .choice-preview .mini-card {
        width: 30px;
        height: 42px;
    }
    
    .pentagram-preview {
        width: 90px;
        height: 75px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .celtic-preview, .tree-preview {
        max-width: 150px;
        justify-content: center;
        justify-self: center;
    }
    
    .celtic-preview .mini-card, .tree-preview .mini-card {
        width: 24px;
        height: 34px;
    }
    
    .spread-count {
        padding: 4px 12px;
        font-size: 0.8em;
    }
    
    /* 抽牌界面 */
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
        gap: 6px;
    }
    
    .tarot-card {
        width: 48px;
        height: 72px;
    }
    
    /* 已选择的牌 */
    .slot-card {
        width: 60px;
        height: 90px;
    }
    
    .slot-label {
        font-size: 0.8em;
    }
    
    /* 结果界面 */
    #result-screen h2 {
        font-size: 1.5em;
    }
    
    .result-container .result-card {
        min-width: 120px;
        padding: 12px 8px;
    }
    
    .result-container.compact .result-card {
        min-width: 100px;
    }
    
    .card-image {
        width: 100px;
    }
    
    .result-container.compact .card-image {
        width: 90px;
    }
    
    .card-name {
        font-size: 1em;
    }
    
    .card-meaning {
        font-size: 0.8em;
    }
    
    /* 凯尔特十字布局 */
    .result-container.celtic-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .result-container.celtic-layout .card-image {
        width: 80px;
    }
    
    /* 分析区域 */
    .analysis-section {
        padding: 15px 12px;
    }
    
    .analysis-section h3 {
        font-size: 1.2em;
    }
    
    .analysis-text {
        font-size: 0.95em;
    }
    
    /* 按钮 */
    .mystical-btn {
        padding: 10px 25px;
        font-size: 1em;
    }
    
    .secondary-btn {
        padding: 8px 20px;
        font-size: 0.95em;
    }
}

/* 超小屏手机 */
@media (max-width: 360px) {
    .title {
        font-size: 1.3em;
    }
    
    .preview-card {
        width: 50px;
        height: 80px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
        gap: 5px;
    }
    
    .tarot-card {
        width: 42px;
        height: 63px;
    }
    
    .result-container .result-card {
        min-width: 100px;
    }
    
    .card-image {
        width: 85px;
    }
    
    .result-container.celtic-layout .card-image {
        width: 70px;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .title {
        font-size: 1.5em;
    }
    
    .intro {
        padding: 15px;
    }
    
    .card-preview {
        margin-bottom: 15px;
    }
    
    .preview-card {
        width: 55px;
        height: 85px;
    }
    
    .spread-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .selected-cards {
        padding: 15px;
    }
    
    .selected-slots {
        gap: 10px;
    }
    
    .slot-card {
        width: 55px;
        height: 82px;
    }
    
    .result-container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .result-container.celtic-layout {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 触控设备优化 */
@media (hover: none) and (pointer: coarse) {
    .tarot-card:hover:not(.selected):not(.disabled) {
        transform: none;
    }
    
    .tarot-card:active:not(.selected):not(.disabled) {
        transform: translateY(-5px) scale(1.03);
        border-color: #ffd700;
        box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
    }
    
    .spread-card:hover {
        transform: none;
    }
    
    .spread-card:active {
        transform: translateY(-5px) scale(0.98);
        border-color: #ffd700;
    }
    
    .result-card:hover {
        transform: none;
    }
    
    .result-card:active {
        transform: translateY(-5px);
    }
    
    .mystical-btn:hover {
        transform: none;
    }
    
    .mystical-btn:active {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(154, 48, 255, 0.6);
    }
}

/* 高分辨率手机 */
@media (min-width: 769px) and (max-width: 1024px) {
    .spread-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-container.celtic-layout {
        grid-template-columns: repeat(5, 1fr);
    }
}
