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

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --text-primary: #eee;
    --text-secondary: #aaa;
    --accent-primary: #e94560;
    --accent-secondary: #00adb5;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --border-radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

/* 屏幕管理 */
.screen {
    display: none;
    width: 100vw;
    height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* 主界面 */
#main-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.game-title {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.main-buttons {
    display: flex;
    gap: 20px;
    flex-direction: column;
    align-items: center;
}

/* 按钮样式 */
.btn {
    padding: 12px 32px;
    font-size: 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: #ff6b6b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--accent-secondary);
}

.btn-secondary:hover {
    background: var(--accent-secondary);
}

.btn-option {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--accent-secondary);
    padding: 10px 20px;
    margin: 5px;
}

.btn-option:hover {
    background: var(--accent-secondary);
}

.btn-fate {
    background: linear-gradient(45deg, #9c27b0, #e91e63);
    color: white;
}

.btn-fate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.4);
}

.btn-fate:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 行业选择界面 */
#industry-screen {
    padding: 40px;
}

.screen-header {
    text-align: center;
    margin-bottom: 30px;
}

.screen-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

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

.industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    overflow-y: auto;
    flex: 1;
}

.industry-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.industry-card:hover {
    border-color: var(--accent-secondary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 173, 181, 0.2);
}

.industry-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--accent-secondary);
}

.industry-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.industry-stats {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
}

.industry-stat {
    background: var(--bg-secondary);
    padding: 5px 10px;
    border-radius: 4px;
}

.screen-footer {
    text-align: center;
    margin-top: 30px;
}

/* 游戏主界面 */
#game-screen {
    padding: 0;
}

.game-container {
    display: flex;
    height: 100vh;
}

.left-panel {
    flex: 0 0 65%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--bg-secondary);
}

.game-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.history-log {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.log-item {
    padding: 10px;
    margin-bottom: 10px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--accent-secondary);
}

.log-item.important {
    border-left-color: var(--accent-primary);
    background: rgba(233, 69, 96, 0.1);
}

.event-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border: 1px solid var(--accent-secondary);
}

.event-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--accent-secondary);
}

.event-content {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.event-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-area {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
}

/* 右侧面板 - 仪表盘 */
.right-panel {
    flex: 0 0 35%;
    background: var(--bg-primary);
    padding: 20px;
    overflow-y: auto;
    border-left: 1px solid var(--bg-card);
}

.dashboard h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--accent-secondary);
}

.dashboard-category {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    background: rgba(0, 173, 181, 0.1);
    transition: background 0.3s;
}

.category-header:hover {
    background: rgba(0, 173, 181, 0.2);
}

.category-icon {
    font-size: 1.2rem;
    margin-right: 10px;
}

.category-name {
    flex: 1;
    font-weight: 500;
}

.category-toggle {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.category-header.collapsed .category-toggle {
    transform: rotate(-90deg);
}

.category-content {
    padding: 15px;
    display: block;
}

.category-content.collapsed {
    display: none;
}

.metric {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.metric:last-child {
    margin-bottom: 0;
}

.metric-name {
    flex: 0 0 80px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.metric-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: var(--accent-secondary);
    transition: width 0.5s ease;
}

.metric-fill.cash {
    background: var(--success);
}

.metric-fill.warning {
    background: var(--warning);
}

.metric-fill.danger {
    background: var(--danger);
}

.metric-value {
    flex: 0 0 90px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    text-align: center;
}

.fate-cards {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.fate-card {
    width: 120px;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.fate-card:hover {
    transform: translateY(-10px) rotateY(10deg);
    border-color: #ffd700;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.fate-card.revealed {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.fate-card .card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.fate-card .card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0 10px;
}

/* 游戏结束界面 */
#summary-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.summary-content {
    max-width: 600px;
}

.summary-content h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--accent-secondary);
}

.summary-stats {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.summary-stat {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-secondary);
}

.summary-stat:last-child {
    border-bottom: none;
}

.summary-rating {
    font-size: 3rem;
    margin-bottom: 30px;
}

.rating-text {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.summary-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* 动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}

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

.log-item {
    animation: slideIn 0.3s ease;
}

/* 响应式 */
@media (max-width: 1024px) {
    .game-container {
        flex-direction: column;
    }
    
    .left-panel, .right-panel {
        flex: 1;
        width: 100%;
    }
    
    .right-panel {
        border-left: none;
        border-top: 1px solid var(--bg-card);
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .industry-grid {
        grid-template-columns: 1fr;
    }
    
    .fate-cards {
        flex-direction: column;
        align-items: center;
    }
}
