/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 - 刺桐红与金色 */
    --primary-red: #C41E3A;
    --primary-gold: #D4AF37;
    --accent-gold: #F4E4C1;
    
    /* 中性色 */
    --bg-dark: #1a1a1a;
    --bg-light: #f5f5f0;
    --text-dark: #2c2c2c;
    --text-light: #ffffff;
    --text-gray: #666666;
    
    /* 渐变 */
    --gradient-red: linear-gradient(135deg, #C41E3A 0%, #8B1538 100%);
    --gradient-gold: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    --gradient-bg: linear-gradient(180deg, #f5f5f0 0%, #e8e8dc 100%);
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    
    /* 字体 */
    --font-serif: 'Noto Serif SC', serif;
    --font-sans: 'Noto Sans SC', sans-serif;
}

body {
    font-family: var(--font-sans);
    background: var(--gradient-bg);
    color: var(--text-dark);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ==================== 开场动画 ==================== */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    background-image: url('../../assets/images/intro/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.intro-screen.active {
    opacity: 1;
    pointer-events: all;
}

.intro-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(196, 30, 58, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.intro-content {
    position: relative;
    text-align: center;
    z-index: 10;
}

.erythrina-flower {
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
    animation: flowerFloat 4s ease-in-out infinite;
    position: relative;
}

.erythrina-flower img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(196, 30, 58, 0.6));
}

@keyframes flowerFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0deg) scale(1); 
    }
    50% { 
        transform: translateY(-20px) rotate(5deg) scale(1.05); 
    }
}

.intro-screen .title {
    font-family: var(--font-serif);
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 1rem;
    letter-spacing: 0.5rem;
    text-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
    animation: titleFadeIn 1.5s ease-out;
}

@keyframes titleFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subtitle {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 3rem;
    letter-spacing: 0.3rem;
    animation: titleFadeIn 1.5s ease-out 0.3s both;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(212, 175, 55, 0.4);
    font-weight: 500;
}

.start-btn {
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-family: var(--font-serif);
    color: var(--text-light);
    background: var(--gradient-gold);
    border: 2px solid var(--primary-gold);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: titleFadeIn 1.5s ease-out 0.6s both;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.5);
    letter-spacing: 0.2rem;
}

/* ==================== 场景选择 ==================== */
.scene-select {
    min-height: 100vh;
    padding: 4rem 2rem;
    display: none;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.scene-select.active {
    display: block;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.scene-header {
    text-align: center;
    margin-bottom: 4rem;
}

.scene-header h2 {
    font-family: var(--font-serif);
    font-size: 3rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.scene-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-gold);
}

.scene-desc {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-top: 1.5rem;
}

.scene-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.scene-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    position: relative;
}

.scene-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-gold);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.scene-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.scene-card:hover::before {
    opacity: 0.1;
}

.scene-image {
    width: 100%;
    height: 240px;
    background-size: cover;
    background-position: center;
    position: relative;
    transition: transform 0.4s ease;
    border-radius: 16px 16px 0 0;
}

.scene-card:hover .scene-image {
    transform: scale(1.05);
}

/* 场景背景图片 - 使用精美的壁画卡片 */
.harbor-bg {
    background: url('../../assets/images/cards/harbor.jpg') center/cover no-repeat;
}

.ritual-bg {
    background: url('../../assets/images/cards/card_ritual.jpeg') center/cover no-repeat;
}

.heritage-bg {
    background: url('../../assets/images/cards/card_heritage.jpeg') center/cover no-repeat;
}

.scene-info {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
}

.scene-info h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.scene-info p {
    color: var(--text-gray);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.scene-tag {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: var(--accent-gold);
    color: var(--text-dark);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ==================== 游戏场景 ==================== */
.game-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none;
    opacity: 0;
}

.game-scene.active {
    display: block;
    animation: fadeIn 0.8s ease-out forwards;
}

.scene-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.scene-title-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.scene-title-bar h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--text-light);
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.back-btn {
    padding: 0.6rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-4px);
}

/* ==================== 对话框 ==================== */
.dialogue-box {
    position: absolute;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.2);
    z-index: 200;
    transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.dialogue-box.active {
    bottom: 0;
}

.dialogue-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 2px solid var(--accent-gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-gold);
}

.character-name {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.close-dialogue {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.close-dialogue:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.dialogue-content {
    padding: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.message {
    margin-bottom: 1rem;
    animation: messageSlideIn 0.4s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message p {
    padding: 1rem 1.2rem;
    border-radius: 12px;
    line-height: 1.6;
    font-size: 1rem;
}

.ai-message p {
    background: linear-gradient(135deg, #f5f5f0 0%, #e8e8dc 100%);
    color: var(--text-dark);
    border-left: 4px solid var(--primary-gold);
}

.user-message p {
    background: var(--gradient-red);
    color: var(--text-light);
    margin-left: auto;
    max-width: 80%;
}

.dialogue-input {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 0.8rem;
}

.dialogue-input input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
}

.dialogue-input input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.dialogue-input button {
    padding: 0.8rem 2rem;
    background: var(--gradient-gold);
    border: none;
    border-radius: 25px;
    color: var(--text-dark);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.dialogue-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.quick-questions {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.quick-btn {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 2px solid var(--accent-gold);
    border-radius: 20px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.quick-btn:hover {
    background: var(--accent-gold);
    transform: translateY(-2px);
}

/* ==================== 知识面板 ==================== */
.knowledge-panel {
    position: absolute;
    top: 100px;
    right: 2rem;
    z-index: 150;
}

.knowledge-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-gold);
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    font-size: 1.8rem;
    transition: all 0.3s ease;
    position: relative;
}

.knowledge-toggle:hover {
    transform: scale(1.1) rotate(10deg);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: var(--primary-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.knowledge-content {
    position: absolute;
    top: 70px;
    right: 0;
    width: 320px;
    max-height: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.knowledge-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.knowledge-content h3 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 0.5rem;
}

.knowledge-list {
    max-height: 300px;
    overflow-y: auto;
}

.knowledge-item {
    padding: 0.8rem;
    margin-bottom: 0.6rem;
    background: var(--gradient-bg);
    border-radius: 8px;
    border-left: 3px solid var(--primary-gold);
    animation: messageSlideIn 0.4s ease-out;
}

.knowledge-item h4 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    color: var(--text-dark);
}

.knowledge-item p {
    font-size: 0.85rem;
    color: var(--text-gray);
    line-height: 1.5;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .intro-screen .title {
        font-size: 2.5rem;
        letter-spacing: 0.3rem;
    }
    
    .subtitle {
        font-size: 1rem;
        letter-spacing: 0.2rem;
    }
    
    .scene-header h2 {
        font-size: 2rem;
    }
    
    .scene-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .dialogue-box {
        width: 100%;
        border-radius: 16px 16px 0 0;
    }
    
    .knowledge-panel {
        right: 1rem;
    }
    
    .knowledge-content {
        width: 280px;
    }
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red);
}
