* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.input-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.input-section h2 {
    color: #333;
    margin-bottom: 20px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.subject-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.subject-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 5px solid;
}

.subject-card.chinese { border-color: #e74c3c; }
.subject-card.math { border-color: #3498db; }
.subject-card.english { border-color: #27ae60; }
.subject-card.other { border-color: #9b59b6; }

.subject-card h3 {
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subject-icon {
    font-size: 1.5em;
}

textarea {
    width: 100%;
    min-height: 180px;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-print {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn-clear {
    background: linear-gradient(135deg, #eb4d4b 0%, #ff7979 100%);
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* A4 纸张样式 */
.a4-preview {
    background: white;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto 25px;
    padding: 15mm;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: none;
}

.a4-preview.show {
    display: block;
}

.homework-header {
    text-align: center;
    border-bottom: 3px solid #333;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.homework-header h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.homework-date {
    color: #666;
    font-size: 14px;
}

.homework-table {
    width: 100%;
    border-collapse: collapse;
}

.homework-table th {
    background: #667eea;
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #5567d5;
}

/* 调整列宽 - 序号紧跟内容 */
.homework-table th:first-child { width: 50px; }  /* 序号 */
.homework-table th:nth-child(2) { text-align: left; padding-left: 15px; } /* 作业内容 */
.homework-table th:nth-child(3) { width: 50px; } /* 完成 */
.homework-table th:nth-child(4) { width: 50px; } /* 确认 */
.homework-table th:nth-child(5) { width: 70px; } /* 开始时间 - 缩小 */
.homework-table th:nth-child(6) { width: 70px; } /* 结束时间 - 缩小 */

.homework-table td {
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: middle;
}

.homework-table .task-content {
    padding: 10px 8px;
    line-height: 1.6;
}

.checkbox-cell {
    text-align: center;
}

.checkbox-cell input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.confirm-cell {
    text-align: center;
}

.confirm-box {
    width: 30px;
    height: 30px;
    border: 2px solid #333;
    border-radius: 4px;
    display: inline-block;
}

.subject-row.chinese { background: #fef5f5; }
.subject-row.math { background: #f0f7fb; }
.subject-row.english { background: #f0fbf4; }
.subject-row.other { background: #f9f0fb; }

/* 科目分隔行 */
.subject-divider {
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
}

.subject-divider td {
    padding: 10px 8px;
    font-weight: bold;
    font-size: 15px;
    border-top: 2px solid;
    border-bottom: 2px solid;
}

.subject-divider.chinese td {
    border-color: #e74c3c;
    color: #c0392b;
}
.subject-divider.math td {
    border-color: #3498db;
    color: #2980b9;
}
.subject-divider.english td {
    border-color: #27ae60;
    color: #229954;
}
.subject-divider.other td {
    border-color: #9b59b6;
    color: #8e44ad;
}

.subject-label {
    font-weight: bold;
    color: #333;
    margin-right: 8px;
}

.subject-label.chinese { color: #e74c3c; }
.subject-label.math { color: #3498db; }
.subject-label.english { color: #27ae60; }
.subject-label.other { color: #9b59b6; }

.footer-note {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 2px dashed #ddd;
    color: #666;
    font-size: 12px;
}

.tips {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    color: #856404;
}

.tips h4 {
    margin-bottom: 10px;
}

.tips ul {
    margin-left: 20px;
}

.tips li {
    margin-bottom: 5px;
}

@media print {
    body {
        background: white;
        padding: 0;
    }

    .input-section, .button-group, h1, .tips {
        display: none !important;
    }

    .a4-preview {
        display: block !important;
        box-shadow: none;
        margin: 0;
        padding: 10mm;
    }

    .homework-table th {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .subject-row.chinese { background: #fef5f5 !important; }
    .subject-row.math { background: #f0f7fb !important; }
    .subject-row.english { background: #f0fbf4 !important; }
    .subject-row.other { background: #f9f0fb !important; }
}
