﻿/* =========================================================
   TPS 教學大綱管理系統 - 現代化介面樣式
   說明：僅覆寫視覺外觀，不影響任何伺服器控制項與 JavaScript 行為。
   ========================================================= */

:root {
    --tps-primary: #1e3a8a;
    --tps-primary-600: #2548a8;
    --tps-primary-500: #3461d1;
    --tps-primary-50: #eef3ff;
    --tps-accent: #0ea5a4;
    --tps-accent-50: #e6f7f7;
    --tps-warn: #d97706;
    --tps-warn-50: #fff7e8;
    --tps-danger: #dc2626;
    --tps-danger-50: #fdecec;
    --tps-success: #16a34a;
    --tps-text: #1f2937;
    --tps-muted: #6b7280;
    --tps-border: #e3e8f0;
    --tps-bg: #f3f6fb;
    --tps-surface: #ffffff;
    --tps-radius: 14px;
    --tps-radius-sm: 8px;
    --tps-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    --tps-shadow-lg: 0 12px 32px rgba(30, 58, 138, .14);
    --tps-font: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Segoe UI", Arial, sans-serif;
}

/* ---------- 基礎 ---------- */
html, body.tps-body {
    margin: 0;
    padding: 0;
}

body.tps-body {
    font-family: var(--tps-font);
    font-size: 15px;
    line-height: 1.65;
    color: var(--tps-text);
    background:
        radial-gradient(1200px 400px at 0% -10%, rgba(52, 97, 209, .10), transparent 60%),
        radial-gradient(900px 360px at 100% -10%, rgba(14, 165, 164, .10), transparent 60%),
        var(--tps-bg);
}

body.tps-body a {
    color: var(--tps-primary-500);
    text-decoration: none;
    transition: color .15s ease;
}

body.tps-body a:hover {
    color: var(--tps-primary);
    text-decoration: underline;
}

.tps-form {
    display: flex;
    flex-direction: column;
}

/* ---------- 頂部導覽列 ---------- */
.tps-topbar {
    background: linear-gradient(100deg, #172f73 0%, var(--tps-primary) 45%, #2a56c6 100%);
    color: #fff;
    box-shadow: 0 2px 12px rgba(23, 47, 115, .25);
}

.tps-topbar__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.tps-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff !important;
    text-decoration: none !important;
}

.tps-brand__mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .5px;
}

.tps-brand__text strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.2;
}

.tps-brand__text small {
    display: block;
    font-size: 11.5px;
    opacity: .78;
    letter-spacing: .4px;
}

.tps-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tps-nav a,
.tps-nav input[type="submit"],
.tps-nav input[type="button"] {
    font-family: var(--tps-font);
    font-size: 14px;
    color: #fff !important;
    background: transparent;
    border: 1px solid transparent;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none !important;
    transition: background .15s ease, border-color .15s ease;
}

.tps-nav a:hover {
    background: rgba(255, 255, 255, .14);
}

.tps-nav a.is-active {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .3);
}

.tps-nav .tps-logout {
    border-color: rgba(255, 255, 255, .45) !important;
    margin-left: 6px;
}

.tps-nav .tps-logout:hover {
    background: #fff !important;
    color: var(--tps-primary) !important;
}

/* ---------- 主視覺 Banner ---------- */
.tps-banner {
    max-width: 1180px;
    margin: 20px auto 0;
    padding: 0 24px;
    box-sizing: border-box;
}

.tps-banner img {
    display: block;
    width: 100%;
    max-height: 170px;
    object-fit: cover;
    object-position: center;
    border-radius: var(--tps-radius);
    box-shadow: var(--tps-shadow);
    background: #fff;
}

/* ---------- 內容容器 ---------- */
.tps-main {
    flex: 1;
    width: 100%;
    max-width: 1180px;
    margin: 20px auto 0;
    padding: 0 24px;
    box-sizing: border-box;
}

.tps-card {
    background: var(--tps-surface);
    border: 1px solid var(--tps-border);
    border-radius: var(--tps-radius);
    box-shadow: var(--tps-shadow);
    padding: 28px 32px;
    overflow-x: auto;
    animation: tps-fade-up .35s ease both;
}

@keyframes tps-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- 頁首區塊 (各頁共用) ---------- */
.tps-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--tps-border);
}

