/* AI生活模拟器 - 样式文件 */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --background: #0f0f1a;
    --surface: #1a1a2e;
    --surface-light: #252542;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: #3f3f5a;
    --gradient-start: #6366f1;
    --gradient-end: #8b5cf6;
    --shadow-lg: 0 25px 50px -12px rgba(99, 102, 241, 0.25);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* 背景动画 */
.app-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(245, 158, 11, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* 启动画面 */
.start-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.8s ease-out;
}

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

.logo-container {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 20px 30px rgba(99, 102, 241, 0.4));
}

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

.logo-container h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.start-btn-container {
    margin-bottom: 3rem;
}

.start-btn {
    position: relative;
    padding: 1.25rem 3.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.3);
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(99, 102, 241, 0.5);
}

.start-btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    animation: pulse 2s ease-in-out infinite;
}

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

.features {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.feature:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.2rem;
}

/* 游戏主界面 */
.game-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.game-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.progress-bar {
    height: 3px;
    background: var(--surface);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 0 2px 2px 0;
}

.header-content {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.episode-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.stats {
    display: flex;
    gap: 1rem;
}

.stat {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
}

/* 剧情容器 */
.story-container {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.narrative {
    animation: slideUp 0.5s ease-out;
}

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

.narrative-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
}

.narrative-highlight {
    color: var(--secondary);
    font-weight: 500;
}

/* 对话区域 */
.dialogue-section {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    animation: slideUp 0.5s ease-out;
}

.dialogue-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.npc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
}

.npc-info {
    display: flex;
    flex-direction: column;
}

.npc-name {
    font-weight: 600;
    color: var(--text-primary);
}

.npc-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dialogue-content {
    padding: 1rem;
    background: var(--surface-light);
    border-radius: var(--radius-md);
    min-height: 60px;
}

.dialogue-text {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    animation: typeIn 0.5s ease-out;
}

@keyframes typeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 选项区域 */
.choices-section {
    padding: 1.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.choice-btn {
    padding: 1rem 1.25rem;
    font-size: 1rem;
    text-align: left;
    color: var(--text-primary);
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.choice-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.choice-btn:hover {
    border-color: var(--primary);
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.choice-btn:hover::before {
    left: 100%;
}

.choice-btn:active {
    transform: translateX(5px) scale(0.98);
}

.choice-icon {
    margin-right: 0.75rem;
    opacity: 0.7;
}

/* 成就弹窗 */
.achievement-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    padding: 1rem;
}

.achievement-content {
    background: linear-gradient(135deg, var(--surface), var(--surface-light));
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 2px solid var(--secondary);
    box-shadow: 0 0 60px rgba(245, 158, 11, 0.3);
    animation: popIn 0.5s ease;
    max-width: 350px;
    width: 100%;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.achievement-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 0.6s ease;
}

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

.achievement-text h3 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.achievement-text p {
    color: var(--text-secondary);
}

/* 结局画面 */
.ending-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.ending-content {
    text-align: center;
    max-width: 450px;
    width: 100%;
    animation: slideUp 0.8s ease-out;
}

.ending-rating {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.3rem;
}

.ending-title {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.ending-desc {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.ending-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.ending-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
}

.ending-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.share-btn, .replay-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.share-btn {
    background: linear-gradient(135deg, #07c160, #06ad56);
    color: white;
    border: none;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(7, 193, 96, 0.3);
}

.replay-btn {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--primary);
}

.replay-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

/* 工具类 */
.hidden {
    display: none !important;
}

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

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* 响应式 */
@media (max-width: 480px) {
    .logo-container h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .start-btn {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
    }
    
    .features {
        gap: 1rem;
    }
    
    .feature {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .header-content {
        padding: 0.75rem 1rem;
    }
    
    .episode-title {
        font-size: 1rem;
    }
    
    .story-container {
        padding: 1rem;
    }
    
    .choices-section {
        padding: 1rem;
    }
    
    .choice-btn {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .ending-stats {
        gap: 1rem;
    }
    
    .ending-title {
        font-size: 1.75rem;
    }
}

/* 动画延迟类 */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ============ 场景选择器 ============ */
.scenario-cards {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 700px;
    animation: fadeIn 0.6s ease-out;
}

.scenario-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 280px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.scenario-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.scenario-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.scenario-card:hover::before {
    opacity: 1;
}

.office-card:hover {
    border-color: #10b981;
    box-shadow: 0 25px 50px -12px rgba(16, 185, 129, 0.25);
}

.office-card::before {
    background: linear-gradient(90deg, #10b981, #06b6d4);
}

.scenario-icon {
    font-size: 3.5rem;
    animation: float 3s ease-in-out infinite;
}

.office-card .scenario-icon {
    animation-delay: -1.5s;
}

.scenario-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.scenario-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.scenario-tags {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tag {
    padding: 0.2rem 0.6rem;
    background: var(--surface-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.new-tag {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    color: white;
    font-weight: 600;
}

.scenario-play-btn {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.office-card .scenario-play-btn {
    background: linear-gradient(135deg, #10b981, #06b6d4);
}

.scenario-card:hover .scenario-play-btn {
    transform: scale(1.05);
}

/* ============ 职场主题色 ============ */
.theme-office {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --gradient-start: #10b981;
    --gradient-end: #06b6d4;
    --shadow-lg: 0 25px 50px -12px rgba(16, 185, 129, 0.25);
}

.theme-office .progress-fill {
    background: linear-gradient(90deg, #10b981, #06b6d4);
}

.theme-office .narrative-text {
    border-left-color: #10b981;
}

.theme-office .choice-btn:hover {
    border-color: #10b981;
}

.theme-office .choice-btn::before {
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
}

/* ============ 技能面板 ============ */
.skill-panel {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-icon {
    font-size: 1rem;
}

.skill-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 28px;
}

.skill-bar {
    width: 60px;
    height: 6px;
    background: var(--surface-light);
    border-radius: 3px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.skill-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-light);
    min-width: 14px;
    text-align: center;
}

/* ============ 返回主页按钮 ============ */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.back-home-btn {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.back-home-btn:hover {
    border-color: var(--primary);
    transform: scale(1.1);
}

/* ============ 场景卡片动画 ============ */
.scenario-cards.visible .scenario-card:nth-child(1) {
    animation: slideUp 0.5s ease-out 0.1s both;
}

.scenario-cards.visible .scenario-card:nth-child(2) {
    animation: slideUp 0.5s ease-out 0.2s both;
}

/* ============ 响应式场景卡片 ============ */
@media (max-width: 640px) {
    .scenario-cards {
        flex-direction: column;
        align-items: center;
    }

    .scenario-card {
        width: 100%;
        max-width: 320px;
    }

    .skill-panel {
        gap: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .skill-bar {
        width: 45px;
    }
}
