﻿/* wSco005Pub 課表及課程綱要公開查詢 */
body.sp {
    background-color: #f5f5f5;
}

.sp-container {
    max-width: 1200px;
    margin: 16px auto;
    padding: 0 16px;
}

.sp-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sp-title {
    margin: 0 0 8px 0;
    font-size: 22px;
}

.sp-subtitle {
    margin-top: 0;
    font-size: 17px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 6px;
}

/* 查詢範圍不足時的紅字提示（只在不符合條件時出現） */
.sp-scope-error {
    color: #c9302c;
    font-weight: bold;
    margin: 4px 0 10px 0;
}

/* 查詢頁標題：三角形校徽＋校名 */
.sp-brand {
    display: flex;
    align-items: center;
    font-weight: 500;   /* 課綱頁的校名用 div（頁面已有課程名稱 h1），字重與 h1 一致 */
    line-height: 1.1;
}

.sp-logo {
    width: 48px;
    height: 48px;
    margin-right: 10px;
    flex-shrink: 0;
}

.sp-banner img {
    max-height: 57px;
}

.sp-panel {
    display: block;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.sp-required {
    color: #a94442;
}

.sp-sdg legend {
    font-size: 14px;
    font-weight: bold;
    border-bottom: none;
    margin-bottom: 4px;
}

/* 授課進度表：課程進度（第 2 欄）與備註（第 4 欄）以外的欄位置中 */
.sp-progress th:nth-child(1), .sp-progress td:nth-child(1),
.sp-progress th:nth-child(3), .sp-progress td:nth-child(3),
.sp-progress th:nth-child(5), .sp-progress td:nth-child(5),
.sp-progress th:nth-child(6), .sp-progress td:nth-child(6) {
    text-align: center;
}

/* 考試方式及配分方式：次數（第 3 欄）與記分比率（第 4 欄）置中，含總計列 */
.sp-exam th:nth-child(3), .sp-exam td:nth-child(3),
.sp-exam th:nth-child(4), .sp-exam td:nth-child(4) {
    text-align: center;
}

/* 教師專長：教師姓名（第 2 欄）置中 */
.sp-skill th:nth-child(2), .sp-skill td:nth-child(2) {
    text-align: center;
}

/* SDGs 選項：三欄對齊（不顯示框線）；窄螢幕改兩欄、一欄 */
.sp-sdg-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 4px;
}

.sp-sdg-list .checkbox-inline {
    margin: 0;
    vertical-align: top;
}

@media (max-width: 991px) {
    .sp-sdg-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .sp-sdg-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

.sp-actions .btn {
    margin-right: 6px;
}

.sp-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sp-print .btn {
    margin: 2px 0 2px 4px;
}

.sp-result td,
.sp-result th {
    font-size: 13px;
}

/* 欄位標題、教師欄不折行 */
.sp-result th,
.sp-result td.sp-nowrap {
    white-space: nowrap;
}

.sp-seq summary {
    cursor: pointer;
    font-weight: bold;
}

.sp-seq-table {
    margin-top: 10px;
    max-width: 480px;
}

.sp-detail-actions .btn {
    margin-left: 4px;
}

.sp-basic th {
    width: 14%;
    background-color: #f9f9f9;
    white-space: nowrap;
}

.sp-basic td {
    width: 36%;
}

/* 長文字：保留換行，不再拼接 textarea（計畫 §6，修正舊頁面的 stored XSS） */
.pre-wrap {
    white-space: pre-wrap;
    word-break: break-word;
}

.sp-empty {
    color: #999;
}

@media print {
    body.sp {
        background-color: #fff;
    }

    .sp-noprint {
        display: none;
    }

    .sp-panel {
        border: none;
        padding: 0;
        page-break-inside: avoid;
    }

    a[href]:after {
        content: none;
    }
}

/* 序號欄（比照舊頁 EEP grid 的 RowNumbers） */
.sp-rn {
    width: 3em;
    text-align: center;
    color: #666;
}
