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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    min-height: 100vh;
    color: #333;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* 登录页面 */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo i {
    font-size: 60px;
    color: #ff6b6b;
    margin-bottom: 10px;
}

.logo h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 300;
}

#loginForm {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
}

.input-group i {
    color: #6c757d;
    margin-right: 10px;
}

.input-group input {
    border: none;
    background: none;
    flex: 1;
    font-size: 16px;
    outline: none;
}

#sendCode {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.login-btn {
    width: 100%;
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
}

/* 主应用 */
.header {
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#logoutBtn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 18px;
    cursor: pointer;
}

.main-content {
    padding: 80px 20px 80px;
    max-width: 800px;
    margin: 0 auto;
}

.content-page {
    display: none;
}

.content-page.active {
    display: block;
}

/* 首页 */
.dashboard-header {
    text-align: center;
    margin-bottom: 30px;
}

.dashboard-header h2 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.date {
    color: #6c757d;
    font-size: 14px;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-card i {
    font-size: 24px;
    color: #ff6b6b;
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
}

.alerts {
    margin-bottom: 30px;
}

.alert {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.alert.danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.action-btn {
    background: white;
    border: none;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn i {
    font-size: 24px;
    color: #ff6b6b;
    margin-bottom: 10px;
    display: block;
}

/* 记录页面 */
.form-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #ff6b6b;
}

.bp-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bp-inputs input {
    flex: 1;
}

.bp-inputs span {
    font-weight: bold;
    color: #6c757d;
}

input[type="range"] {
    width: 100%;
    margin: 10px 0;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
}

/* 趋势页面 */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.trend-summary {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* AI聊天页面 */
.chat-header {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.chat-tabs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.chat-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.message.user {
    flex-direction: row-reverse;
}

.message-content {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 70%;
}

.message.user .message-content {
    background: #ff6b6b;
    color: white;
}

.chat-input {
    display: flex;
    padding: 20px;
    border-top: 1px solid #e9ecef;
    gap: 10px;
}

#messageInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    outline: none;
}

#sendMessage {
    background: #ff6b6b;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
}

/* 康复计划页面 */
.plan-summary {
    margin-bottom: 30px;
}

.plan-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.plan-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-card h3 i {
    color: #ff6b6b;
}

.plan-progress {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.progress-item span {
    min-width: 80px;
    font-weight: 500;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
    transition: width 0.3s ease;
}

.mark-done {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
}

.mark-done:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.doctor-feedback {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.feedback-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #ff6b6b;
    font-style: italic;
    color: #6c757d;
}

.nutrition-plan, .exercise-plan {
    line-height: 1.6;
}

.plan-item {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.alert-adaptive {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    color: #0066cc;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-adaptive i {
    color: #0066cc;
}

/* 每日教育模块 */
.daily-education {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.daily-education h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.daily-education h3 i {
    color: #ff6b6b;
}

.education-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #ff6b6b;
}

.education-content {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #2c3e50;
}

.read-more {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* 智能提醒模块 */
.smart-reminders {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.smart-reminders h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.smart-reminders h3 i {
    color: #ffa726;
}

.reminder-item {
    background: #fff3e0;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid #ffa726;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reminder-item i {
    color: #ffa726;
}

.reminder-item.urgent {
    background: #ffebee;
    border-left-color: #f44336;
}

.reminder-item.urgent i {
    color: #f44336;
}

/* 检查报告页面 */
.upload-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.upload-area {
    border: 2px dashed #ddd;
    padding: 40px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #ff6b6b;
    background: #fafafa;
}

.upload-area i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 10px;
    display: block;
}

.upload-area:hover i {
    color: #ff6b6b;
}

.manual-input {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.reports-history {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.report-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-date {
    font-weight: bold;
    color: #2c3e50;
}

.report-type {
    color: #6c757d;
    font-size: 14px;
}

.view-report {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
}

.ai-interpretation {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.interpretation-content {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #2196f3;
    line-height: 1.6;
}

/* 医生问诊模块 */
.doctor-chat {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.doctor-chat .chat-header {
    background: #ff6b6b;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.doctor-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.doctor-input {
    display: flex;
    padding: 20px;
    border-top: 1px solid #eee;
    gap: 10px;
}

.doctor-input input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    outline: none;
}

.doctor-input button {
    background: #ff6b6b;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
}

/* 积分系统 */
.points-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    text-align: center;
}

.points-display {
    margin: 15px 0;
}

.points-value {
    font-size: 36px;
    font-weight: bold;
}

.points-label {
    font-size: 18px;
    margin-left: 5px;
}

.points-tasks {
    margin-top: 20px;
}

.task-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

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

.task-points {
    color: #ffd700;
    font-weight: bold;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-actions {
    margin-top: 20px;
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #ff6b6b;
    color: white;
}

#voiceBtn {
    background: #28a745;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    margin-right: 10px;
}

#voiceBtn.recording {
    background: #dc3545;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 个人资料页面 */
.profile-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.profile-item {
    margin-bottom: 20px;
}

.save-btn {
    width: 100%;
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.3s;
}

.nav-item.active {
    color: #ff6b6b;
}

.nav-item i {
    display: block;
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 80px 15px 80px;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .progress-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .progress-item span {
        min-width: auto;
        text-align: center;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}
