/* 基础样式重置 */
* {
    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;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.header h1 i {
    margin-right: 0.5rem;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.nav-tab {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-tab.active {
    background: white;
    color: #4facfe;
    font-weight: 600;
}

/* 主内容区域 */
.main-content {
    padding: 1.5rem;
}

.tab-content {
    display: none;
}

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

/* 添加食物按钮 */
.add-food-section {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.add-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

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

.suggest-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.suggest-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

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

/* 时间轴容器 */
.timeline-container {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-in;
}

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

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.timeline-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    border-radius: 1px;
}

.timeline-header h2 {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    position: relative;
}

.timeline-header h2::before {
    content: '📅';
    margin-right: 8px;
    font-size: 1.1rem;
}

.timeline-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-info {
    color: #666;
    font-size: 0.9rem;
    background: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    border: 1px solid #e0e0e0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.filter-info:hover::before {
    left: 100%;
}

.filter-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.15);
}

.timeline-content {
    position: relative;
    padding-left: 2rem;
}

/* 时间轴主线 */
.timeline-content::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #4facfe, #00f2fe);
    border-radius: 1px;
}

.timeline-day {
    margin-bottom: 2rem;
    position: relative;
    opacity: 0;
    animation: slideInLeft 0.6s ease forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-day:nth-child(even) {
    animation-delay: 0.1s;
}

.timeline-day:nth-child(odd) {
    animation-delay: 0.2s;
}

.timeline-date {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
}

.timeline-date::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    width: 12px;
    height: 12px;
    background: #4facfe;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #4facfe;
    z-index: 2;
    transition: all 0.3s ease;
    cursor: pointer;
}

.timeline-date::before:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.3);
}

.date-text {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    margin-left: 0.5rem;
    transition: color 0.3s ease;
}

.timeline-day.today .date-text {
    color: #4facfe;
    text-shadow: 0 0 10px rgba(79, 172, 254, 0.3);
}

.date-weekday {
    color: #666;
    font-size: 0.85rem;
    margin-left: 0.5rem;
    transition: color 0.3s ease;
}

.timeline-day.today .date-weekday {
    color: #4facfe;
    font-weight: 600;
}

.timeline-meals {
    display: grid;
    gap: 0.8rem;
    margin-left: 0.5rem;
}

.meal-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    animation: slideInUp 0.5s ease forwards;
}

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

.meal-item:nth-child(1) { animation-delay: 0.1s; }
.meal-item:nth-child(2) { animation-delay: 0.2s; }
.meal-item:nth-child(3) { animation-delay: 0.3s; }
.meal-item:nth-child(4) { animation-delay: 0.4s; }
.meal-item:nth-child(5) { animation-delay: 0.5s; }

.meal-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px) scale(1.02);
    border-color: #4facfe;
}

.meal-info {
    flex: 1;
}

.meal-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.3rem;
}

.meal-time {
    color: #666;
    font-size: 0.85rem;
}

.meal-note {
    color: #888;
    font-size: 0.8rem;
    margin-top: 0.3rem;
    font-style: italic;
}

.meal-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.action-btn.delete:hover {
    color: #ff6b6b;
    background: #ffe0e0;
}

.action-btn.edit:hover {
    color: #007bff;
    background: #e3f2fd;
}

/* 统计页面 */
.stats-container h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-card h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
}

.stats-charts {
    display: grid;
    gap: 2rem;
}

.chart-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-section h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.time-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #e9ecef;
}

.filter-btn.active {
    background: #4facfe;
    color: white;
    border-color: #4facfe;
}

