@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Roboto+Mono:wght@400;500&family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

/**
 * @file material.css
 * @description WeBWorK@NFU —— Material for MkDocs 版面（對照 champlainww.ca）
 *
 * 這個檔案取代原本的 css/style.css。
 * 原本 style.css 裡所有「功能性」的 class 名稱（.tab-btn / .content-section /
 * .side-nav-link / .content-panel / .colledge-filter-btn / .alert / mark …）
 * 全部保留，所以 js/main.js 不需要為了樣式而改動。
 *
 * 版面結構參考 champlainww.ca（Material for MkDocs），
 * 配色則取自 WeBWorK 的 konai 主題（見下方 :root）。
 */

/* ==========================================================================
   1. 設計變數
   ========================================================================== */
:root {
    /* 主色 —— 取自 WeBWorK konai 主題 _theme-colors.scss
       $primary #062A56 / $info,$link #0B477A / ww-logo-bg #041D3C */
    --md-chrome:         #062A56;   /* header、頁籤列、搜尋列、footer 等深色底 */
    --md-chrome-dark:    #041D3C;   /* 公告列、footer 版權列 */
    --md-primary:        #0B477A;   /* 白底上的連結、強調、作用中項目 */
    --md-accent:         #196CB3;   /* hover 時亮一階 */
    --md-primary-dark:   #062A56;
    --md-primary-50:     #F4F8FB;
    --md-primary-100:    #DFECF6;

    /* konai 的狀態色 */
    --md-success:        #198754;
    --md-warning:        #D39E00;
    --md-danger:         #B42318;
    --md-secondary:      #64748B;

    /* konai 的表格與框線 */
    --md-table-head-bg:  #EEF4F8;
    --md-table-head-fg:  #243447;
    --md-table-hover-bg: #F1F6FA;
    --md-border-color:   #CBD5E1;

    /* 前景／背景（Material 的不透明度階層） */
    --md-fg:             rgba(0, 0, 0, 0.87);
    --md-fg-light:       rgba(0, 0, 0, 0.54);
    --md-fg-lighter:     rgba(0, 0, 0, 0.32);
    --md-fg-lightest:    rgba(0, 0, 0, 0.07);
    --md-bg:             #FFFFFF;
    --md-bg-alt:         #FAFAFA;
    --md-divider:        #CBD5E1;

    /* Footer */
    --md-footer-bg:      #062A56;
    --md-footer-bg-dark: #041D3C;
    --md-footer-fg:      #FFFFFF;
    --md-footer-fg-light:rgba(255, 255, 255, 0.7);

    /* 版面尺寸（對齊 Material 預設：header 48px / tabs 48px / grid 1220px / sidebar 242px） */
    --md-header-h:       64px;   /* 橫式 logo 需要多一點高度才讀得清楚 */
    --md-tabs-h:         44px;
    --md-grid-max:       1800px;  /* 超寬螢幕的上限，想完全跟著 80% 就設成 none */
    --md-sidebar-w:      172px;   /* 側欄只要放得下按鈕文字即可 */

    /* 各學院主題色 */
    --th-engr: #198754;   /* konai $success */
    --th-ece:  #3B4F7D;   /* 偏 $primary 的靛藍 */
    --th-mgmt: #A0770A;   /* konai $warning 加深，確保白底可讀 */
    --th-aero: #196CB3;   /* $info 亮一階 */
    --th-past: #64748B;   /* konai $secondary */

    --md-font: 'Roboto', 'Noto Sans TC', 'Helvetica Neue', sans-serif;
    --md-font-mono: 'Roboto Mono', 'SFMono-Regular', Consolas, monospace;
}

/* ==========================================================================
   2. 基礎
   ========================================================================== */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--md-header-h) + 16px); }

/* Sticky footer：body 至少撐滿一個視窗高，主內容區吸收多餘空間，
   footer 因此永遠貼在視窗底部（內容長時則正常被推到下面）。 */
