/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stats-bar {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    min-width: 120px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.25);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

/* 主内容区域 */
main {
    display: flex;
    gap: 25px;
    flex: 1;
    margin-bottom: 25px;
}

/* 侧边栏 */
.sidebar {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.sidebar-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #48bb78;
    color: white;
}

.btn-secondary:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #4a5568;
}

.btn-outline:hover {
    border-color: #667eea;
    color: #667eea;
}

.actions {
    display: flex;
    gap: 12px;
}

/* 内容区域 */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.content-header h2 {
    font-size: 1.5rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 记忆列表 */
.memories-list {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    max-height: 600px;
}

.memory-item {
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.memory-item:hover {
    border-color: #cbd5e0;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.memory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.memory-category {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.category-deep {
    background: #fed7d7;
    color: #c53030;
}

.category-daily {
    background: #bee3f8;
    color: #2b6cb0;
}

.category-diary {
    background: #c6f6d5;
    color: #276749;
}

.memory-date {
    color: #718096;
    font-size: 0.9rem;
}

.memory-content {
    margin-bottom: 15px;
    line-height: 1.7;
    color: #2d3748;
}

.memory-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.memory-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #edf2f7;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #4a5568;
}

.memory-actions {
    display: flex;
    gap: 10px;
}

.memory-actions button {
    padding: 6px 12px;
    font-size: 0.9rem;
    border-radius: 6px;
}

.mood-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-left: 10px;
}

.mood-happy {
    background: #fefcbf;
    color: #744210;
}

.mood-neutral {
    background: #e2e8f0;
    color: #4a5568;
}

.mood-sad {
    background: #fed7d7;
    color: #c53030;
}

.mood-excited {
    background: #fed7e2;
    color: #97266d;
}

.mood-thoughtful {
    background: #c6f6d5;
    color: #276749;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-size: 1.1rem;
}

.loading i {
    margin-right: 10px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 25px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

#page-info {
    font-weight: 600;
    color: #4a5568;
}

/* 日历视图 */
#calendar {
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    min-height: 200px;
}

.calendar-day {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    margin: 2px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-day.has-memory {
    background: #667eea;
    color: white;
}

.calendar-day:hover {
    background: #e2e8f0;
}

.calendar-day.has-memory:hover {
    background: #764ba2;
}

/* 模态框 */
.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;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    background: #f7fafc;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 20px;
    color: #718096;
    font-size: 0.9rem;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    main {
        flex-direction: column;
    }
    
    .sidebar {
        flex: none;
        width: 100%;
    }
    
    .stats-bar {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .stat-item {
        min-width: 100px;
        padding: 12px 20px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        width: 100%;
        max-width: 200px;
    }
    
    .memory-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .memory-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .memory-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