.ranking-list {
    display: grid;
    gap: 0.5rem;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ranking-item:hover {
    background: #e9ecef;
}

.ranking-rank {
    font-weight: bold;
    color: #4facfe;
    min-width: 2rem;
}

.ranking-name {
    flex: 1;
    margin-left: 1rem;
}

.ranking-count {
    font-weight: 600;
    color: #666;
}

/* 查看更多按钮 */
.ranking-more {
    text-align: center;
    padding: 20px;
}

.view-more-btn {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.view-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.view-more-btn i {
    margin-right: 8px;
}

/* 完整排行榜弹窗样式 */
.full-ranking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.full-ranking-modal.hide {
    opacity: 0;
    visibility: hidden;
}

.full-ranking-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.full-ranking-modal.show .full-ranking-content {
    transform: scale(1) translateY(0);
}

.full-ranking-modal.hide .full-ranking-content {
    transform: scale(0.9) translateY(20px);
}

.full-ranking-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 0;
}

.full-ranking-content .modal-header h3 {
    margin: 0;
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: rotate(90deg);
}

.close-btn:active {
    transform: rotate(90deg) scale(0.9);
}

.full-ranking-controls {
    padding: 12px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fafbfc;
}

.full-ranking-controls .period-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.full-ranking-controls .period-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.full-ranking-controls .period-btn:hover {
    border-color: #4facfe;
    background: rgba(79, 172, 254, 0.1);
}

.full-ranking-controls .period-btn.active {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    border-color: #4facfe;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.pagination-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.full-ranking-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    max-height: 60vh;
    scroll-behavior: smooth;
}

.full-ranking-list::-webkit-scrollbar {
    width: 6px;
}

.full-ranking-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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

.full-ranking-list .loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.full-ranking-list .loading i {
    font-size: 24px;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.load-more-container {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #eee;
    background: #fafbfc;
    border-radius: 0 0 16px 16px;
}

.load-more-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    font-weight: 500;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.load-more-btn:active {
    transform: translateY(-1px);
}

.load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 分页导航样式 */
.full-ranking-content .pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 0 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    flex-wrap: nowrap;
}

/* 分页信息显示 */
.pagination-info-bottom {
    text-align: center;
    margin: 10px 0 5px 0;
    font-size: 14px;
    color: #4facfe;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.pagination-info-bottom span {
    color: #4facfe;
    font-size: 14px;
    font-weight: 500;
}

.full-ranking-content .page-btn {
    background: rgba(79, 172, 254, 0.25);
    color: #e8f4fd;
    border: 1px solid rgba(79, 172, 254, 0.5);
    padding: 5px 10px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s ease;
    min-width: 34px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.full-ranking-content .page-btn:hover:not(:disabled) {
    background: rgba(79, 172, 254, 0.4);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.4);
    border-color: rgba(79, 172, 254, 0.7);
}

.full-ranking-content .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
}

.full-ranking-content .page-btn.active {
    background: linear-gradient(135deg, #3a8bfd 0%, #00d4ff 100%);
    border-color: #3a8bfd;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(58, 139, 253, 0.5);
}

.full-ranking-content .page-btn i {
    font-size: 12px;
    color: #4facfe;
    font-weight: 700;
}

.full-ranking-content .page-btn#prevPageBtn,
.full-ranking-content .page-btn#nextPageBtn {
    min-width: 75px;
    padding: 6px 10px;
    font-weight: 600;
    background: rgba(79, 172, 254, 0.3);
    border-color: rgba(79, 172, 254, 0.6);
}

.full-ranking-content .page-ellipsis {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    padding: 0 5px;
    font-weight: 600;
}

