/* --- 累计GPA区域 --- */
.cumulative-section input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* --- 课程行布局 --- */
#courses-container {
    margin-bottom: 15px;
}

.course-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.course-name-input input,
.course-credits-input input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.course-name-input input:focus,
.course-credits-input input:focus {
    border-color: #005a4e;
    outline: none;
}

.course-grade-select select {
    width: 100px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px;
}

.course-grade-select select:focus {
    border-color: #005a4e;
    outline: none;
}

.delete-course-btn {
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #d32f2f;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-course-btn:hover {
    background: #ffebee;
    border-color: #d32f2f;
    transform: scale(1.05);
}

.add-course-btn {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 4px;
    color: #005a4e;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.add-course-btn:hover {
    background: #e8f5e9;
    border-color: #005a4e;
}

.grade-legend {
    font-size: 13px;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.legend-left {
    display: flex;
    align-items: center;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 10px;
    flex-shrink: 0;
}

.legend-text {
    color: #555;
    font-weight: 600;
}

.legend-pct {
    font-weight: bold;
    color: #333;
}

.gpa-note {
    margin-top: 25px;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
}

.cumulative-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 平分两列 */
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.cumulative-grid .form-group {
    min-width: 0; 
}

/* --- 响应式优化 --- */
@media screen and (max-width: 992px) {
    .course-row {
        flex-direction: row; 
        gap: 8px;
        background: #f9f9f9;
        border-radius: 6px;
        margin-bottom: 15px;
    }

    .delete-course-btn {
        width: 36px;
        height: 40px;
        margin-top: 0;
    }

    .cumulative-section > div {
        grid-template-columns: 1fr !important;
    }
}

@media screen and (max-width: 768px) {
    .course-name-input input,
    .course-grade-select select,
    .course-credits-input input {
        font-size: 16px;
    }
}

@media screen and (max-width: 580px) {
    .cumulative-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* --- 打印样式 --- */
@media print {
    .add-course-btn,
    .delete-course-btn,
    .btn-group {
        display: none !important;
    }

    .course-row {
        border: 1px solid #ddd;
        padding: 10px;
        margin-bottom: 5px;
        page-break-inside: avoid;
    }

    .grade-legend,
    .chart-container {
        page-break-inside: avoid;
    }
}
