/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* 头部样式 */
header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 卡片样式 */
section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

section:hover {
    transform: translateY(-2px);
}

/* 上班状态区域 */
.work-section {
    text-align: center;
}

.work-status {
    margin-bottom: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: #ff4757;
    transition: background-color 0.3s ease;
}

.status-dot.working {
    background-color: #2ed573;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.working-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4CAF50;
    font-family: 'Courier New', monospace;
}

/* 按钮样式 */
.work-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 140px;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #757575, #616161);
    color: white;
}

.btn-water {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    font-size: 1.1rem;
    padding: 15px 30px;
}

.btn-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* 喝水统计区域 */
.water-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.water-action {
    text-align: center;
    margin-bottom: 25px;
}

/* 目标设置按钮 */
.target-setting-btn {
    text-align: center;
    margin-bottom: 20px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

.modal-header h3::before {
    content: "⚙️";
    margin-right: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

/* 目标设置表单 */
.target-setting-form {
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

.form-group .input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.target-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    max-width: 100px;
    text-align: center;
}

.target-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
    transform: translateY(-1px);
}

.input-unit {
    font-weight: 600;
    color: #666;
    font-size: 1.1rem;
}

.setting-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 10px;
    border-left: 4px solid #4CAF50;
}

.setting-info p {
    margin: 8px 0;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
}

.setting-info p::before {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* 最近记录 */
.recent-records h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.records-list {
    max-height: 200px;
    overflow-y: auto;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
    transition: background-color 0.3s ease;
}

.record-item:hover {
    background-color: #e3f2fd;
}

.record-time {
    font-weight: 600;
    color: #333;
}

.record-status {
    font-size: 0.9rem;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* 本周统计 */
.week-stats h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
}

.week-days {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
}

.week-day {
    text-align: center;
    padding: 15px 10px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.week-day:hover {
    background-color: #e3f2fd;
    transform: translateY(-2px);
}

.week-day-name {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

.week-day-count {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4CAF50;
}

.week-day.today {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.week-day.today .week-day-name,
.week-day.today .week-day-count {
    color: white;
}

/* 缺水提醒弹窗 */
.reminder-modal {
    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: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.reminder-modal.show {
    opacity: 1;
    visibility: visible;
}

.reminder-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.reminder-modal.show .reminder-content {
    transform: scale(1);
}

.reminder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.reminder-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.reminder-content p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.reminder-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 通知权限提示 */
.notification-prompt {
    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: 1001;
}

.prompt-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 450px;
    width: 90%;
}

.prompt-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.prompt-content h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #333;
}

.prompt-content p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.prompt-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 弹窗提示 */
.popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.popup.show {
    transform: translateX(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .work-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .water-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .reminder-actions,
    .prompt-actions {
        flex-direction: column;
    }
    
    .week-days {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .water-stats {
        grid-template-columns: 1fr;
    }
    
    .week-days {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reminder-content,
    .prompt-content {
        padding: 30px 20px;
    }
}

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

.records-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.records-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.records-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

section {
    animation: fadeIn 0.6s ease-out;
}

section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }