/* EvoMaster - 进化模拟器 */

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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: #0f0f1a;
    color: #ffffff;
    overflow-x: hidden;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
.game-header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 12px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.game-header h1 {
    color: #4ecca3;
    font-size: 28px;
    margin-bottom: 10px;
}

.game-info {
    display: flex;
    gap: 30px;
    font-size: 16px;
}

.game-info strong {
    color: #4ecca3;
}

/* 主游戏区域 */
.game-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

section {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

section h2 {
    color: #4ecca3;
    margin-bottom: 15px;
    font-size: 20px;
}

/* 生物展示 */
.creature-display {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    background: #0f0f1a;
    border-radius: 8px;
    margin-bottom: 15px;
}

#creature-canvas {
    border-radius: 8px;
}

.creature-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 14px;
}

.creature-stats p {
    background: #16213e;
    padding: 8px 12px;
    border-radius: 6px;
}

.creature-stats strong {
    color: #4ecca3;
}

/* 控制面板 */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

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

.btn-primary {
    background: linear-gradient(135deg, #4ecca3, #2d8a6e);
    color: #ffffff;
}

.btn-success {
    background: linear-gradient(135deg, #5b7c99, #3d4a5a);
    color: #ffffff;
}

.btn-secondary {
    background: #3d4a5a;
    color: #ffffff;
}

.btn-disabled {
    background: #2a2a3a;
    color: #666;
    cursor: not-allowed;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-large {
    padding: 18px 36px;
    font-size: 20px;
}

/* 环境状态 */
.environment-panel {
    margin-bottom: 20px;
}

.environment-panel h3 {
    color: #4ecca3;
    margin-bottom: 10px;
    font-size: 16px;
}

.stat-bar {
    display: grid;
    grid-template-columns: 50px 1fr 50px;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.bar {
    background: #0f0f1a;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecca3, #2d8a6e);
    transition: width 0.3s;
}

/* 属性说明 */
.stat-meaning {
    background: #0f0f1a;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 15px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-meaning .positive {
    color: #4ecca3;
}

.stat-meaning .negative {
    color: #ff6b6b;
}

/* 基因列表 */
.genes-panel h3 {
    color: #4ecca3;
    margin-bottom: 10px;
    font-size: 16px;
}

.genes-list {
    max-height: 150px;
    overflow-y: auto;
    background: #0f0f1a;
    border-radius: 6px;
    padding: 10px;
}

.genes-list::-webkit-scrollbar {
    width: 8px;
}

.genes-list::-webkit-scrollbar-track {
    background: #0f0f1a;
}

.genes-list::-webkit-scrollbar-thumb {
    background: #4ecca3;
    border-radius: 4px;
}

.gene-item {
    background: #16213e;
    padding: 6px 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 14px;
    color: #4ecca3;
}

.no-genes {
    color: #666;
    font-size: 14px;
    text-align: center;
}

/* 基因效果面板 */
.gene-effects-panel h3 {
    color: #4ecca3;
    margin-bottom: 10px;
    font-size: 16px;
    margin-top: 15px;
}

.gene-effects-list {
    max-height: 120px;
    overflow-y: auto;
    background: #0f0f1a;
    border-radius: 6px;
    padding: 10px;
}

.effect-item {
    background: #16213e;
    padding: 6px 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 12px;
    color: #4ecca3;
    display: flex;
    justify-content: space-between;
}

.effect-name {
    color: #ffffff;
}

.effect-value {
    color: #4ecca3;
    font-weight: bold;
}

.no-effects {
    color: #666;
    font-size: 13px;
    text-align: center;
}

/* 进化面板 */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.panel-content {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.panel-content h2 {
    color: #4ecca3;
    margin-bottom: 10px;
    font-size: 24px;
}

.panel-subtitle {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 16px;
}

.panel-subtitle strong {
    color: #4ecca3;
    font-size: 20px;
}

.gene-categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.gene-category h3 {
    color: #4ecca3;
    margin-bottom: 10px;
    font-size: 16px;
}

.gene-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gene-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #16213e;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.gene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.gene-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gene-info strong {
    color: #ffffff;
    font-size: 14px;
}

.gene-cost {
    color: #ffd700;
    font-size: 12px;
}

/* 基因潜在意义说明 */
.gene-meaning {
    background: #0f0f1a;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 4px;
}

.meaning-positive {
    color: #4ecca3;
}

.meaning-negative {
    color: #ff6b6b;
}

.btn-gene-unlock {
    align-self: flex-end;
}

.panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 消息日志 */
.message-log {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.message-log h2 {
    color: #4ecca3;
    margin-bottom: 15px;
    font-size: 20px;
}

.message-list {
    max-height: 200px;
    overflow-y: auto;
    background: #0f0f1a;
    border-radius: 6px;
    padding: 10px;
}

.log-message {
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid #16213e;
}

.log-message:last-child {
    border-bottom: none;
}

/* 覆盖屏幕 */
.screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.screen-content {
    text-align: center;
    background: #1a1a2e;
    border-radius: 12px;
    padding: 50px;
    max-width: 600px;
}

.screen-content h1 {
    color: #4ecca3;
    font-size: 48px;
    margin-bottom: 10px;
}

.subtitle {
    color: #ffffff;
    font-size: 20px;
    margin-bottom: 30px;
}

.game-description {
    text-align: left;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #16213e;
}

.game-description h3 {
    color: #4ecca3;
    margin-bottom: 15px;
}

.game-description ul {
    list-style: none;
    padding-left: 0;
}

.game-description li {
    padding: 8px 0;
    color: #cccccc;
}

.game-description li:before {
    content: '✓ ';
    color: #4ecca3;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-main {
        grid-template-columns: 1fr;
    }
    
    .gene-categories {
        grid-template-columns: 1fr;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
}