.tps-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--tps-accent);
    background: var(--tps-accent-50);
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.tps-page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--tps-text);
    letter-spacing: .5px;
}

.tps-page-desc {
    margin: 6px 0 0;
    color: var(--tps-muted);
    font-size: 14.5px;
}

.tps-page-desc strong {
    color: var(--tps-primary);
}

/* ---------- 按鈕 ---------- */
.tps-btn,
.tps-main input[type="submit"],
.tps-main input[type="button"] {
    font-family: var(--tps-font);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    line-height: 1.2;
    padding: 8px 16px;
    border-radius: var(--tps-radius-sm);
    border: 1px solid var(--tps-border);
    background: #fff;
    color: var(--tps-text) !important;
    cursor: pointer;
    text-decoration: none !important;
    transition: all .15s ease;
    vertical-align: middle;
}

.tps-btn:hover,
.tps-main input[type="submit"]:hover,
.tps-main input[type="button"]:hover {
    border-color: var(--tps-primary-500);
    color: var(--tps-primary) !important;
    background: var(--tps-primary-50);
}

.tps-main input[type="submit"]:disabled,
.tps-main input[type="button"]:disabled {
    opacity: .45;
    cursor: not-allowed;
    background: #f3f4f6;
}

.tps-btn--primary {
    background: linear-gradient(135deg, var(--tps-primary-500), var(--tps-primary)) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(37, 72, 168, .25);
}

.tps-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--tps-shadow-lg);
    color: #fff !important;
}

.tps-btn--ghost {
    background: transparent;
}

/* ---------- 表單元件 ---------- */
.tps-main input[type="text"],
.tps-main input[type="password"],
.tps-main textarea,
.tps-main select {
    font-family: var(--tps-font);
    font-size: 14px;
    color: var(--tps-text);
    background: #fff;
    border: 1px solid #cfd8e6;
    border-radius: var(--tps-radius-sm);
    padding: 7px 10px;
    box-sizing: border-box;
    max-width: 100%;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.tps-main textarea {
    line-height: 1.6;
    resize: vertical;
}

.tps-main input[type="text"]:focus,
.tps-main input[type="password"]:focus,
.tps-main textarea:focus,
.tps-main select:focus {
    outline: none;
    border-color: var(--tps-primary-500);
    box-shadow: 0 0 0 3px rgba(52, 97, 209, .18);
}

.tps-main input[type="text"]:disabled {
    background: #f3f4f6;
    color: #9ca3af;
}

.tps-main input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0 4px 0 0;
    vertical-align: -3px;
    accent-color: var(--tps-primary-500);
    cursor: pointer;
}

.tps-main input[type="checkbox"] + label {
    cursor: pointer;
    margin-right: 12px;
}

/* ---------- GridView 資料表 ---------- */
.tps-main table[id*="GridView"] {
    border-collapse: separate !important;
    border-spacing: 0;
    width: 100%;
    border: 1px solid var(--tps-border) !important;
    border-radius: 12px;
    overflow: hidden;
    background: #fff !important;
    color: var(--tps-text) !important;
    font-size: 14px;
}

.tps-main table[id*="GridView"] > tbody > tr > th,
.tps-main table[id*="GridView"] > thead > tr > th {
    background: #f1f5fd !important;
    color: #334155 !important;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: .3px;
    padding: 12px 14px !important;
    border-bottom: 1px solid var(--tps-border) !important;
    text-align: center;
    white-space: nowrap;
}

.tps-main table[id*="GridView"] > tbody > tr:first-child {
    background: #f1f5fd !important;
    color: #334155 !important;
}

.tps-main table[id*="GridView"] > tbody > tr > th a {
    color: #334155 !important;
}

.tps-main table[id*="GridView"] > tbody > tr > td {
    padding: 11px 14px !important;
    border-bottom: 1px solid #eef1f6 !important;
    vertical-align: middle;
}

.tps-main table[id*="GridView"] > tbody > tr {
    background: #fff !important;
    color: var(--tps-text) !important;
    transition: background .12s ease;
}

.tps-main table[id*="GridView"] > tbody > tr:nth-child(even) {
    background: #fafbfe !important;
}

.tps-main table[id*="GridView"] > tbody > tr:hover > td {
    background: var(--tps-primary-50);
}

.tps-main table[id*="GridView"] > tbody > tr:last-child > td {
    border-bottom: none !important;
}