body {
    font-family: var(--md-font);
    background-color: var(--md-bg);
    color: var(--md-fg);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;   /* 手機瀏覽器扣掉網址列後的實際高度 */
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: var(--md-fg-lighter); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--md-fg-light); }

.md-grid {
    width: 80%;
    max-width: var(--md-grid-max);
    margin: 0 auto;
}

/* ==========================================================================
   3. 公告列 (md-banner)
   ========================================================================== */
.md-banner {
    background-color: var(--md-chrome-dark);
    color: #fff;
    font-size: 14px;
    overflow: hidden;
    transition: max-height .25s, opacity .25s;
    max-height: 120px;
}
.md-banner--hidden { max-height: 0; opacity: 0; }
.md-banner__inner {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
}
.md-banner__inner a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.md-banner__close {
    margin-left: auto; background: none; border: 0; color: #fff;
    cursor: pointer; opacity: .7; padding: 2px; line-height: 0;
}
.md-banner__close:hover { opacity: 1; }

/* ==========================================================================
   4. Header
   ========================================================================== */
.md-header {
    position: sticky; top: 0; z-index: 40;
    height: var(--md-header-h);
    background-color: var(--md-chrome);
    color: #fff;
    box-shadow: 0 0 .2rem rgba(0,0,0,.1), 0 .2rem .4rem rgba(0,0,0,.2);
    transition: box-shadow .25s;
}
.md-header__inner {
    display: flex; align-items: center; gap: 4px;
    height: 100%; padding: 0 8px;
}
.md-header__button {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: 0 0 auto;
    background: none; border: 0; color: #fff; cursor: pointer;
    border-radius: 50%; opacity: .9; padding: 0;
}
.md-header__button:hover { opacity: 1; background-color: rgba(255,255,255,.12); }
.md-header__button svg { width: 24px; height: 24px; }

.md-header__logo { display: flex; align-items: center; padding: 0 10px 0 6px; flex: 0 0 auto; }
/* NFU 的橫式 logo 是 755x132（約 5.7:1），固定高度、寬度自適應 */
/* logo 高度：header 高度扣掉上下各 12px 呼吸空間。
   改 --md-header-h 之後這裡會自動跟著算，不用兩邊各調一次。 */
.md-header__logo img, .md-header__logo svg {
    height: calc(var(--md-header-h) - 24px);
    width: auto; max-width: 46vw; display: block;
    object-fit: contain;
}
.md-header__spacer { flex: 1 1 auto; min-width: 8px; }

.md-header__title {
    display: flex; flex-direction: column; justify-content: center;
    flex: 1 1 auto; min-width: 0; padding-left: 4px; line-height: 1.2;
}
.md-header__topic {
    font-size: 16px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.md-header__topic--sub { font-size: 12px; opacity: .8; }

.md-header__source {
    display: flex; align-items: center; gap: 6px;
    color: #fff; text-decoration: none; font-size: 13px; font-weight: 500;
    padding: 6px 12px; border: 1px solid rgba(255,255,255,.5);
    border-radius: 2px; flex: 0 0 auto; margin-left: 8px; white-space: nowrap;
}
.md-header__source:hover { background-color: rgba(255,255,255,.15); }
.md-header__source svg { width: 16px; height: 16px; }

/* ==========================================================================
   5. 搜尋（沿用 #toggleSearchBtn / #searchContainer / #searchContent / #searchInput）
   ========================================================================== */
#searchContainer {
    position: sticky; top: var(--md-header-h); z-index: 39;
    overflow: hidden;
    background-color: var(--md-chrome);
    transition: max-height .3s ease-in-out, margin-bottom .3s ease-in-out;
}
/* main.js 展開時會塞 inline 的 margin-bottom:2rem，這裡壓掉避免和頁籤列之間出現空隙 */
#searchContainer { margin-bottom: 0 !important; }
#searchContent { padding: 0 16px 14px; max-width: var(--md-grid-max); margin: 0 auto; }