.full-ranking-content .pagination-pages {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* 加载更多按钮 - 已废弃，保留兼容性 */
.full-ranking-content .load-more-container {
    display: none;
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.full-ranking-content .load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.full-ranking-content .load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    .full-ranking-modal {
        padding: 0;
        background: rgba(0, 0, 0, 0.7);
    }
    
    .full-ranking-content {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        margin: 0;
        max-width: none;
        transform: translateY(100%);
    }
    
    .full-ranking-modal.show .full-ranking-content {
        transform: translateY(0);
    }
    
    .full-ranking-modal.hide .full-ranking-content {
        transform: translateY(100%);
    }
    
    .full-ranking-content .modal-header {
        padding: 16px 20px;
        border-radius: 0;
    }
    
    .full-ranking-content .modal-header h3 {
        font-size: 18px;
    }
    
    .close-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .pagination-info-bottom {
        padding: 6px 0 8px;
        font-size: 13px;
    }
    
    .pagination-info-bottom span {
        font-size: 13px;
    }
    
    .full-ranking-list {
        max-height: calc(100vh - 200px);
    }
    
    .ranking-item {
        padding: 12px 20px;
    }
    
    .ranking-rank {
        font-size: 16px;
        width: 35px;
    }
    
    .ranking-name {
        font-size: 15px;
    }
    
    .ranking-count {
        font-size: 13px;
    }
    
    .full-ranking-content .pagination-container {
        padding: 8px 16px 6px;
        gap: 3px;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .full-ranking-content .page-btn {
        padding: 4px 7px;
        font-size: 12px;
        min-width: 28px;
        border-radius: 12px;
        background: rgba(79, 172, 254, 0.3);
        border-color: rgba(79, 172, 254, 0.6);
    }
    
    .full-ranking-content .page-btn i {
        font-size: 11px;
        color: #4facfe;
        font-weight: 700;
    }
    
    .full-ranking-content .page-btn#prevPageBtn,
    .full-ranking-content .page-btn#nextPageBtn {
        min-width: 50px;
        font-size: 12px;
        padding: 5px 6px;
    }
}

/* 小屏幕优化 */
@media (max-width: 480px) {
    .pagination-info-bottom {
        padding: 5px 0 6px;
        font-size: 12px;
    }
    
    .pagination-info-bottom span {
        font-size: 12px;
    }
    
    .full-ranking-content .pagination-container {
        gap: 3px;
        padding: 8px 12px 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .full-ranking-content .page-btn {
        padding: 4px 6px;
        font-size: 11px;
        min-width: 26px;
        border-radius: 12px;
    }
    
    .full-ranking-content .page-btn i {
        font-size: 10px;
        color: #4facfe;
        font-weight: 700;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }
    
    .full-ranking-content .page-btn#prevPageBtn,
    .full-ranking-content .page-btn#nextPageBtn {
        min-width: 45px;
        font-size: 11px;
        padding: 4px 5px;
    }
    
    .load-more-btn,
    .view-more-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* 横屏模式优化 */
@media (max-height: 600px) and (orientation: landscape) {
    .full-ranking-content {
        max-height: 95vh;
        margin: 10px;
    }
    
    .full-ranking-list {
        max-height: 50vh;
    }
    
    .full-ranking-controls {
        padding: 8px 16px;
    }
    
    .full-ranking-content .modal-header {
        padding: 12px 16px;
    }
}

.frequency-chart {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    box-sizing: border-box;
    overflow: hidden;
}

.trend-chart {
    min-height: 300px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.trend-chart-svg {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

.chart-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-align: center;
}

.trend-point {
    cursor: pointer;
    transition: filter 0.2s ease;
}

.trend-point:hover,
.trend-point-hover {
    filter: drop-shadow(0 0 6px rgba(79, 172, 254, 0.6));
}

.trend-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tooltip-date {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.tooltip-count {
    color: #4facfe;
    font-weight: 500;
}

.trend-chart .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #999;
}

.trend-chart .empty-state i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* 趋势图表交互控制 */
.trend-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.trend-nav-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.trend-nav-btn:hover {
    background: #e9ecef;
}

.trend-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.trend-nav-btn:disabled:hover {
    background: #f8f9fa;
}

/* 趋势图表加载动画 */
.trend-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.trend-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chart-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .trend-chart {
        padding: 0.5rem;
        min-height: 250px;
    }
    
    .frequency-chart {
        padding: 0.5rem;
        min-height: 280px;
    }
    
    .trend-controls {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    
    .trend-nav-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .chart-title {
        font-size: 0.8rem;
    }
    
    .trend-tooltip {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .chart-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .trend-chart {
        padding: 0.25rem;
        min-height: 200px;
    }
    
    .frequency-chart {
        padding: 0.25rem;
        min-height: 220px;
    }
    
    .trend-controls {
        justify-content: space-between;
    }
    
    .trend-nav-btn {
        flex: 1;
        max-width: 80px;
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .trend-nav-btn i {
        display: none;
    }
    
    .chart-section h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
}

/* 图表动画效果 */
.trend-chart-svg {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* 优化数据点交互 */
.trend-point {
    transition: transform 0.2s ease, filter 0.2s ease;
    transform-origin: center;
}

.trend-point:hover {
    filter: drop-shadow(0 0 8px rgba(79, 172, 254, 0.8));
}

/* 网格线样式优化 */
.grid-lines line {
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.trend-chart:hover .grid-lines line {
    opacity: 0.6;
}

/* 进食时间段分布柱状图样式 */
.hourly-chart-svg {
    animation: fadeIn 0.5s ease-in-out;
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

.hourly-bar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.hourly-bar:hover {
    filter: drop-shadow(0 2px 8px rgba(79, 172, 254, 0.4));
    transform: translateY(-1px);
}

.hourly-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: none;
}

.hourly-tooltip div {
    margin: 0.1rem 0;
}

/* 频率图表容器样式更新 */
.frequency-chart {
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.frequency-chart .empty-state {
    text-align: center;
    color: #666;
}

.frequency-chart .empty-state i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.frequency-chart .chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

/* 响应式设计 - 进食时间段图表 */
@media (max-width: 768px) {
    .hourly-tooltip {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .frequency-chart .chart-title {
        font-size: 0.9rem;
    }
    
    .hourly-tooltip {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
}

/* 超小屏幕适配 */
@media (max-width: 360px) {
    .chart-section {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .chart-section h3 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .frequency-chart {
        padding: 0.125rem;
        min-height: 200px;
    }
    
    .trend-chart {
        padding: 0.125rem;
        min-height: 180px;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.8rem;
        min-height: 90px;
    }
    
    .stat-card h3 {
        font-size: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
}

/* 设置页面 */
.settings-container h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.setting-group {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.setting-group h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.setting-item:last-child {
    margin-bottom: 0;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4facfe;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.setting-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.setting-btn {
    background: #4facfe;
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-btn:hover {
    background: #3a8bfd;
    transform: translateY(-1px);
}

.setting-btn.danger {
    background: #ff6b6b;
}

.setting-btn.danger:hover {
    background: #ff5252;
}

/* 菜品库管理样式 */
.food-library-info {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.food-count-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: #495057;
}

.food-count {
    font-weight: bold;
    color: #007bff;
    font-size: 1.2rem;
}

/* 弹窗样式 */
.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);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.modal-header {
    background: #4facfe;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.2rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.input-with-time {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-time #foodSearch {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    padding-right: 3rem;
}

.input-with-time #foodSearch:focus {
    outline: none;
    border-color: #4facfe;
}

.time-picker-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: #4facfe;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 1;
}

.time-picker-btn:hover {
    background: #f0f8ff;
    transform: scale(1.1);
}

.time-picker-btn:active {
    transform: scale(0.9);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 10;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 1rem 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.4;
}

.search-result-item:hover {
    background: #f8f9fa;
    transform: translateX(2px);
}

.search-result-item.selected {
    background: #e3f2fd;
    border-left: 3px solid #007bff;
    padding-left: 0.7rem;
}

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

/* 搜索结果高亮样式 */
.search-result-item mark {
    background: linear-gradient(120deg, #a8e6cf 0%, #dcedc1 100%);
    color: #2d5016;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 预设菜品管理页面样式 */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.food-total {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.foods-container {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.foods-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-section {
    flex: 1;
    min-width: 300px;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-container i {
    position: absolute;
    left: 1rem;
    color: #6c757d;
    z-index: 1;
}

.search-input-container input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.search-input-container input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.action-section {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.action-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.action-btn.primary {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.action-btn.primary:hover {
    background: #0056b3;
    border-color: #004085;
}

.category-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.category-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.category-btn:hover {
    background: #e9ecef;
}

.category-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.foods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.food-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.food-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.food-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.food-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    flex: 1;
}

.food-actions {
    display: flex;
    gap: 0.3rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.food-item:hover .food-actions {
    opacity: 1;
}

.food-action-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.food-action-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.food-action-btn.delete:hover {
    color: #dc3545;
    background: #f8d7da;
}

.food-category {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.food-category.主食 { background: #fff3cd; color: #856404; }
.food-category.荤菜 { background: #f8d7da; color: #721c24; }
.food-category.素菜 { background: #d4edda; color: #155724; }
.food-category.汤品 { background: #cce5ff; color: #004085; }
.food-category.水果 { background: #ffe6cc; color: #8b4513; }
.food-category.零食 { background: #e2e3e5; color: #383d41; }
.food-category.饮料 { background: #d1ecf1; color: #0c5460; }

.food-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: #495057;
}

.empty-state p {
    margin: 0;
    font-size: 0.9rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .foods-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-section {
        min-width: auto;
    }
    
    .action-section {
        justify-content: center;
    }
    
    .category-filter {
        justify-content: center;
    }
    
    .foods-grid {
        grid-template-columns: 1fr;
    }
    
    .header-left h1 {
        font-size: 1.3rem;
    }
    
    .food-total {
        font-size: 0.8rem;
    }
}

.note-container {
    margin-top: 1rem;
}

.note-container label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

#foodNote {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

#foodNote:focus {
    outline: none;
    border-color: #4facfe;
}

.modal-footer {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-cancel, .btn-confirm {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
}

.btn-confirm {
    background: #4facfe;
    color: white;
}

.btn-confirm:hover {
    background: #3a8bfd;
}

.btn-confirm:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-confirm.danger {
    background: #ff6b6b;
}

.btn-confirm.danger:hover {
    background: #ff5252;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-container {
        margin: 0;
        min-height: 100vh;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .nav-tab {
        flex: 1;
        min-width: 80px;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .setting-buttons {
        flex-direction: column;
    }
    
    .setting-btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn-cancel, .btn-confirm {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .add-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
        min-height: 100px;
    }
    
    .stat-card h3 {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .time-filter {
        justify-content: center;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
    }
}

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

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

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

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

/* 加载更多按钮 */
.load-more-container {
    text-align: center;
    margin: 2rem 0;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

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

.load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.load-more-btn:hover::before {
    left: 100%;
}

.load-more-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.load-more-btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

.load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 加载状态 */
.loading-container {
    text-align: center;
    padding: 2rem;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.loading-container.show {
    display: flex;
}

.loading-container span {
    font-size: 0.9rem;
    animation: pulse-text 1.5s ease-in-out infinite;
}

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

/* 加载动画 */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 时间轴特殊状态 */
.timeline-day.today .timeline-date::before {
    background: #ff6b6b;
    box-shadow: 0 0 0 2px #ff6b6b;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 2px #ff6b6b, 0 0 0 4px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 0 0 2px #ff6b6b, 0 0 0 8px rgba(255, 107, 107, 0.1);
    }
    100% {
        box-shadow: 0 0 0 2px #ff6b6b, 0 0 0 4px rgba(255, 107, 107, 0.3);
    }
}

.timeline-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.timeline-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: #4facfe;
}

.timeline-empty h3 {
    margin: 0 0 0.5rem 0;
    color: #495057;
}

.timeline-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* 编辑弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.btn-cancel, .btn-confirm {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-cancel {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-cancel:hover {
    background: #e9ecef;
}

.btn-confirm {
    background: #007bff;
    color: white;
    border: 1px solid #007bff;
}

.btn-confirm:hover {
    background: #0056b3;
    border-color: #004085;
}

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

/* 时间输入框样式 */
.time-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.time-input-container i {
    position: absolute;
    left: 1rem;
    color: #6c757d;
    z-index: 1;
    pointer-events: none;
}

.time-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.time-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header, .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.8rem 1rem;
    }
}