/* GridView 內的連結做成膠囊按鈕 */
.tps-link-pill,
.tps-main table[id*="GridView"] td > a {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--tps-primary-50);
    color: var(--tps-primary-600) !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all .15s ease;
}

.tps-main table[id*="GridView"] td > a:hover,
.tps-link-pill:hover {
    background: var(--tps-primary-500);
    color: #fff !important;
}

/* 停用的連結 (例如：此課程免填教學大綱) */
.tps-main table[id*="GridView"] td > a:not([href]) {
    background: #f3f4f6;
    color: #9ca3af !important;
    cursor: default;
}

/* 主要動作連結 */
.tps-main table[id*="GridView"] td > a.tps-action-fill[href] {
    background: linear-gradient(135deg, var(--tps-primary-500), var(--tps-primary));
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(37, 72, 168, .2);
}

.tps-main table[id*="GridView"] td > a.tps-action-fill[href]:hover {
    transform: translateY(-1px);
    box-shadow: var(--tps-shadow-lg);
}

/* 空資料 */
.tps-main table[id*="GridView"] td[colspan] {
    text-align: center;
    color: var(--tps-muted);
    padding: 32px !important;
}

/* ---------- 提示框 ---------- */
.tps-callout {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid #fde3b0;
    background: var(--tps-warn-50);
    color: #7c4a03;
    font-size: 14px;
    margin-top: 20px;
    text-align: left;
}

.tps-callout--info {
    border-color: #cddcfb;
    background: var(--tps-primary-50);
    color: #1e3a8a;
}

.tps-callout__icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: currentColor;
    color: inherit;
    position: relative;
}

.tps-callout__icon::after {
    content: "!";
    position: absolute;
    inset: 0;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
}

.tps-callout--info .tps-callout__icon::after {
    content: "i";
    font-family: Georgia, serif;
}

.tps-callout ol,
.tps-callout ul {
    margin: 4px 0 0;
    padding-left: 20px;
}

.tps-callout strong {
    display: block;
    margin-bottom: 2px;
}

/* ---------- 頁尾 ---------- */
.tps-footer {
    margin-top: 32px;
    background: #fff;
    border-top: 1px solid var(--tps-border);
}

.tps-footer__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--tps-muted);
}

.tps-footer__ip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #9a3412;
    background: #fff4ec;
    border: 1px solid #fed7bd;
    padding: 6px 12px;
    border-radius: 999px;
}

.tps-footer__contact b {
    color: var(--tps-text);
    font-weight: 600;
}

/* =========================================================
   教學大綱填寫頁 (selectPage3_view.aspx) 外觀強化
   ========================================================= */

/* 返回按鈕 (由 tps-ui.js 將 back.png 圖片連結轉換為按鈕) */
.tps-main a.tps-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px 8px 12px;
    border-radius: 999px;
    background: var(--tps-primary-50);
    color: var(--tps-primary-600) !important;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    transition: all .15s ease;
}

.tps-main a.tps-back-link::before {
    content: "\2190";
    font-size: 16px;
}

.tps-main a.tps-back-link:hover {
    background: var(--tps-primary-500);
    color: #fff !important;
}

.tps-main hr {
    border: 0;
    border-top: 1px solid var(--tps-border);
    margin: 16px 0;
}

/* 各大段落標題 (一、課程發展 ...) */
.tps-main .my-table {
    width: 100% !important;
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font: inherit !important;
}

.tps-main .my-table > tbody > tr > td {
    border: 0 !important;
    padding: 6px 0 18px !important;
}

.tps-main .my-table td.style19 {
    background: linear-gradient(100deg, var(--tps-primary) 0%, var(--tps-primary-500) 100%) !important;
    color: #fff !important;
    font-size: 18px !important;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 12px 18px !important;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(30, 58, 138, .18);
    scroll-margin-top: 16px;
}

/* 基本資料表 / Word 轉出之表格 */
.tps-main .overviewTable,
.tps-main .style34,
.tps-main .style47 {
    width: 100% !important;
    border-collapse: collapse !important;
    border: 1px solid var(--tps-border) !important;
    border-radius: 12px;
    font-family: var(--tps-font) !important;
    font-size: 14px !important;
    background: #fff;
}