.md-search__row { display: flex; gap: 8px; align-items: center; }
#searchInput {
    flex: 1 1 auto; width: 100%;
    padding: 10px 14px; font-size: 15px; font-family: inherit;
    border: 0; border-radius: 2px; background: #fff; color: var(--md-fg);
    outline: none;
}
#searchInput::placeholder { color: var(--md-fg-lighter); }
#searchInput:focus { box-shadow: 0 0 0 .2rem rgba(6, 42, 86, .35); }
#searchButton {
    flex: 0 0 auto; padding: 10px 20px; font-size: 14px; font-weight: 500;
    font-family: inherit; cursor: pointer;
    background-color: var(--md-chrome-dark); color: #fff;
    border: 0; border-radius: 2px;
}
#searchButton:hover { background-color: var(--md-accent); }

.md-search__keywords { margin-top: 10px; font-size: 13px; color: rgba(255,255,255,.85); }
.keyword-tag {
    display: inline-block; cursor: pointer;
    background-color: rgba(255,255,255,.18); color: #fff;
    padding: 3px 10px; border-radius: 12px; margin: 3px 3px 0 0;
    font-size: 13px; transition: background-color .2s;
}
.keyword-tag:hover { background-color: rgba(255,255,255,.32); }

/* ==========================================================================
   6. 頁籤列 (md-tabs) —— 沿用 .tab-btn
   ========================================================================== */
.md-tabs {
    background-color: var(--md-chrome);
    color: #fff;
    overflow: auto;
}
.md-tabs__list {
    display: flex; margin: 0; padding: 0 8px; list-style: none;
    max-width: var(--md-grid-max); margin: 0 auto;
}
.tab-btn {
    position: relative;
    display: block; height: var(--md-tabs-h); line-height: var(--md-tabs-h);
    padding: 0 12px; margin: 0;
    background: none; border: 0; cursor: pointer;
    color: rgba(255,255,255,.7);
    font-family: inherit; font-size: 14px; font-weight: 500;
    white-space: nowrap;
    transition: color .25s;
}
.tab-btn:hover { color: #fff; }
.tab-btn.active { color: #fff; font-weight: 700; }
.tab-btn.active::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 0;
    height: 2px; background-color: #fff;
}
.search-indicator {
    display: none;
    position: absolute; top: 10px; right: 4px;
    width: 7px; height: 7px; border-radius: 50%;
    background-color: var(--md-warning);
}
.tab-btn.has-results .search-indicator { display: block; }

/* ==========================================================================
   7. 主體三欄版面
   ========================================================================== */
.md-main { display: block; flex: 1 0 auto; }
.md-main__inner {
    display: flex; align-items: flex-start;
    padding: 0; gap: 0;
}

.md-sidebar {
    flex: 0 0 var(--md-sidebar-w);
    width: var(--md-sidebar-w);
    position: sticky;
    top: calc(var(--md-header-h) + 16px);
    max-height: calc(100vh - var(--md-header-h) - 32px);
    overflow-y: auto;
    padding: 24px 0;
    font-size: 14px;
}
.md-sidebar--primary { padding-right: 8px; }
.md-sidebar--secondary { padding-left: 8px; }
.md-sidebar--secondary { order: 2; }

.md-content { flex: 1 1 0; min-width: 0; order: 1; }
.md-content__inner { padding: 24px 28px 48px; }
.md-content__inner > .content-section { min-height: 30vh; }

/* --- 側欄導覽 --- */
.md-nav__title {
    font-size: 13px; font-weight: 700; color: var(--md-fg-light);
    padding: 0 8px; margin-bottom: 10px;
}
.md-nav__list { list-style: none; margin: 0; padding: 0; }
.md-nav__item { margin: 0; }

/* 側欄連結（學生／教師頁籤沿用 .side-nav-link；課程查詢沿用 .colledge-filter-btn） */
.side-nav-link,
.md-sidebar .colledge-filter-btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%; text-align: left;
    padding: 7px 8px; margin: 1px 0;
    background: none; border: 0; border-radius: 2px;
    font-family: inherit; font-size: 14px; font-weight: 400;
    color: var(--md-fg-light); text-decoration: none; cursor: pointer;
    transition: color .15s, background-color .15s;
}
.side-nav-link svg { flex: 0 0 auto; width: 18px; height: 18px; opacity: .8; }
.side-nav-link:hover,
.md-sidebar .colledge-filter-btn:hover { color: var(--md-primary); background-color: var(--md-primary-50); }
.side-nav-link.active,
.md-sidebar .colledge-filter-btn.active {
    color: var(--md-primary); font-weight: 700; background: none;
}
.side-nav-link.has-search-result { color: var(--md-accent); font-weight: 700; }
.side-nav-link.has-search-result svg { stroke: var(--md-accent); }
.side-nav-link.has-search-result::after {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background-color: var(--md-warning); margin-left: auto; flex: 0 0 auto;
}

