/* 植物大战僵尸 - 全局样式 */

/* 基础样式重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* 主题配色 */
:root {
    --primary-green: #4CAF50;
    --secondary-green: #45a049;
    --dark-green: #2E7D32;
    --light-green: #C8E6C9;
    --zombie-brown: #8D6E63;
    --soil-brown: #5D4037;
    --sun-yellow: #FFD54F;
    --danger-red: #F44336;
    --text-dark: #333333;
    --text-light: #FFFFFF;
    --border-color: #CCCCCC;
}

/* 渐变背景 */
.bg-gradient-primary {
    background: linear-gradient(135deg, 
        var(--primary-green) 0%, 
        var(--dark-green) 50%, 
        var(--zombie-brown) 100%);
    min-height: 100vh;
}

.bg-gradient-game {
    background: linear-gradient(180deg, 
        #87CEEB 0%, 
        #98FB98 40%, 
        var(--soil-brown) 100%);
    min-height: 100vh;
}

/* 文字样式 */
.text-white-75 {
    color: rgba(255, 255, 255, 0.75);
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.5);
}

/* 按钮样式 */
.game-btn {
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-weight: 600;
    padding: 15px 20px;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.game-btn:active {
    transform: translateY(0);
}

/* 游戏界面布局 */
.game-container {
    max-width: 500px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 游戏画布 */
.game-canvas {
    width: 100%;
    max-width: 400px;
    height: auto;
    border: 3px solid var(--dark-green);
    border-radius: 10px;
    background: var(--light-green);
    display: block;
    margin: 0 auto;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 游戏UI组件 */
.sun-counter {
    background: linear-gradient(135deg, var(--sun-yellow), #FFA726);
    color: var(--text-dark);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.sun-counter:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.auto-collect-status {
    background: var(--primary-green);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.auto-collect-status.manual {
    background: var(--danger-red);
}

.game-status-info {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-item {
    background: rgba(51, 51, 51, 0.8);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.unlock-info {
    margin-top: 10px;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

.unlock-preview {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid var(--primary-green);
    border-radius: 8px;
    padding: 8px;
    margin: 5px 0;
    font-size: 0.8rem;
}

.unlock-preview .unlock-item {
    display: inline-block;
    margin: 2px 5px;
    padding: 2px 6px;
    background: var(--primary-green);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
}

.wave-indicator {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.level-title {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    color: white;
    padding: 10px 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 植物选择器 */
.plant-selector {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.plant-cards-container {
    overflow-x: auto;
    gap: 10px;
    padding: 5px 15px;
    min-height: 48px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-green) transparent;
}

.plant-cards-container::-webkit-scrollbar {
    height: 6px;
}

.plant-cards-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.plant-cards-container::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 3px;
}

.plant-cards-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-green);
}

.plant-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    flex-shrink: 0;
}

.plant-card:hover {
    border-color: var(--primary-green);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.plant-card.selected {
    border-color: var(--primary-green);
    background: var(--light-green);
}

.plant-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.plant-card.locked {
    opacity: 0.3;
    cursor: not-allowed;
    background: #e0e0e0;
    border-color: #999;
    position: relative;
}

.plant-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: #666;
}

.plant-card.new-unlock {
    animation: newUnlock 2s ease-in-out;
    border-color: #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
}

@keyframes newUnlock {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.plant-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

.plant-cost {
    color: var(--sun-yellow);
    font-weight: bold;
    font-size: 0.9rem;
}

/* 游戏网格 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 2px;
    background: var(--soil-brown);
    border: 3px solid var(--dark-green);
    border-radius: 10px;
    padding: 10px;
    aspect-ratio: 5 / 8;
    max-width: 400px;
    margin: 0 auto;
}

.grid-cell {
    background: linear-gradient(135deg, #8BC34A, #689F38);
    border: 1px solid var(--dark-green);
    border-radius: 5px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.grid-cell:hover {
    background: linear-gradient(135deg, #9CCC65, #7CB342);
    transform: scale(1.05);
}

.grid-cell.occupied {
    cursor: not-allowed;
}

/* 游戏实体 */
.plant, .zombie {
    position: absolute;
    font-size: 1.5rem;
    line-height: 1;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
    z-index: 10;
}

.projectile {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
    z-index: 5;
}

.sun-drop {
    position: absolute;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 15;
    animation: sunDrop 0.5s ease-out;
}

@keyframes sunDrop {
    from { 
        transform: translateY(-20px) scale(0);
        opacity: 0;
    }
    to { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* 游戏控制面板 */
.game-controls {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 15px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.control-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 5px;
}

.control-btn:hover {
    background: var(--secondary-green);
    transform: scale(1.05);
}

.control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 加载和模态框 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

/* 响应式设计 */
@media (max-width: 576px) {
    .game-container {
        margin: 10px;
        padding: 15px;
    }
    
    .plant-selector {
        padding: 6px;
        margin-bottom: 8px;
    }
    
    .plant-card {
        min-width: 60px;
        padding: 6px;
    }
    
    .plant-emoji {
        font-size: 1.3rem;
    }
    
    .plant-cost {
        font-size: 0.8rem;
    }
    
    .plant-cards-container {
        gap: 8px;
        min-height: 38px;
        padding: 4px 12px;
    }
    
    .sun-counter {
        font-size: 1rem;
        padding: 8px 15px;
    }
    
    .grid-cell {
        min-height: 35px;
    }
    
    .plant, .zombie {
        font-size: 1.2rem;
    }
}

@media (max-width: 400px) {
    .game-grid {
        max-width: 90vw;
    }
    
    .plant-selector {
        padding: 4px;
        margin-bottom: 6px;
    }
    
    .plant-card {
        min-width: 45px;
        padding: 4px;
    }
    
    .plant-emoji {
        font-size: 1.1rem;
    }
    
    .plant-cost {
        font-size: 0.7rem;
    }
    
    .plant-cards-container {
        gap: 6px;
        min-height: 33px;
        padding: 3px 10px;
    }
    
    .grid-cell {
        min-height: 30px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.pulse {
    animation: pulse 0.3s ease-in-out;
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* 工具提示 */
.tooltip-custom {
    position: relative;
    cursor: help;
}

.tooltip-custom::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip-custom:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .game-btn {
        border: 2px solid currentColor;
    }
    
    .grid-cell {
        border-width: 2px;
    }
}

/* 反馈展示区域 */
.feedback-display-area {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.latest-feedback-container {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.latest-feedback-container::-webkit-scrollbar {
    width: 6px;
}

.latest-feedback-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.latest-feedback-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.latest-feedback-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.feedback-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-green);
}

.feedback-item:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feedback-item:last-child {
    margin-bottom: 0;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.feedback-type {
    font-size: 1.1rem;
    font-weight: bold;
}

.feedback-date {
    font-size: 0.8rem;
    color: #666;
    opacity: 0.8;
}

.feedback-content {
    color: #333;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.no-feedback, .loading-feedback, .feedback-error {
    padding: 20px;
    text-align: center;
}

.feedback-error a {
    text-decoration: underline;
}

.feedback-error a:hover {
    opacity: 0.8;
}

/* 反馈模态框样式优化 */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-title {
    font-weight: bold;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

/* 响应式优化 */
@media (max-width: 576px) {
    .feedback-display-area {
        padding: 15px;
        margin: 0 10px;
    }
    
    .feedback-item {
        padding: 10px;
    }
    
    .feedback-content {
        font-size: 0.85rem;
    }
    
    .modal-dialog {
        margin: 10px;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
} 