/* =========================================================
   尚儀教育有聲雲｜主題內容頁 UI 第一輪（2026-07-24）
   僅調整 topic.aspx 顯示結構與 RWD，不變更 AJAX、分頁或資料來源。
   ========================================================= */

:root {
    --topic-blue: #0b3b66;
    --topic-blue-dark: #062c50;
    --topic-orange: #f39a21;
    --topic-orange-dark: #dc7d08;
    --topic-ink: #24364a;
    --topic-muted: #667789;
    --topic-bg: #f3f6f9;
    --topic-card: #ffffff;
    --topic-line: #dce5ee;
    --topic-soft: #edf3f8;
    --topic-shadow: 0 16px 42px rgba(24, 53, 84, .09);
}

html,
body.sy-topic-body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
}

body.sy-topic-body {
    color: var(--topic-ink);
    background: var(--topic-bg);
    font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
}

.sy-topic-body *,
.sy-topic-body *::before,
.sy-topic-body *::after {
    box-sizing: border-box;
}

.sy-topic-shell {
    width: min(1440px, calc(100% - 36px));
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 30px 0 54px;
}

.sy-topic-shell > .inlineColumn,
.sy-topic-shell > aside,
.sy-topic-shell > div:first-child {
    flex: 0 0 auto;
}

.sy-topic-main {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.sy-topic-hero {
    min-height: 182px;
    display: flex;
    align-items: center;
    padding: 32px 40px;
    border-radius: 28px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 18%, rgba(255,255,255,.18), transparent 28%),
        linear-gradient(135deg, var(--topic-blue-dark), #164d7d);
    box-shadow: var(--topic-shadow);
    overflow: hidden;
}

.sy-topic-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 9px;
    color: #ffd49a;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .11em;
}

.sy-topic-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.18;
    font-weight: 950;
}

.sy-topic-hero > div > p:last-child {
    margin: 12px 0 0;
    color: rgba(255,255,255,.88);
    font-size: 16px;
    line-height: 1.75;
}

.sy-topic-workspace {
    margin-top: 22px;
    padding: 24px;
    border: 1px solid var(--topic-line);
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--topic-shadow);
}

.sy-topic-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding: 8px 0 20px;
    border-bottom: 1px solid var(--topic-line);
}

.sy-topic-toolbar h2 {
    margin: 0;
    color: var(--topic-blue-dark);
    font-size: 27px;
    line-height: 1.3;
    font-weight: 950;
}

.sy-topic-toolbar p {
    margin: 5px 0 0;
    color: var(--topic-muted);
    font-size: 14px;
}

.sy-topic-toolbar p strong {
    color: var(--topic-orange-dark);
}

.sy-topic-mode {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border-radius: 15px;
    background: var(--topic-soft);
}

.sy-topic-mode-btn {
    appearance: none;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--topic-blue);
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.sy-topic-mode-btn.is-active {
    color: #fff;
    background: var(--topic-blue);
    box-shadow: 0 7px 16px rgba(11,59,102,.20);
}

.sy-topic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sy-topic-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--topic-line);
    border-radius: 22px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(24,53,84,.07);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.sy-topic-card:hover {
    transform: translateY(-3px);
    border-color: rgba(243,154,33,.48);
    box-shadow: 0 18px 34px rgba(24,53,84,.13);
}

.sy-topic-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: linear-gradient(145deg, #f8fafc, #eaf0f5);
    overflow: hidden;
}

.sy-topic-cover img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 8px 20px rgba(22,43,66,.18);
}

.sy-topic-card-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px;
}

.sy-topic-card h2 {
    min-height: 3.2em;
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.55;
    font-weight: 900;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sy-topic-card h2 a {
    color: var(--topic-blue-dark) !important;
    text-decoration: none !important;
}

.sy-topic-card h2 a:hover,
.sy-topic-card h2 a:focus {
    color: var(--topic-orange-dark) !important;
}

.sy-topic-card-meta {
    margin: 0 0 11px;
}

.sy-topic-card-meta > div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
    border-top: 1px solid var(--topic-line);
}

.sy-topic-card-meta > div:first-child {
    border-top: 0;
}

.sy-topic-card-meta dt,
.sy-topic-card-meta dd {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
}

.sy-topic-card-meta dt {
    color: var(--topic-muted);
    font-weight: 800;
}