.tps-main .overviewTable td,
.tps-main .style34 td,
.tps-main .style47 > tbody > tr > td {
    border: 1px solid var(--tps-border) !important;
    padding: 10px 12px !important;
    font-family: var(--tps-font) !important;
}

.tps-main .overviewTable tr.auto-style44 td {
    background: #f1f5fd !important;
    color: #475569;
    font-weight: 600;
    font-size: 13px !important;
}

.tps-main td[style*="DFD8E8"],
.tps-main td.auto-style49,
.tps-main td.auto-style50 {
    background: #f8faff !important;
}

.tps-main td.auto-style17,
.tps-main td.auto-style16,
.tps-main td.auto-style6,
.tps-main td.auto-style49 {
    background: #eef3ff !important;
    color: var(--tps-primary) !important;
    font-weight: 600;
    text-align: center;
    vertical-align: middle !important;
}

.tps-main .style34 span,
.tps-main .style47 span,
.tps-main .overviewTable span {
    font-family: var(--tps-font) !important;
}

/* 段落內的教材表格 (寬度固定 861px → 自適應) */
.tps-main .my-table table[style*="861px"] {
    width: 100% !important;
}

.tps-main .my-table textarea {
    width: 100% !important;
}

/* 欄位小標 */
.tps-main .my-table td > b,
.tps-main .my-table td b {
    color: #1f2a44;
}

/* 注意事項區塊 */
.tps-main .my-table td.style8 > div {
    background: #f8fafc;
    border: 1px dashed #cfd8e6;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 13.5px;
    color: #475569;
}

/* 必填驗證訊息 */
.tps-main span[id*="Validator"] {
    color: var(--tps-danger) !important;
    font-size: 12.5px;
    font-weight: 600;
    margin-left: 6px;
}

/* 檢查結果 */
#ValidResult {
    margin: 0 auto;
}

#ValidResultList {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #fde3b0 !important;
}

#ValidResultList thead th {
    background: var(--tps-warn-50) !important;
    color: #7c4a03 !important;
    padding: 10px 14px;
}

#ValidResultList td {
    padding: 9px 14px;
    text-align: left;
}

/* 大綱段落快速導覽 (由 tps-ui.js 動態產生) */
.tps-quicknav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
    margin: 14px 0 18px;
    background: #f8faff;
    border: 1px solid var(--tps-border);
    border-radius: 12px;
}

.tps-quicknav__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tps-muted);
    align-self: center;
    margin-right: 4px;
}

.tps-quicknav a {
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--tps-border);
    color: var(--tps-text) !important;
    text-decoration: none !important;
    transition: all .15s ease;
}

.tps-quicknav a:hover {
    border-color: var(--tps-primary-500);
    color: var(--tps-primary) !important;
    background: var(--tps-primary-50);
}

/* 儲存區 */
.tps-main #Button3,
.tps-main input[id$="_Button1"][value="確認儲存"] {
    min-width: 300px;
    height: 50px !important;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
}

.tps-main #Button3 {
    border: 1.5px solid var(--tps-primary-500);
    color: var(--tps-primary) !important;
}

.tps-main input[id$="_Button1"][value="確認儲存"] {
    background: linear-gradient(135deg, var(--tps-accent), #0b7f7e) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(14, 165, 164, .3);
}

.tps-main input[id$="_Button1"][value="確認儲存"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(14, 165, 164, .35);
}

/* ---------- 回到頂端 ---------- */
.tps-totop {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: var(--tps-primary);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--tps-shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all .2s ease;
    z-index: 50;
}

.tps-totop.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.tps-totop:hover {
    background: var(--tps-primary-500);
}

/* ---------- 響應式 ---------- */
@media (max-width: 768px) {
    .tps-topbar__inner,
    .tps-banner,
    .tps-main,
    .tps-footer__inner {
        padding-left: 12px;
        padding-right: 12px;
    }

    .tps-card {
        padding: 20px 16px;
    }

    .tps-page-title {
        font-size: 20px;
    }

    .tps-brand__text small {
        display: none;
    }
}

/* ---------- 列印 ---------- */
@media print {
    .tps-topbar,
    .tps-banner,
    .tps-footer,
    .tps-quicknav,
    .tps-totop {
        display: none !important;
    }

    body.tps-body {
        background: #fff;
    }

    .tps-card {
        box-shadow: none;
        border: 0;
        padding: 0;
    }
}
