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

:root {
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景图片 */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?w=1920&q=80');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.background-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(147, 51, 234, 0.3));
}

/* 玻璃拟态卡片 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 主容器 */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.6s ease-out;
}

/* 头部 */
.header-card {
    text-align: center;
    padding: 30px;
    margin-bottom: 30px;
    animation: slideDown 0.6s ease-out;
}

.header-card h1 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 主内容区 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

/* 日历部分 */
.calendar-section {
    padding: 25px;
    animation: slideLeft 0.6s ease-out 0.1s both;
}

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

.calendar-header h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

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

.calendar-grid .weekday {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 10px 0;
    font-size: 0.9rem;
}

.calendar-grid .day-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
}

.calendar-grid .day-cell:hover {
    background: rgba(255, 255, 255, 0.2);
}

.calendar-grid .day-cell.today {
    background: var(--blue-500);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.calendar-grid .day-cell.selected {
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid var(--blue-400);
}

.calendar-grid .day-cell.other-month {
    color: var(--text-muted);
}

.calendar-grid .day-cell .todo-dot {
    width: 6px;
    height: 6px;
    background: #fbbf24;
    border-radius: 50%;
    margin-top: 4px;
}

.today-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.today-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 右侧面板 */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: slideRight 0.6s ease-out 0.2s both;
}

.day-header-card {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.day-nav h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    min-width: 150px;
    text-align: center;
}

.add-btn {
    padding: 10px 20px;
    border: none;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

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

/* 待办列表 */
.todo-list-card {
    padding: 20px;
    flex: 1;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
}

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

.todo-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.todo-item.priority-high {
    border-left-color: #ef4444;
}

.todo-item.priority-medium {
    border-left-color: #f59e0b;
}

.todo-item.priority-low {
    border-left-color: #10b981;
}

.todo-item.completed {
    opacity: 0.6;
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
}

.todo-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.todo-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.todo-checkbox.checked {
    background: var(--blue-500);
    border-color: var(--blue-500);
}

.todo-checkbox.checked::after {
    content: '✓';
    color: white;
    font-weight: bold;
}

.todo-content-wrapper {
    flex: 1;
}

.todo-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.todo-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.todo-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.todo-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.todo-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.todo-action-btn {
    padding: 6px 12px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

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

.todo-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.3);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* 统计卡片 */
.stats-card {
    padding: 20px;
    display: flex;
    justify-content: space-around;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 700;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 30px;
    animation: modalIn 0.3s ease-out;
}

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

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.3s ease;
}

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

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

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue-400);
    background: rgba(255, 255, 255, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select option {
    background: #1e293b;
    color: white;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 25px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 徽章弹窗 */
.badge-modal {
    text-align: center;
    max-width: 400px;
}

.badge-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: bounce 0.6s ease-out;
}

.badge-modal h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.badge-modal p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 25px;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .calendar-section {
        order: 2;
    }
    
    .right-panel {
        order: 1;
    }
}

@media (max-width: 640px) {
    .app-container {
        padding: 15px;
    }
    
    .header-card h1 {
        font-size: 1.5rem;
    }
    
    .calendar-grid {
        gap: 4px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-card {
        flex-direction: column;
        gap: 15px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}