.sy-topic-card-meta dd {
    color: var(--topic-ink);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.sy-topic-card-desc {
    min-height: 4.9em;
    margin: 0 0 16px;
    color: var(--topic-muted);
    font-size: 13px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sy-topic-card-btn,
.sy-topic-table-action {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 12px;
    color: #fff !important;
    background: linear-gradient(135deg, var(--topic-orange), var(--topic-orange-dark));
    font-size: 14px;
    font-weight: 900;
    text-decoration: none !important;
}

.sy-topic-card-btn {
    width: 100%;
    margin-top: auto;
}

.sy-topic-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--topic-line);
    border-radius: 18px;
}

.sy-topic-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    background: #fff;
}

.sy-topic-table th,
.sy-topic-table td {
    padding: 14px 13px;
    border-bottom: 1px solid var(--topic-line);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.6;
}

.sy-topic-table th {
    color: #fff;
    background: var(--topic-blue);
    font-weight: 900;
    white-space: nowrap;
}

.sy-topic-table tbody tr:hover {
    background: #f8fbfd;
}

.sy-topic-rowno {
    width: 64px;
    text-align: center !important;
    color: var(--topic-muted);
    font-weight: 800;
}

.sy-topic-table-title {
    color: var(--topic-blue) !important;
    font-weight: 900;
    text-decoration: none !important;
}

.sy-topic-table-desc {
    min-width: 260px;
    color: var(--topic-muted);
}

.sy-topic-table-action {
    min-width: 108px;
    padding: 8px 12px;
}

.sy-topic-empty {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 34px 20px;
    text-align: center;
    border: 1px dashed #c9d5e1;
    border-radius: 22px;
    background: #f9fbfd;
}

.sy-topic-empty > i {
    width: 62px;
    height: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--topic-orange);
    background: #fff2df;
    font-size: 27px;
}

.sy-topic-empty h2 {
    margin: 15px 0 6px;
    color: var(--topic-blue-dark);
    font-size: 22px;
}

.sy-topic-empty p {
    margin: 0 0 16px;
    color: var(--topic-muted);
}

.sy-topic-empty a {
    padding: 9px 17px;
    border-radius: 999px;
    color: #fff !important;
    background: var(--topic-blue);
    font-weight: 900;
    text-decoration: none !important;
}

.sy-topic-pagination {
    margin-top: 24px;
}

.sy-topic-page-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 22px;
}

.sy-topic-page-actions a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 15px;
    border: 1px solid var(--topic-line);
    border-radius: 12px;
    color: var(--topic-blue) !important;
    background: #fff;
    font-weight: 900;
    text-decoration: none !important;
}

.sy-topic-page-actions a:hover {
    color: #fff !important;
    background: var(--topic-blue);
    border-color: var(--topic-blue);
}

@media (max-width: 1120px) {
    .sy-topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .sy-topic-shell {
        width: min(100% - 24px, 1180px);
        display: block;
        padding-top: 22px;
    }

    .sy-topic-shell > .inlineColumn,
    .sy-topic-shell > aside,
    .sy-topic-shell > div:first-child {
        display: none !important;
    }
}

@media (max-width: 680px) {
    .sy-topic-hero {
        min-height: 150px;
        padding: 25px 22px;
        border-radius: 22px;
    }

    .sy-topic-workspace {
        padding: 17px;
        border-radius: 22px;
    }

    .sy-topic-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .sy-topic-mode {
        width: 100%;
    }

    .sy-topic-mode-btn {
        flex: 1;
    }

    .sy-topic-grid {
        grid-template-columns: 1fr;
    }

    .sy-topic-card {
        display: grid;
        grid-template-columns: 126px minmax(0, 1fr);
    }

    .sy-topic-cover {
        height: 100%;
        min-height: 230px;
        aspect-ratio: auto;
        padding: 12px;
    }

    .sy-topic-card h2 {
        min-height: 0;
        font-size: 17px;
    }

    .sy-topic-card-desc {
        display: none;
    }

    .sy-topic-card-meta > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .sy-topic-page-actions {
        justify-content: stretch;
    }

    .sy-topic-page-actions a {
        flex: 1;
    }
}

@media (max-width: 420px) {
    .sy-topic-shell {
        width: min(100% - 16px, 1180px);
    }

    .sy-topic-card {
        grid-template-columns: 108px minmax(0, 1fr);
    }

    .sy-topic-cover {
        min-height: 210px;
        padding: 9px;
    }

    .sy-topic-card-body {
        padding: 14px;
    }

    .sy-topic-card-meta {
        margin-bottom: 8px;
    }

    .sy-topic-card-btn {
        min-height: 40px;
        font-size: 13px;
    }
}
