/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a6cf7;
    --primary-hover: #3b5ce4;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

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

/* 头部样式 */
.app-header {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

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

.app-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.streak-info {
    color: var(--text-secondary);
    font-size: 14px;
}

.streak-info span {
    color: var(--primary-color);
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--light-bg);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* 统计卡片区域 */
.stats-section {
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: default;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a7bf7 100%);
    color: var(--white);
}

.stat-card.primary .stat-label {
    color: rgba(255,255,255,0.8);
}

.stat-card.primary .stat-value {
    color: var(--white);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-icon {
    font-size: 28px;
    margin-top: 4px;
}

/* 学习计划区域 */
.plan-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-actions {
    display: flex;
    gap: 12px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #218838;
}

/* 周历样式 */
.calendar-bar {
    background: var(--light-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.nav-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

.calendar-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.week-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.day-item {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.day-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.day-item.active {
    background: var(--primary-color);
    color: var(--white);
}

.day-item.active .day-tasks {
    background: rgba(255,255,255,0.2);
    color: var(--white);
}

.day-name {
    font-size: 12px;
    margin-bottom: 4px;
    opacity: 0.8;
}

.day-date {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.day-tasks {
    font-size: 11px;
    background: var(--light-bg);
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
    color: var(--text-secondary);
}

/* 计划列表 */
.plan-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.plan-list-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.plan-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.plan-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 计划项样式 */
.plan-item {
    display: flex;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background: var(--white);
}

.plan-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.plan-item.completed {
    opacity: 0.7;
}

.plan-item.completed .plan-content {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.plan-item.rejected .plan-content {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.plan-sidebar {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    color: var(--white);
    font-size: 12px;
}

.plan-sidebar.chinese { background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%); }
.plan-sidebar.math { background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%); }
.plan-sidebar.english { background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%); }
.plan-sidebar.science { background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%); }
.plan-sidebar.other { background: linear-gradient(135deg, #607d8b 0%, #455a64 100%); }

.subject-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.plan-content {
    flex: 1;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.plan-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.plan-title-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.plan-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.plan-badge.daily {
    background: rgba(74, 108, 247, 0.1);
    color: var(--primary-color);
}

.plan-badge.once {
    background: rgba(108, 117, 125, 0.1);
    color: var(--text-secondary);
}

.plan-badge.status-completed {
    background: var(--success-color);
    color: var(--white);
}

.plan-badge.status-rejected {
    background: var(--danger-color);
    color: var(--white);
}

.plan-badge.status-adjusted {
    background: var(--info-color);
    color: var(--white);
}

.plan-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.plan-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.plan-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.plan-score {
    color: var(--warning-color);
    font-weight: 600;
}

.plan-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    justify-content: center;
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.action-btn.complete {
    background: var(--primary-color);
    color: var(--white);
}

.action-btn.complete:hover {
    background: var(--primary-hover);
}

.action-btn.timer {
    background: var(--success-color);
    color: var(--white);
}

.action-btn.timer:hover {
    background: #218838;
}

.action-btn.quick {
    background: var(--info-color);
    color: var(--white);
}

.action-btn.quick:hover {
    background: #138496;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    margin-bottom: 24px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

.chart-modal-content {
    max-width: 700px;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--light-bg);
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--danger-color);
    color: var(--white);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* 图表模态框 */
.chart-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.chart-tab {
    padding: 10px 20px;
    border: none;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.chart-tab.active {
    background: var(--primary-color);
    color: var(--white);
}

.chart-container {
    height: 300px;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

#stats-chart {
    max-width: 100%;
    max-height: 100%;
}

.chart-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.summary-item {
    background: var(--light-bg);
    padding: 16px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.summary-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

/* 响应式设计 */

/* 大屏幕桌面 (>= 1200px) */
@media (min-width: 1200px) {
    .app-container {
        max-width: 1400px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

/* 平板和桌面 (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 平板和手机 (< 768px) */
@media (max-width: 768px) {
    .app-container {
        padding: 12px;
    }

    .header-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .app-title {
        font-size: 22px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .week-view {
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
    }

    .day-item {
        padding: 8px 4px;
    }

    .day-name {
        font-size: 10px;
    }

    .day-date {
        font-size: 12px;
    }

    .plan-item {
        flex-direction: column;
    }

    .plan-sidebar {
        width: 100%;
        flex-direction: row;
        padding: 12px;
        gap: 8px;
    }

    .plan-actions {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .plan-list-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .chart-summary {
        grid-template-columns: 1fr;
    }
    
    /* 设置模态框响应式 */
    .settings-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .settings-tabs {
        flex-wrap: wrap;
    }
    
    .settings-tab {
        flex: 1 1 45%;
        font-size: 13px;
        padding: 10px 12px;
    }
    
    /* 图表模态框响应式 */
    .chart-modal-content {
        width: 95%;
    }
    
    .daily-tasks-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
    }
    
    .daily-task-item {
        padding: 8px 4px;
    }
    
    .daily-task-count {
        font-size: 16px;
    }
    
    .subject-pie-container {
        flex-direction: column;
    }
    
    .subject-legend {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* 手机 (< 480px) */
@media (max-width: 480px) {
    .app-container {
        padding: 8px;
    }
    
    .app-header {
        padding: 16px;
        border-radius: var(--radius-md);
    }
    
    .app-title {
        font-size: 18px;
    }
    
    .streak-info {
        font-size: 12px;
    }
    
    .header-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .user-profile {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 8px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px 8px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-icon {
        font-size: 22px;
    }
    
    .plan-section {
        padding: 16px;
        border-radius: var(--radius-md);
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .section-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .section-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .calendar-bar {
        padding: 12px;
    }
    
    .calendar-label {
        font-size: 14px;
    }
    
    .week-view {
        gap: 2px;
    }
    
    .day-item {
        padding: 6px 2px;
    }
    
    .day-name {
        font-size: 9px;
    }
    
    .day-date {
        font-size: 11px;
    }
    
    .day-tasks {
        font-size: 9px;
    }
    
    .plan-list-title {
        font-size: 14px;
    }
    
    .plan-filters {
        flex-wrap: wrap;
    }
    
    .filter-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .plan-sidebar {
        padding: 8px;
        font-size: 11px;
    }
    
    .subject-icon {
        font-size: 18px;
    }
    
    .plan-content {
        padding: 12px;
    }
    
    .plan-title-text {
        font-size: 14px;
    }
    
    .plan-desc {
        font-size: 12px;
    }
    
    .plan-meta {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 11px;
    }
    
    .plan-actions {
        padding: 8px;
        gap: 6px;
    }
    
    .action-btn {
        padding: 6px 10px;
        font-size: 11px;
        flex: 1;
        justify-content: center;
    }
    
    /* 模态框响应式 */
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 12px 16px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 12px 16px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    /* 登录模态框 */
    .login-modal-content {
        width: 95%;
    }
    
    /* 设置模态框 */
    .settings-tabs {
        gap: 4px;
    }
    
    .settings-tab {
        flex: 1 1 100%;
        font-size: 12px;
        padding: 8px 10px;
    }
    
    /* 用户管理 */
    .user-item {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
    }
    
    .user-actions {
        width: 100%;
        justify-content: center;
    }
    
    .user-actions .btn {
        flex: 1;
    }
    
    /* 图表 */
    .chart-section {
        padding: 12px;
    }
    
    .chart-section-title {
        font-size: 14px;
    }
    
    .daily-tasks-grid {
        gap: 4px;
    }
    
    .daily-task-day {
        font-size: 10px;
    }
    
    .daily-task-count {
        font-size: 14px;
    }
    
    .daily-task-label {
        font-size: 9px;
    }
    
    .legend-item {
        font-size: 11px;
    }
    
    /* 按钮大小调整 */
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .user-name {
        font-size: 13px;
    }
}

/* 番茄钟计时器响应式 */
@media (max-width: 480px) {
    .pomodoro-container {
        padding: 20px;
        width: 95%;
    }
    
    .pomodoro-circle {
        width: 200px;
        height: 200px;
    }
    
    .pomodoro-time {
        font-size: 36px;
    }
    
    .pomodoro-options-inside {
        gap: 4px;
    }
    
    .time-option-inside {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    .pomodoro-task {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .pomodoro-controls {
        flex-direction: column;
    }
    
    .pomodoro-btn {
        width: 100%;
        justify-content: center;
    }
    
    .pomodoro-btn.primary {
        order: -1;
    }
}

/* iPad 等平板设备 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .plan-item {
        flex-wrap: wrap;
    }
    
    .plan-sidebar {
        width: 60px;
    }
    
    .plan-actions {
        flex-direction: row;
        width: 100%;
        justify-content: flex-end;
    }
}

/* 横屏手机 */
@media (max-height: 500px) and (orientation: landscape) {
    .pomodoro-circle {
        width: 160px;
        height: 160px;
    }
    
    .pomodoro-time {
        font-size: 32px;
    }
    
    .pomodoro-container {
        padding: 15px 30px;
    }
    
    .pomodoro-header {
        margin-bottom: 10px;
    }
    
    .pomodoro-task {
        margin-bottom: 10px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .action-btn,
    .filter-btn,
    .nav-btn,
    .icon-btn,
    .day-item,
    .stat-card.clickable,
    .time-option-inside {
        min-height: 44px;
        min-width: 44px;
    }
    
    .plan-item:hover {
        transform: none;
    }
    
    .stat-card:hover {
        transform: none;
    }
}

/* 高分辨率屏幕 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
    }
    
    .app-container {
        max-width: 100%;
    }
    
    .plan-section,
    .app-header,
    .stat-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .plan-actions,
    .header-right,
    .modal {
        display: none;
    }
}

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

.plan-item {
    animation: fadeIn 0.3s ease;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 登录模态框样式 */
.login-modal-content {
    max-width: 400px;
}

.login-error {
    color: var(--danger-color);
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
    display: none;
}

.login-error.show {
    display: block;
}

/* 设置模态框样式 */
.settings-modal-content {
    max-width: 500px;
}

.settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.settings-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.settings-tab.active {
    background: var(--primary-color);
    color: var(--white);
}

.settings-panel {
    padding: 10px 0;
}

.settings-panel .btn {
    width: 100%;
    margin-top: 10px;
}

/* 用户管理样式 */
.user-management-header {
    margin-bottom: 16px;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-item .user-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details .user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-actions {
    display: flex;
    gap: 8px;
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
}

/* 删除按钮样式 */
.action-btn.delete {
    background: var(--danger-color);
    color: var(--white);
}

.action-btn.delete:hover {
    background: #c82333;
}

/* 图表统计模态框新样式 */
.chart-modal-content {
    max-width: 860px;
    width: 95%;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    padding: 0;
}

.chart-modal-header {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 40%, #42a5f5 100%);
    padding: 24px 28px 20px;
    border-radius: 20px 20px 0 0;
}

.chart-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chart-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chart-back-btn:hover {
    background: rgba(255,255,255,0.35);
}

.chart-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.chart-modal-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

.chart-range-tabs {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 40%, #42a5f5 100%);
    padding: 0 28px 16px;
    display: flex;
    gap: 10px;
}

.chart-range-btn {
    padding: 7px 20px;
    border: 2px solid rgba(255,255,255,0.5);
    background: transparent;
    color: rgba(255,255,255,0.85);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-range-btn.active,
.chart-range-btn:hover {
    background: white;
    color: #1565c0;
    border-color: white;
}

.chart-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 24px;
    background: #f5f7fb;
}

/* 统计概览卡片行 */
.chart-stats-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.chart-stat-card {
    background: white;
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.chart-stat-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
}

.chart-stat-value {
    font-size: 20px;
    font-weight: 700;
}

.chart-stat-value.blue { color: #1976d2; }
.chart-stat-value.green { color: #43a047; }
.chart-stat-value.purple { color: #8e24aa; }
.chart-stat-value.orange { color: #e65100; }
.chart-stat-value.pink { color: #e91e63; }
.chart-stat-value.teal { color: #00897b; }

/* 图表卡片 */
.chart-card-section {
    background: white;
    border-radius: 14px;
    padding: 18px 20px 14px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.chart-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title-bar {
    display: inline-block;
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, #1976d2, #42a5f5);
    border-radius: 2px;
}

.chart-canvas-wrap {
    width: 100%;
    height: 220px;
    position: relative;
}

.chart-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-canvas-wrap.pie-wrap {
    height: 240px;
}

.chart-legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
    justify-content: center;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #555;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

/* 两列布局 */
.chart-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

/* 响应式 */
@media (max-width: 640px) {
    .chart-stats-row {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .chart-two-col {
        grid-template-columns: 1fr;
    }
    
    .chart-modal-header {
        padding: 16px 16px 14px;
    }
    
    .chart-range-tabs {
        padding: 0 16px 12px;
    }
    
    .chart-modal-body {
        padding: 14px 12px 16px;
    }
    
    .chart-card-section {
        padding: 14px 12px 10px;
    }
    
    .chart-canvas-wrap {
        height: 180px;
    }
}

@media (max-width: 400px) {
    .chart-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== 积分成就模态框样式 ===== */
.achievement-modal-content {
    max-width: 680px;
    width: 95%;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    padding: 0;
}

.achievement-modal-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 40%, #b45309 100%);
    padding: 24px 28px 20px;
    border-radius: 20px 20px 0 0;
}

.achievement-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.achievement-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.achievement-back-btn:hover {
    background: rgba(255,255,255,0.35);
}

.achievement-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.achievement-modal-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

.achievement-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 28px;
    background: #fafaf8;
}

/* 总览数据行 */
.achievement-overview {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 16px;
    padding: 20px 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.achievement-overview-item {
    flex: 1;
    text-align: center;
}

.achievement-overview-icon {
    font-size: 26px;
    margin-bottom: 6px;
}

.achievement-overview-value {
    font-size: 28px;
    font-weight: 700;
    color: #d97706;
    line-height: 1;
    margin-bottom: 4px;
}

.achievement-overview-label {
    font-size: 12px;
    color: #888;
}

.achievement-overview-divider {
    width: 1px;
    height: 48px;
    background: #e5e7eb;
    flex-shrink: 0;
}

/* 分区标题 */
.achievement-section {
    margin-bottom: 20px;
}

.achievement-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievement-title-bar {
    display: inline-block;
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, #f59e0b, #d97706);
    border-radius: 2px;
    flex-shrink: 0;
}

/* 任务列表 */
.achievement-task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.achievement-task-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    animation: achieveFadeIn 0.4s ease both;
}

@keyframes achieveFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.achievement-task-subject {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.achievement-task-info {
    flex: 1;
    min-width: 0;
}

.achievement-task-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.achievement-task-meta {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievement-task-time {
    display: flex;
    align-items: center;
    gap: 3px;
}

.achievement-trophy {
    font-size: 28px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(245,158,11,0.4));
    animation: trophyBounce 0.6s ease both;
}

@keyframes trophyBounce {
    0%   { transform: scale(0) rotate(-15deg); }
    60%  { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.achievement-empty {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
}

.achievement-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.achievement-empty-text {
    font-size: 14px;
}

/* 成就徽章 */
.achievement-badges {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.achievement-badge {
    background: white;
    border-radius: 14px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.achievement-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.achievement-badge.unlocked {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1.5px solid #fcd34d;
}

.achievement-badge.locked {
    opacity: 0.45;
    filter: grayscale(0.6);
}

.achievement-badge-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.achievement-badge-name {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.achievement-badge-desc {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.4;
}

.achievement-badge-unlocked-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #f59e0b;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
}

/* 响应式 */
@media (max-width: 640px) {
    .achievement-overview {
        padding: 14px 8px;
    }
    .achievement-overview-icon { font-size: 20px; }
    .achievement-overview-value { font-size: 22px; }
    .achievement-modal-body { padding: 14px 12px 20px; }
    .achievement-badges {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
}

/* ===== 出勤率/签到模态框样式 ===== */
.attendance-modal-content {
    max-width: 680px;
    width: 95%;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    padding: 0;
}

.attendance-modal-header {
    background: linear-gradient(135deg, #2e7d32 0%, #388e3c 40%, #66bb6a 100%);
    padding: 24px 28px 20px;
    border-radius: 20px 20px 0 0;
}

.attendance-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.attendance-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.attendance-back-btn:hover {
    background: rgba(255,255,255,0.35);
}

.attendance-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.attendance-modal-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

.attendance-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 28px;
    background: #f5faf5;
}

/* 签到卡片 */
.attendance-checkin-card {
    background: white;
    border-radius: 20px;
    padding: 28px 20px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(46,125,50,0.1);
    border: 2px solid #e8f5e9;
    transition: border-color 0.3s;
}

.attendance-checkin-card.checked {
    border-color: #66bb6a;
    background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e9 100%);
}

.attendance-checkin-icon {
    font-size: 52px;
    margin-bottom: 12px;
    display: block;
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

.attendance-checkin-icon.bounce {
    animation: checkinBounce 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes checkinBounce {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.4) rotate(-10deg); }
    70%  { transform: scale(0.9) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.attendance-checkin-status {
    font-size: 18px;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 6px;
}

.attendance-checkin-time {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
    min-height: 18px;
}

.attendance-checkin-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(46,125,50,0.35);
}

.attendance-checkin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46,125,50,0.45);
}

.attendance-checkin-btn:disabled {
    background: linear-gradient(135deg, #a5d6a7 0%, #c8e6c9 100%);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* 统计概览 */
.attendance-overview {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 16px;
    padding: 18px 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.attendance-overview-item {
    flex: 1;
    text-align: center;
}

.attendance-overview-icon {
    font-size: 22px;
    margin-bottom: 5px;
}

.attendance-overview-value {
    font-size: 24px;
    font-weight: 700;
    color: #2e7d32;
    line-height: 1;
    margin-bottom: 4px;
}

.attendance-overview-label {
    font-size: 11px;
    color: #888;
}

.attendance-overview-divider {
    width: 1px;
    height: 44px;
    background: #e5e7eb;
    flex-shrink: 0;
}

/* 分区 */
.attendance-section {
    margin-bottom: 20px;
}

.attendance-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.attendance-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.attendance-title-bar {
    display: inline-block;
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, #2e7d32, #66bb6a);
    border-radius: 2px;
    flex-shrink: 0;
}

.attendance-month-nav {
    display: flex;
    gap: 6px;
}

.att-nav-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #555;
}

.att-nav-btn:hover {
    background: #2e7d32;
    color: white;
    border-color: #2e7d32;
}

/* 签到日历 */
.attendance-calendar {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.att-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.att-weekday-label {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #aaa;
    padding: 4px 0;
}

.att-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.att-day-cell {
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    cursor: default;
    transition: transform 0.15s;
    position: relative;
}

.att-day-cell.empty {
    background: transparent;
}

.att-day-cell.future {
    color: #ccc;
    background: #fafafa;
}

.att-day-cell.missed {
    color: #bbb;
    background: #f5f5f5;
}

.att-day-cell.signed {
    background: linear-gradient(135deg, #2e7d32, #43a047);
    color: white;
    box-shadow: 0 2px 6px rgba(46,125,50,0.35);
    animation: signedPop 0.3s ease both;
}

@keyframes signedPop {
    from { transform: scale(0.7); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.att-day-cell.today {
    border: 2px solid #2e7d32;
    color: #2e7d32;
    font-weight: 700;
    background: #f1f8e9;
}

.att-day-cell.today.signed {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: white;
    border-color: #1b5e20;
}

/* 图例 */
.attendance-calendar-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

.att-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
}

.att-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.att-legend-dot.signed { background: linear-gradient(135deg, #2e7d32, #43a047); }
.att-legend-dot.missed { background: #f5f5f5; border: 1px solid #ddd; }
.att-legend-dot.today  { background: #f1f8e9; border: 2px solid #2e7d32; }
.att-legend-dot.future { background: #fafafa; border: 1px solid #eee; }

/* 签到活动列表 */
.attendance-activities {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.att-activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.att-activity-item:hover {
    transform: translateX(4px);
}

.att-activity-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.att-activity-info {
    flex: 1;
}

.att-activity-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 3px;
}

.att-activity-desc {
    font-size: 12px;
    color: #888;
}

.att-activity-streak {
    font-size: 13px;
    font-weight: 700;
    color: #2e7d32;
    white-space: nowrap;
}

/* 响应式 */
@media (max-width: 640px) {
    .attendance-overview { padding: 12px 6px; }
    .attendance-overview-icon { font-size: 18px; }
    .attendance-overview-value { font-size: 20px; }
    .attendance-modal-body { padding: 14px 12px 20px; }
    .att-day-cell { font-size: 11px; }
}

/* ===== AI 问答模态框样式 ===== */
.ai-chat-modal-content {
    max-width: 760px;
    width: 95%;
    max-height: 94vh;
    height: 94vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    padding: 0;
}

/* 头部 */
.ai-chat-header {
    background: linear-gradient(135deg, #4a1fa8 0%, #6d28d9 40%, #a78bfa 100%);
    padding: 18px 20px 16px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ai-chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-back-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.ai-chat-back-btn:hover { background: rgba(255,255,255,0.35); }

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.ai-chat-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin-bottom: 1px;
}

.ai-chat-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
}

.ai-chat-header-actions {
    display: flex;
    gap: 8px;
}

.ai-chat-action-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-chat-action-btn:hover { background: rgba(255,255,255,0.3); }

/* 科目快捷栏 */
.ai-subject-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f5ff;
    border-bottom: 1px solid #ede9fe;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}

.ai-subject-bar::-webkit-scrollbar { display: none; }

.ai-subject-chip {
    padding: 5px 14px;
    border: 1.5px solid #ddd6fe;
    background: white;
    color: #6d28d9;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-subject-chip:hover {
    background: #ede9fe;
    border-color: #a78bfa;
}

.ai-subject-chip.active {
    background: #6d28d9;
    color: white;
    border-color: #6d28d9;
}

/* 消息列表 */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ai-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: aiMsgIn 0.25s ease both;
}

@keyframes aiMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ai-msg-bot { flex-direction: row; }
.ai-msg-user { flex-direction: row-reverse; }

.ai-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6d28d9, #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(109,40,217,0.25);
}

.ai-msg-user .ai-msg-avatar {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    box-shadow: 0 2px 6px rgba(59,130,246,0.25);
}

.ai-msg-bubble {
    max-width: 75%;
}

.ai-msg-text {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.65;
    word-break: break-word;
    white-space: pre-wrap;
}

.ai-msg-bot .ai-msg-text {
    background: white;
    color: #1f2937;
    border-radius: 4px 16px 16px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.ai-msg-user .ai-msg-text {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    color: white;
    border-radius: 16px 4px 16px 16px;
    box-shadow: 0 2px 8px rgba(109,40,217,0.3);
}

.ai-msg-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 4px;
}

.ai-msg-user .ai-msg-time { text-align: right; }

/* 图片消息 */
.ai-msg-image {
    max-width: 220px;
    border-radius: 12px;
    margin-bottom: 6px;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ai-msg-image:hover { opacity: 0.9; }

/* 打字动画 */
.ai-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 4px 16px 16px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    width: fit-content;
}

.ai-typing-dot {
    width: 7px;
    height: 7px;
    background: #a78bfa;
    border-radius: 50%;
    animation: aiTyping 1.2s ease-in-out infinite;
}

.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* 图片预览区 */
.ai-image-preview {
    padding: 8px 16px 0;
    background: #f9fafb;
    flex-shrink: 0;
}

.ai-image-preview-inner {
    position: relative;
    display: inline-block;
}

.ai-image-preview-inner img {
    height: 72px;
    border-radius: 10px;
    border: 2px solid #ddd6fe;
    display: block;
}

.ai-image-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 输入区域 */
.ai-chat-input-area {
    padding: 10px 14px 12px;
    background: white;
    border-top: 1px solid #ede9fe;
    flex-shrink: 0;
}

.ai-chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #f5f3ff;
    border: 1.5px solid #ddd6fe;
    border-radius: 16px;
    padding: 8px 10px;
    transition: border-color 0.2s;
}

.ai-chat-input-row:focus-within {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

.ai-upload-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    flex-shrink: 0;
    user-select: none;
}

.ai-upload-btn:hover { background: #ede9fe; }

.ai-chat-textarea {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.5;
    color: #1f2937;
    padding: 2px 0;
}

.ai-chat-textarea::placeholder { color: #9ca3af; }

.ai-send-btn {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(109,40,217,0.35);
}

.ai-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(109,40,217,0.45);
}

.ai-send-btn:disabled {
    background: #c4b5fd;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.ai-chat-tips {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 6px;
    padding: 0 4px;
}

/* 错误消息 */
.ai-msg-error .ai-msg-text {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* 响应式 */
@media (max-width: 640px) {
    .ai-chat-modal-content {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        width: 100%;
    }
    .ai-chat-header { border-radius: 0; }
    .ai-msg-bubble { max-width: 85%; }
    .ai-msg-text { font-size: 13px; }
}

/* 旧图表样式（保留兼容） */
.chart-section {
    background: var(--light-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.chart-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.daily-tasks-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.daily-task-item {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
}

.daily-task-day { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.daily-task-count { font-size: 20px; font-weight: 700; color: var(--primary-color); }
.daily-task-count.completed { color: var(--success-color); }
.daily-task-label { font-size: 11px; color: var(--text-secondary); }

.subject-pie-container { display: flex; align-items: center; gap: 20px; }
.subject-legend { display: flex; flex-direction: column; gap: 8px; min-width: 150px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-color { width: 16px; height: 16px; border-radius: 4px; }
.legend-label { flex: 1; }
.legend-value { font-weight: 600; color: var(--text-primary); }