/* --- 右側「本頁目錄」 --- */
.md-nav--secondary .md-nav__title { border-left: 2px solid var(--md-divider); padding-left: 10px; }
.md-toc__link {
    display: block; padding: 5px 10px;
    color: var(--md-fg-light); text-decoration: none; font-size: 13.5px;
    border-left: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.md-toc__link:hover { color: var(--md-primary); }
.md-toc__link.md-toc__link--active {
    color: var(--md-primary); font-weight: 500;
    border-left-color: var(--md-primary);
}
.md-toc__link--h3 { padding-left: 22px; font-size: 13px; }
.md-toc__empty { padding: 4px 12px; color: var(--md-fg-lighter); font-size: 13px; }

/* ==========================================================================
   8. 內文排版 (md-typeset)
   ========================================================================== */
.content-section { display: none; }
.content-section.active { display: block; }
.content-panel, .colledge-panel { display: none; }
.content-panel.active, .colledge-panel.active { display: block; animation: mdFade .25s ease; }
@keyframes mdFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 內容外框：Material 是無框無陰影的純文章區 */
.content-panel-wrapper { background: none; padding: 0; border: 0; box-shadow: none; }

.md-typeset h1 {
    font-size: 32px; font-weight: 300; line-height: 1.3;
    color: var(--md-fg-light); margin: 0 0 32px;
}
.content-panel h2, .colledge-panel h2, .md-typeset h2 {
    display: flex; align-items: center; gap: 10px;
    font-size: 25px; font-weight: 400; line-height: 1.4;
    color: var(--md-fg); margin: 40px 0 16px; padding: 0;
    border: 0;
}
.content-panel > h2:first-child, .colledge-panel h2:first-child { margin-top: 0; }
.content-panel h2 svg, .colledge-panel h2 svg { flex: 0 0 auto; color: var(--md-primary); }
.content-panel h3, .md-typeset h3 {
    font-size: 20px; font-weight: 500; color: var(--md-fg);
    margin: 32px 0 12px;
}
.content-panel h4 { font-size: 16px; font-weight: 700; margin: 20px 0 8px; }

.content-panel p, .content-panel li, .md-typeset p, .md-typeset li {
    color: var(--md-fg); line-height: 1.7; margin-bottom: 12px;
}
.content-panel ul, .content-panel ol { padding-left: 1.5em; margin-bottom: 16px; }
.content-panel li { margin-bottom: 6px; }

.md-content a { text-decoration: none; }
.md-content a:hover { text-decoration: underline; }
.content-panel a, .md-typeset a { color: var(--md-primary); text-decoration: none; }
.content-panel a:hover, .md-typeset a:hover { color: var(--md-accent); text-decoration: underline; }

.content-panel code, .md-typeset code {
    background-color: var(--md-fg-lightest);
    color: var(--md-primary-dark);
    padding: .08em .35em; border-radius: 2px;
    font-family: var(--md-font-mono); font-size: .88em; font-weight: 400;
}
mark { background-color: #FFF176; color: var(--md-fg); padding: .05em .15em; border-radius: 2px; }

/* 表格（課程列表） */
.md-content table { border-collapse: separate; border-spacing: 0; font-size: 14px; }
.md-content thead th {
    font-weight: 600; text-transform: none; letter-spacing: normal;
    color: var(--md-table-head-fg);
    background-color: var(--md-table-head-bg);
    border-bottom: 1px solid var(--md-border-color);
}
.md-content tbody tr:hover { background-color: var(--md-table-hover-bg); }

/* ==========================================================================
   9. 提示框 (admonition)
   ========================================================================== */
.alert { padding: 14px 16px; border-radius: 2px; margin-bottom: 16px; display: block; font-size: 15px; }
.alert-info    { background-color: var(--md-primary-50); color: var(--md-fg); border-left: 4px solid var(--md-primary); }
.alert-warning { background-color: #FDF6E3; color: var(--md-fg); border-left: 4px solid var(--md-warning); }
.alert ul { list-style-type: disc; padding-left: 1.5em; margin: .5em 0; display: block; }
.alert li { display: list-item !important; margin-bottom: .4em; }

/* 內文裡用 Tailwind 拼出來的提示框，統一成 Material 樣式 */
.md-content .border-l-4 {
    border-radius: 2px !important;
    box-shadow: 0 .1rem .3rem rgba(0,0,0,.05);
}

/* ==========================================================================
   10. 學院主題色
   ========================================================================== */
.theme-all  .colledge-filter-btn[data-target="colledge-all"].active,
.theme-all  .colledge-filter-btn.active                      { color: var(--md-primary); }
.theme-engr .colledge-filter-btn[data-target="colledge-engr"].active { color: var(--th-engr); }
.theme-ece  .colledge-filter-btn[data-target="colledge-ece"].active  { color: var(--th-ece); }
.theme-mgmt .colledge-filter-btn[data-target="colledge-mgmt"].active { color: var(--th-mgmt); }
.theme-aero .colledge-filter-btn[data-target="colledge-aero"].active { color: var(--th-aero); }
.theme-past .colledge-filter-btn[data-target="colledge-past"].active { color: var(--th-past); }

.theme-all  #colledge-all  h2, .theme-all  #colledge-all  h3 { color: var(--md-fg); }
.theme-engr #colledge-engr h2, .theme-engr #colledge-engr h3 { color: var(--th-engr); }
.theme-ece  #colledge-ece  h2, .theme-ece  #colledge-ece  h3 { color: var(--th-ece); }
.theme-mgmt #colledge-mgmt h2, .theme-mgmt #colledge-mgmt h3 { color: var(--th-mgmt); }
.theme-aero #colledge-aero h2, .theme-aero #colledge-aero h3 { color: var(--th-aero); }
.theme-past #colledge-past h2, .theme-past #colledge-past h3 { color: var(--th-past); }

/* 學院面板去掉卡片陰影，改成 Material 的平面文章區 */
.colledge-panel { background: none !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important; }

/* 系所按鈕 */
.dept-btn {
    border: 1px solid var(--md-border-color) !important;
    border-radius: 2px !important;
    background-color: #fff !important;
    color: var(--md-fg) !important;
    font-weight: 500 !important;
    transition: border-color .2s, color .2s, background-color .2s;
}
.dept-btn:hover {
    border-color: var(--md-primary) !important;
    color: var(--md-primary) !important;
    background-color: var(--md-primary-50) !important;
}

/* ==========================================================================
   11. 其他沿用元件
   ========================================================================== */
.reference-block { font-size: 14px; color: var(--md-fg-light); }
.reference-block span { font-weight: 500; }
.reference-block ul { list-style-type: disc; list-style-position: inside; }
.reference-block a { color: var(--md-fg-light); text-decoration: underline; }
.reference-block a:hover { color: var(--md-primary); }

.tooltip-trigger {
    color: var(--md-primary); text-decoration: underline;
    text-decoration-style: dotted; cursor: help; font-weight: 500;
}

.md-button {
    display: inline-block; padding: 10px 22px; margin: 4px 8px 4px 0;
    border: 1px solid var(--md-primary); border-radius: 2px;
    color: var(--md-primary); background: none;
    font-weight: 700; font-size: 15px; text-decoration: none;
    transition: background-color .2s, color .2s;
}
.md-button--primary { background-color: var(--md-primary); }
/* .content-panel a / .md-typeset a 的權重是 (0,1,1)，會蓋掉 .md-button 的 (0,1,0)，
   所以按鈕的文字色必須用同等以上的權重再寫一次，否則字會跟底色同色而看不見。 */
.md-typeset a.md-button,
.content-panel a.md-button { color: var(--md-primary); text-decoration: none; }
.md-typeset a.md-button:hover,
.content-panel a.md-button:hover {
    background-color: var(--md-primary); color: #fff; text-decoration: none;
}
.md-typeset a.md-button--primary,
.content-panel a.md-button--primary { color: #fff; }
.md-typeset a.md-button--primary:hover,
.content-panel a.md-button--primary:hover {
    background-color: var(--md-accent); border-color: var(--md-accent); color: #fff;
}

/* ==========================================================================
   12. Footer
   ========================================================================== */
.md-footer { margin-top: 32px; flex: 0 0 auto; }
.md-footer__nav { background-color: var(--md-footer-bg); color: var(--md-footer-fg); }
.md-footer__nav-inner { display: flex; width: 80%; max-width: var(--md-grid-max); margin: 0 auto; }
.md-footer__link {
    display: flex; align-items: center; gap: 12px;
    flex: 0 0 48%; padding: 20px 16px;
    color: var(--md-footer-fg); text-decoration: none;
    opacity: .7; transition: opacity .2s;
}
.md-footer__link:hover { opacity: 1; }
.md-footer__link--next { margin-left: auto; flex-direction: row-reverse; text-align: right; }
.md-footer__direction { font-size: 12px; opacity: .7; }
.md-footer__title-text { font-size: 16px; font-weight: 400; }
.md-footer__link svg { width: 20px; height: 20px; flex: 0 0 auto; }
.md-footer__link[hidden] { display: none; }

.md-footer-meta { background-color: var(--md-footer-bg-dark); color: var(--md-footer-fg-light); }
.md-footer-meta__inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    width: 80%; max-width: var(--md-grid-max); margin: 0 auto; padding: 20px 0; font-size: 13px;
}
.md-footer-meta a { color: var(--md-footer-fg-light); }

/* footer 內的更新日誌按鈕（items/footer-log.html 動態載入） */
#page-footer { padding: 0; text-align: left; }
#toggle-log-btn, #close-log-btn { cursor: pointer; }
#global-update-log { color: var(--md-fg); }
#global-update-log .prose li { margin: .75em 0; }
#global-update-log .prose p + ul { margin-top: 1.5em; }
#changelog-list li {
    display: grid; grid-template-columns: max-content max-content 1fr;
    column-gap: .5em; align-items: start;
}
#changelog-list li strong { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   13. 響應式
   ========================================================================== */
@media screen and (max-width: 1100px) {
    .md-sidebar--secondary { display: none; }
}
@media screen and (max-width: 1400px) {
    .md-grid { width: 90%; }
}

@media screen and (max-width: 959px) {
    .md-header__source { display: none; }
    .md-header__button--menu { display: flex; }

    /* 左側欄改為抽屜 */
    .md-sidebar--primary {
        position: fixed; top: 0; left: 0; z-index: 60;
        width: 260px; max-height: none; height: 100%;
        padding: 20px 8px;
        background-color: #fff;
        box-shadow: 0 .2rem .6rem rgba(0,0,0,.3);
        transform: translateX(-100%);
        transition: transform .25s cubic-bezier(.4,0,.2,1);
    }
    body.md-drawer--open .md-sidebar--primary { transform: none; }
    body.md-drawer--open { overflow: hidden; }
    .md-drawer__scrim {
        display: none; position: fixed; inset: 0; z-index: 55;
        background-color: rgba(0,0,0,.5);
    }
    body.md-drawer--open .md-drawer__scrim { display: block; }

    .md-content__inner { padding: 20px 4px 40px; }
    .md-footer__link { flex: 0 0 50%; }
}

@media screen and (min-width: 960px) {
    .md-header__button--menu { display: none; }
    .md-drawer__scrim { display: none !important; }
}

@media screen and (max-width: 600px) {
    .md-grid { width: 100%; }
    .md-header__logo img, .md-header__logo svg { height: calc(var(--md-header-h) - 30px); max-width: 60vw; }
    .md-search__row { flex-direction: column; align-items: stretch; }
    #searchButton { width: 100%; }
    .content-panel h2, .colledge-panel h2, .md-typeset h2 { font-size: 21px; }
}

/* 列印 */
@media print {
    .md-header, .md-tabs, .md-sidebar, .md-footer__nav, #searchContainer, .md-banner { display: none !important; }
    .content-panel, .colledge-panel { display: block !important; }
}

/* ==========================================================================
   14. Admonition / 可收合資訊框（更新日誌）
   對應 Material for MkDocs 的 !!! info 與 ??? info
   ========================================================================== */
.md-admonition {
    --adm-color: var(--md-primary);
    display: block;
    margin: 16px 0;
    padding: 0;
    font-size: 14.5px;
    border-left: 4px solid var(--adm-color);
    border-radius: 2px;
    background-color: #fff;
    box-shadow: 0 .1rem .3rem rgba(0,0,0,.08);
    overflow: hidden;
}
.md-admonition--warning { --adm-color: var(--md-warning); }
.md-admonition--success { --adm-color: var(--md-success); }
.md-admonition--danger  { --adm-color: var(--md-danger); }

.md-admonition__title {
    position: relative;
    margin: 0;
    padding: 10px 14px 10px 40px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--md-fg);
    background-color: color-mix(in srgb, var(--adm-color) 10%, transparent);
}
/* 不支援 color-mix 的舊瀏覽器 fallback */
@supports not (background-color: color-mix(in srgb, red 10%, transparent)) {
    .md-admonition__title { background-color: var(--md-primary-50); }
}

/* 標題左側的圓形圖示 */
.md-admonition__title::before {
    content: "";
    position: absolute; left: 14px; top: 50%;
    width: 16px; height: 16px; margin-top: -8px;
    background-color: var(--adm-color);
    -webkit-mask-image: var(--adm-icon); mask-image: var(--adm-icon);
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    --adm-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>');
}

/* 可收合版本 */
details.md-admonition > summary.md-admonition__title {
    cursor: pointer;
    padding-right: 40px;
    list-style: none;
}
details.md-admonition > summary.md-admonition__title::-webkit-details-marker { display: none; }
details.md-admonition > summary.md-admonition__title::after {
    content: "";
    position: absolute; right: 14px; top: 50%;
    width: 0; height: 0; margin-top: -3px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--md-fg-light);
    transition: transform .2s;
}
details.md-admonition[open] > summary.md-admonition__title::after { transform: rotate(180deg); }
details.md-admonition > summary.md-admonition__title:hover {
    background-color: color-mix(in srgb, var(--adm-color) 18%, transparent);
}

.md-admonition__body { padding: 12px 14px; }
.md-admonition__body > :first-child { margin-top: 0; }
.md-admonition__body > :last-child { margin-bottom: 0; }
.md-admonition__body p { margin-bottom: 10px; }
.md-admonition__body a { color: var(--md-primary); }

#news-list { margin-top: 24px; }
