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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f4f8;
    color: #333;
    line-height: 1.6;
    overflow-y: auto;
    max-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    overflow-y: auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.2;
}

.chinese-title {
    font-size: 3.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-bottom: 5px;
}

header p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

main {
    flex: 1;
}

.task-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.task-display {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.task-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

#task-text {
    font-size: 1.6rem;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1.5;
    text-align: center;
}

.grounding-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.grounding-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.grounding-btn:active {
    transform: scale(0.95);
}

.grounding-btn.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    animation: pulse 1s infinite;
}

.button-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

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

.next-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.end-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.end-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.mood-rating {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.mood-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #3498db;
    background-color: white;
    color: #3498db;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mood-btn:hover {
    background-color: #3498db;
    color: white;
    transform: scale(1.1);
}

.modal-content p {
    margin-top: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.history-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.history-container h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
    border-radius: 6px;
    background-color: #f8f9fa;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item .time {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.history-item .task {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.history-item .duration {
    font-size: 0.8rem;
    color: #95a5a6;
}

.empty-history {
    text-align: center;
    color: #95a5a6;
    padding: 30px 0;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .chinese-title {
        font-size: 2.8rem;
    }
    
    .task-container {
        padding: 30px 20px;
    }
    
    .task-display {
        min-height: 120px;
        padding: 20px;
    }
    
    #task-text {
        font-size: 1.3rem;
    }
    
    .grounding-btn {
        width: 180px;
        height: 180px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .grounding-btn {
        width: 150px;
        height: 150px;
        font-size: 1rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .chinese-title {
        font-size: 2.4rem;
    }
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    max-height: 400px;
    overflow: hidden;
}

.chart-container h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

#mood-chart {
    width: 100%;
    aspect-ratio: 5/3;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e0e0e0;
    padding: 12px 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.footer p {
    margin: 0;
    line-height: 1.4;
}

/* 为容器添加底部padding，避免内容被footer遮挡 */
.container {
    padding-bottom: 80px;
}