* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #1e1e1e;
    color: #e0e0e0;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #333;
}

header h1 {
    font-size: 24px;
    color: #fff;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.week-range {
    font-size: 14px;
    color: #aaa;
    min-width: 150px;
    text-align: center;
}

button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background-color: #3b82f6;
    color: white;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #2563eb;
}

button.secondary {
    background-color: #4b5563;
}

button.secondary:hover {
    background-color: #374151;
}

button.report-btn {
    background-color: #8b5cf6;
}

button.report-btn:hover {
    background-color: #7c3aed;
}

section {
    background: #252525;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

section h2 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #fff;
}

/* 添加任务表单 */
.add-task-section {
    background: #2a2a2a;
}

.add-task-section form {
    display: flex;
    gap: 8px;
}

.add-task-section input,
.add-task-section select {
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 13px;
    background-color: #333;
    color: #fff;
}

.add-task-section input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.add-task-section select {
    min-width: 100px;
}

/* 遗留任务区域 */
.history-section {
    background: #2d2d1e;
    border-left: 4px solid #f59e0b;
}

.history-section h2 {
    color: #f59e0b;
}

#history-tasks {
    padding-left: 10px;
}

.history-task {
    padding: 8px 0;
    border-bottom: 1px dashed #444;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.history-task:hover {
    background: rgba(255, 255, 255, 0.05);
}

.history-task:last-child {
    border-bottom: none;
}

.history-task .task-number {
    color: #f59e0b;
    font-weight: bold;
    min-width: 20px;
}

.history-task .task-title {
    color: #ccc;
    flex: 1;
}

.history-task .edit-input {
    flex: 1;
    background: #333;
    border: 1px solid #555;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

.history-task .task-actions {
    display: none;
}

.history-task:hover .task-actions {
    display: inline;
}

.history-task .task-actions button {
    padding: 2px 6px;
    font-size: 11px;
    margin-left: 4px;
    background: #555;
}

.history-task .task-actions button:hover {
    background: #666;
}

.history-task .task-actions button.danger {
    background: #ef4444;
}

.history-task.pending {
    opacity: 0.8;
}

.task-pending-badge {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

.history-add {
    margin-top: 10px;
    padding: 8px;
    text-align: center;
    color: #f59e0b;
    cursor: pointer;
    border: 1px dashed #444;
    border-radius: 4px;
    font-size: 13px;
    transition: background-color 0.2s;
}

.history-add:hover {
    background: rgba(245, 158, 11, 0.1);
}

/* 周视图网格 */
.week-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0;
    background: transparent;
}

.day-column {
    background: #252525;
    border-radius: 8px;
    padding: 12px;
    min-height: 150px;
}

.day-column h3 {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.day-column h3 .date {
    font-weight: normal;
    color: #666;
    font-size: 12px;
}

.day-column.today {
    background: #2a2a3a;
    border: 1px solid #3b82f6;
}

.day-column.today h3 {
    color: #3b82f6;
}

.tasks-container {
    min-height: 100px;
}

/* 任务项 */
.task-item {
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-item:hover {
    background: #333;
}

.task-item.completed {
    opacity: 0.5;
}

.task-item.completed .task-title {
    text-decoration: line-through;
}

.task-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.task-item .task-title {
    color: #e0e0e0;
    flex: 1;
}

.task-item .edit-input {
    flex: 1;
    background: #333;
    border: 1px solid #555;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

.task-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-right: 6px;
    font-weight: 500;
}

.task-tag.grammar {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
}

.task-tag.work {
    background: rgba(179, 214, 53, 0.2);
    color: #b3d635;
}

.task-tag.other {
    background: rgba(60, 234, 147, 0.2);
    color: #3cea93;
}

.task-item .task-actions {
    float: right;
    display: none;
}

.task-item:hover .task-actions {
    display: inline;
}

.task-item .task-actions button {
    padding: 2px 6px;
    font-size: 11px;
    margin-left: 4px;
    background: #555;
}

.task-item .task-actions button:hover {
    background: #666;
}

.task-item .task-actions button.danger {
    background: #ef4444;
}

/* 拖拽相关 */
.task-item[draggable="true"] {
    cursor: grab;
    user-select: none;
}

.task-item[draggable="true"]:active {
    cursor: grabbing;
}

.task-item.dragging {
    opacity: 0.4;
}

.day-column.drag-over {
    background: #2a2a3a;
    outline: 2px dashed #3b82f6;
    outline-offset: -2px;
}

/* 分类颜色 */
.task-item.grammar {
    border-left-color: #ff0000;
}

.task-item.grammar .task-category {
    color: #ff0000;
}

.task-item.work {
    border-left-color: #b3d635;
}

.task-item.work .task-category {
    color: #b3d635;
}

.task-item.other {
    border-left-color: #3cea93;
}

.task-item.other .task-category {
    color: #3cea93;
}

/* 复盘核心原则 */
.principles-section {
    background: #2a2a1e;
    border-left: 4px solid #f59e0b;
}

.principles-section h2 {
    color: #f59e0b;
}

.principles-list {
    padding-left: 20px;
    font-size: 13px;
    color: #ccc;
}

.principles-list li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.principles-list li strong {
    color: #ff4444;
    font-weight: bold;
}

/* 周复盘区域 */
.recap-section {
    background: #1e2d1e;
    border-left: 4px solid #22c55e;
}

.recap-section h2 {
    color: #22c55e;
}

.recap-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.recap-block {
    background: #253525;
    padding: 12px;
    border-radius: 6px;
}

.recap-block h3 {
    font-size: 13px;
    color: #4ade80;
    margin-bottom: 10px;
}

.recap-textarea {
    width: 100%;
    min-height: 120px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #ccc;
    font-size: 13px;
    padding: 10px;
    line-height: 1.8;
    resize: vertical;
    font-family: inherit;
}

.recap-textarea:focus {
    outline: none;
    border-color: #4ade80;
}

.recap-block .summary-item {
    padding: 6px 0;
    font-size: 13px;
    color: #ccc;
}

.recap-block .summary-category {
    font-weight: bold;
    margin-right: 6px;
}

.recap-block .summary-category.grammar {
    color: #ff0000;
}

.recap-block .summary-category.work {
    color: #b3d635;
}

.recap-block .summary-category.other {
    color: #3cea93;
}

/* 统计条 */
.stats-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 6px;
}

.stat-item {
    font-size: 13px;
    color: #aaa;
}

.stat-item .stat-value {
    font-weight: bold;
    color: #fff;
    margin-left: 4px;
}

.stat-item.grammar .stat-value {
    color: #ff0000;
}

.stat-item.work .stat-value {
    color: #b3d635;
}

.stat-item.other .stat-value {
    color: #3cea93;
}

/* 周报弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #252525;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.modal-header h2 {
    margin-bottom: 0;
}

#report-content {
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.8;
    color: #ccc;
}

/* 响应式 */
@media (max-width: 1200px) {
    .week-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .week-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recap-content {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Toast 提示动画 */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}


@media (max-width: 768px) {
    .week-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recap-content {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}
