/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    min-height: 100vh;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* 太阳资源计数器 */
#sun-counter {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: all 0.3s ease;
}

#sun-counter.hidden {
    opacity: 0;
    pointer-events: none;
}

.sun-icon {
    font-size: 20px;
}

/* 屏幕基础样式 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

/* 背景图片 */
.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.background-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 内容区域 */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    text-align: center;
}

/* 开始界面样式 */
#screen-1 .content h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    font-weight: 700;
}

/* 按钮样式 */
.primary-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: 'Noto Sans SC', sans-serif;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

/* 故事文本 */
.story-text {
    max-width: 800px;
    margin-bottom: 2rem;
    line-height: 1.8;
    font-size: 1.1rem;
}

.story-text p {
    margin-bottom: 1rem;
}

/* 继续提示 */
.continue-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    opacity: 0.8;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

/* NPC区域 */
.npc-section {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.npc-image img {
    width: 150px;
    height: 150px;
    border-radius: 15px;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    object-fit: contain;
    background: white;
}

.npc-title {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 卡牌容器 */
.cards-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
}

/* 卡牌样式 */
.card {
    background: white;
    border-radius: 15px;
    padding: 15px;
    width: 240px;
    min-height: 280px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

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

.card.selected {
    border: 3px solid #ff6b6b;
    transform: translateY(-5px);
}

.card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.card.disabled:hover {
    transform: none;
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
    flex-shrink: 0;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-cost {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* 游戏区域布局 */
.game-area {
    display: flex;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    margin-top: 2rem;
}

.cards-section, .npcs-section {
    flex: 1;
}

.cards-section h3, .npcs-section h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    font-weight: 600;
}

/* NPC卡牌 */
.npcs-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.npc-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
    pointer-events: none;
}

.npc-card.available {
    opacity: 1;
    pointer-events: all;
}

.npc-card.available:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.npc-card.selected {
    border: 3px solid #ff6b6b;
    transform: translateY(-3px);
}

.npc-card img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: contain;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.npc-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.npc-position {
    font-size: 0.8rem;
    color: #666;
}

/* 对话框 */
.dialogue-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    max-width: 800px;
    margin: 2rem auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.dialogue-text {
    color: #333;
    line-height: 1.8;
    font-size: 1.1rem;
    text-align: left;
}

/* 结果界面 */
.result-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.result-text {
    color: #333;
    font-size: 1.3rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content {
        padding: 20px;
    }
    
    #screen-1 .content h1 {
        font-size: 2rem;
    }
    
    .game-area {
        flex-direction: column;
        gap: 20px;
    }
    
    .cards-container {
        gap: 15px;
    }
    
    .card {
        width: 160px;
    }
    
    .npcs-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .npc-card {
        padding: 10px;
    }
    
    .npc-card img {
        width: 60px;
        height: 60px;
    }
    
    #sun-counter {
        top: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .cards-container {
        flex-direction: column;
        align-items: center;
    }
    
    .card {
        width: 280px;
    }
    
    .npcs-container {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-up {
    animation: slideUp 0.3s ease;
}

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

/* 加载状态 */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}
