/* wSco005Pub 彩色樣式（選用）。只在 body 有 sp-theme-color 時生效；預設樣式見 wSco005Pub.css。
   切換：頁面右下角「彩色樣式／標準樣式」按鈕（wSco005Pub.js，記在瀏覽器 localStorage）。 */

/* 配色選單（各樣式都會顯示；位置與基本外觀放在這裡） */
.sp-theme-switch {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 18px;
    padding: 4px 10px;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sp-theme-switch label {
    margin: 0 6px 0 0;
    font-weight: normal;
}

.sp-theme-switch select {
    font-size: 13px;
    padding: 1px 4px;
}

@media print {
    .sp-theme-switch {
        display: none;
    }
}

/* ---------- 全版（「彩色全版」選項）：內容區不限寬度，左右保留邊距 ---------- */
@media screen {
    body.sp-layout-wide .sp-container {
        max-width: none;
        padding: 0 24px;
    }
}

@media screen and (max-width: 767px) {
    body.sp-layout-wide .sp-container {
        padding: 0 12px;
    }
}

/* ---------- 彩色樣式 ---------- */
@media screen {
    body.sp.sp-theme-color {
        background-color: #eef3f6;
        color: #263238;
    }

    body.sp-theme-color a {
        color: #1f6f8b;
    }

    body.sp-theme-color a:hover,
    body.sp-theme-color a:focus {
        color: #e07b00;
    }

    /* 頁首：漸層色帶 */
    body.sp-theme-color .sp-header {
        background: linear-gradient(135deg, #1f6f8b 0%, #2a9d8f 60%, #57c4a3 100%);
        border-radius: 8px;
        padding: 14px 20px;
        box-shadow: 0 2px 8px rgba(31, 111, 139, 0.25);
    }

    body.sp-theme-color .sp-title {
        color: #1f6f8b;
        font-weight: bold;
        letter-spacing: 1px;
    }

    /* 只有頁首色帶內的標題用白字（課綱頁的課程名稱標題在色帶外） */
    body.sp-theme-color .sp-header .sp-title {
        color: #fff;
    }

    body.sp-theme-color .sp-header a,
    body.sp-theme-color .sp-header .btn-default {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.6);
    }

    body.sp-theme-color .sp-header .btn-default:hover {
        background-color: rgba(255, 255, 255, 0.3);
    }

    /* 右側「大學院校課程資源網」圖：本身是圓角方框、四角透明，不加底色與內距 */
    body.sp-theme-color .sp-header a.sp-banner,
    body.sp-theme-color .sp-header a.sp-banner img {
        background: none;
        border: none;
        padding: 0;
    }

    /* 區塊：白底卡片＋彩色上框 */
    body.sp-theme-color .sp-panel {
        border: none;
        border-top: 4px solid #2a9d8f;
        border-radius: 8px;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    }

    body.sp-theme-color .sp-subtitle {
        color: #1f6f8b;
        font-weight: bold;
        border-bottom: none;
        background-color: #e8f5f3;
        border-left: 5px solid #f4a261;
        border-radius: 4px;
        padding: 8px 12px;
    }

    /* 表格：深青色表頭、淡色條紋 */
    body.sp-theme-color .table > thead > tr > th {
        background-color: #1f6f8b;
        color: #fff;
        border-color: #1a5f77;
        font-weight: normal;
    }

    body.sp-theme-color .table-bordered,
    body.sp-theme-color .table-bordered > tbody > tr > td,
    body.sp-theme-color .table-bordered > tfoot > tr > td {
        border-color: #cfe3e0;
    }

    body.sp-theme-color .table > tbody > tr:nth-of-type(even) > td {
        background-color: #f3faf9;
    }

    body.sp-theme-color .table > tbody > tr:nth-of-type(odd) > td {
        background-color: #fff;
    }

    body.sp-theme-color .table > tbody > tr:hover > td {
        background-color: #fff4e6;
    }

    body.sp-theme-color .table > tfoot > tr > td {
        background-color: #e8f5f3;
        font-weight: bold;
        color: #1f6f8b;
    }

    body.sp-theme-color .sp-rn {
        color: #2a9d8f;
        font-weight: bold;
    }

    /* 課綱頁基本資料表 */
    body.sp-theme-color .sp-basic th {
        background-color: #e8f5f3;
        color: #1f6f8b;
    }

    /* 按鈕 */
    body.sp-theme-color .btn-primary {
        background-color: #2a9d8f;
        border-color: #23867a;
    }

    body.sp-theme-color .btn-primary:hover,
    body.sp-theme-color .btn-primary:focus {
        background-color: #23867a;
        border-color: #1d7066;
    }

    body.sp-theme-color .sp-print .btn-default,
    body.sp-theme-color .sp-actions .btn-default {
        border-color: #2a9d8f;
        color: #1f6f8b;
    }

    body.sp-theme-color .sp-print .btn-default:hover,
    body.sp-theme-color .sp-actions .btn-default:hover {
        background-color: #e8f5f3;
    }

    body.sp-theme-color .sp-print .btn[disabled] {
        border-color: #ccc;
        color: #999;
    }

    /* 查詢表單 */
    body.sp-theme-color .form-control:focus {
        border-color: #2a9d8f;
        box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.2);
    }

    body.sp-theme-color .sp-sdg legend,
    body.sp-theme-color label {
        color: #37474f;
    }

    body.sp-theme-color .help-block {
        color: #b26a00;
    }

    body.sp-theme-color .sp-theme-switch {
        border-color: #2a9d8f;
    }
}
