/* 专注花园 - 样式文件 */
/* 设计理念：简洁、清新、专注 */
:root {
    --primary-color: #4CAF50;
    --primary-dark: #45a049;
    --danger-color: #f44336;
    --danger-dark: #e53935;
    --bg-color: #f4f7f6;
    --text-color: #333;
    --light-gray: #e0e6ed;
    --medium-gray: #cdd6e0;
    --dark-gray: #666;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-hover: 0 6px 8px rgba(0,0,0,0.15);
    --card-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
    --primary-color: #4CAF50;
    --primary-dark: #45a049;
    --danger-color: #f44336;
    --danger-dark: #e53935;
    --bg-color: #f4f7f6;
    --text-color: #333;
    --light-gray: #e0e6ed;
    --medium-gray: #cdd6e0;
    --dark-gray: #666;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-hover: 0 6px 8px rgba(0,0,0,0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 20px;
    overflow-x: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
}

.header span {
    cursor: pointer;
    transition: opacity 0.2s;
}

.header span:hover {
    opacity: 0.8;
}

.timer {
    font-size: 4.5rem;
    font-weight: bold;
    margin: 20px 0 15px;
    color: #2c3e50;
    font-variant-numeric: tabular-nums;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plant-area {
    font-size: 5.5rem;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0 20px;
    transition: transform 0.3s;
}

#goal-area {
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
    text-align: center;
}

#goal-text {
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: var(--light-gray);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

#progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.5s ease-out;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-top: 5px;
}

.controls {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    padding: 0 10px;
}

button {
    border: none;
    padding: 10px 14px;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    background-color: var(--light-gray);
    color: var(--text-color);
    transition: all 0.2s;
    min-height: 44px; /* 触摸友好的最小高度 */
}

button:hover {
    background-color: var(--medium-gray);
    transform: translateY(-2px);
}

button.active {
    background-color: var(--primary-color);
    color: white;
}

.action-btn {
    background-color: var(--primary-color);
    color: white;
    font-size: 1.2rem;
    padding: 15px 40px;
    border-radius: 25px;
    margin-top: 10px;
    font-weight: bold;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.action-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.action-btn.danger {
    background-color: var(--danger-color);
}

.action-btn.danger:hover {
    background-color: var(--danger-dark);
}

.message {
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--dark-gray);
    min-height: 24px;
    text-align: center;
    max-width: 80%;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    max-width: 300px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: slideUp 0.4s;
    overflow-y: auto;
    max-height: 90vh;
    width: 100%;
    box-sizing: border-box;
}

.modal-content h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-content p {
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-content button {
    background: var(--primary-color);
    color: white;
    margin-top: 20px;
    width: 100%;
    font-size: 1.1rem;
    padding: 12px;
}

/* 植物选择区域 */
.plant-option {
    font-size: 2.5rem;
    cursor: pointer;
    padding: 10px;
    border: 2px solid var(--light-gray);
    border-radius: 10px;
    transition: all 0.2s;
}

.plant-option:hover {
    transform: scale(1.1);
    border-color: var(--primary-color) !important;
}

.plant-btn {
    font-size: 2rem;
    cursor: pointer;
    padding: 8px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    background: white;
    transition: all 0.2s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plant-btn:hover, .plant-btn.active {
    border-color: var(--primary-color);
    background: #f0f9f0;
    transform: scale(1.1);
}

.category-btn {
    padding: 8px 12px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-btn:hover, .category-btn.active {
    border-color: var(--primary-color);
    background: #f0f9f0;
    color: var(--primary-color);
}

/* 番茄计数按钮 */
.pomodoro-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.pomodoro-controls button {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#pomodoro-count {
    font-size: 1.8rem;
    font-weight: bold;
    min-width: 30px;
}

/* 图鉴样式 */
#gallery-plants {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    min-height: 100px;
}

.gallery-plant {
    font-size: 3rem;
    padding: 15px;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    background: #f0f9f0;
    animation: fadeIn 0.5s;
    transition: all 0.3s;
}

.gallery-plant:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-hover);
    background: #e0f7e0;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 1s infinite;
}



/* 响应式设计 */

/* 平板设备 (768px 以下) */
@media (max-width: 768px) {
    .timer {
        font-size: 4.5rem;
        min-height: 100px;
    }
    
    .plant-area {
        font-size: 5.5rem;
        min-height: 130px;
    }
    
    .modal-content {
        max-width: 90%;
        max-height: 85vh;
        padding: 20px;
        margin: 10px;
    }
    
    .header {
        padding: 15px;
        font-size: 1.1rem;
    }
    
    .controls {
        gap: 5px;
    }
    
    .pomodoro-controls button {
        width: 38px;
        height: 38px;
        font-size: 1.3rem;
    }
    
    #pomodoro-count {
        font-size: 1.6rem;
    }
    
    .goal-text {
        font-size: 1.1rem;
        padding: 0 10px;
    }
}

/* 手机设备 (480px 以下) */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    .timer {
        font-size: 3.8rem;
        min-height: 90px;
        margin: 15px 0;
    }
    
    .plant-area {
        font-size: 4.8rem;
        min-height: 110px;
        margin: 8px 0 15px;
    }
    
    .modal-content {
        max-width: 95%;
        padding: 15px;
        margin: 5px;
    }
    
    .header {
        padding: 12px;
        font-size: 1rem;
        max-width: 100%;
    }
    
    .controls {
        gap: 4px;
        margin-bottom: 15px;
    }
    
    button {
        padding: 9px 12px;
        font-size: 0.9rem;
        min-height: 42px;
    }
    
    .action-btn {
        padding: 12px 30px;
        font-size: 1.1rem;
        border-radius: 20px;
    }
    
    .plant-btn {
        font-size: 1.7rem;
        width: 42px;
        height: 42px;
    }
    
    .category-btn {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
    
    .pomodoro-controls button {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    
    #pomodoro-count {
        font-size: 1.4rem;
    }
    
    .goal-text {
        font-size: 1rem;
    }
    
    .progress-bar-container {
        height: 18px;
    }
    
    .progress-text {
        font-size: 0.85rem;
    }
    

}

/* 小屏幕手机 (360px 以下) */
@media (max-width: 360px) {
    body {
        padding: 10px;
    }
    
    .timer {
        font-size: 3.5rem;
        min-height: 80px;
    }
    
    .plant-area {
        font-size: 4.2rem;
        min-height: 100px;
    }
    
    .modal-content {
        padding: 12px;
        margin: 5px;
    }
    
    .header {
        padding: 10px;
        font-size: 0.95rem;
    }
    
    button {
        padding: 8px 10px;
        font-size: 0.85rem;
        min-height: 40px;
    }
    
    .action-btn {
        padding: 10px 25px;
        font-size: 1rem;
    }
    
    .plant-btn {
        font-size: 1.5rem;
        width: 38px;
        height: 38px;
    }
    
    .category-btn {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
    
    .pomodoro-controls button {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    #pomodoro-count {
        font-size: 1.3rem;
    }
    
    .goal-text {
        font-size: 0.95rem;
    }
    

}

/* 大屏幕适配 (1200px 以上) */
@media (min-width: 1200px) {
    .header {
        max-width: 500px;
    }
    
    #goal-area {
        max-width: 500px;
    }
    
    .controls {
        max-width: 500px;
    }
}