:root {
    --ink: #102433;
    --muted: #5d7082;
    --line: #d7e3ee;
    --bg: #f3f7fb;
    --card: #fff;
    --brand: #00aae8;
    --brand-deep: #067cad;
    --navy: #0e2438;
    --tint: #e7f6fd;
    --shadow: 0 10px 28px rgba(14, 36, 56, 0.07);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
    font-size: 16px;
    line-height: 1.7;
}
img { max-width: 100%; height: auto; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 0.4em; }
h1 { font-size: clamp(30px, 4vw, 42px); }
h2 { font-size: 24px; }

.skip {
    position: absolute;
    left: 12px;
    top: -40px;
    background: var(--navy);
    color: #fff;
    padding: 8px 12px;
    z-index: 80;
}
.skip:focus { top: 12px; }
.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; margin: 0 0 6px; }
.eyebrow {
    margin: 0 0 8px;
    color: #b7ecff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.eyebrow.dark { color: var(--brand-deep); }

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 16px; white-space: nowrap; }
.brand-text small { color: var(--muted); font-size: 11px; }
.nav-toggle {
    display: none;
    margin-left: auto;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    min-height: 42px;
    padding: 0 14px;
    align-items: center;
    gap: 8px;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block;
    width: 16px;
    height: 2px;
    background: var(--navy);
    position: relative;
}
.nav-toggle-bars::before, .nav-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
}
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }
.nav-wrap { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav-item { position: relative; }
.nav-item > a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 999px;
    font-weight: 700;
}
.nav-item.current > a, .nav-item > a:hover, .nav-item > a:focus-visible { background: var(--tint); color: var(--brand-deep); }
.sub-toggle { display: none; }
.sub {
    display: none;
    position: absolute;
    top: calc(100% - 4px);
    left: 0;
    min-width: 190px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.sub a, .mega li a {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
}
.sub a:hover, .sub a[aria-current="page"], .mega li a:hover, .mega li a[aria-current="page"] { background: var(--tint); color: var(--brand-deep); }
.nav-item:hover > .sub, .nav-item:focus-within > .sub { display: block; }
.sub.mega { width: min(680px, calc(100vw - 32px)); left: 50%; transform: translateX(-50%); padding: 18px; }
.mega-grid { display: grid; grid-template-columns: 1.1fr 1.1fr 0.8fr; gap: 18px; }
.mega-label { display: inline-block; font-weight: 800; margin-bottom: 6px; }
.mega ul { list-style: none; margin: 0; padding: 0; }
.head-search { display: flex; align-items: center; gap: 6px; }
.head-search input, .filter-search input, .contact-form input, .contact-form textarea {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    min-height: 42px;
}
.head-search input { width: 148px; }
.head-search button, .filter-search button {
    border: 0;
    background: var(--navy);
    color: #fff;
    border-radius: 12px;
    min-height: 42px;
    padding: 0 12px;
    cursor: pointer;
}
.meta-bar { background: #f7fbfd; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.meta-inner { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.meta-inner a { color: var(--brand-deep); font-weight: 700; }

main { padding: 28px 0 72px; }

.hero {
    position: relative;
    min-height: 460px;
    border-radius: 28px;
    overflow: hidden;
    color: #fff;
    display: flex;
    align-items: flex-end;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(8, 24, 40, 0.9) 0%, rgba(8, 24, 40, 0.55) 48%, rgba(8, 24, 40, 0.18) 100%);
}
.hero-copy { position: relative; padding: 36px; max-width: 680px; }
.hero-logo { display: inline-block; max-width: min(460px, 100%); background: #00aae8; border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.hero-logo img { display: block; width: 100%; }
.hero h1 { font-size: clamp(32px, 5vw, 50px); }
.hero-lead { margin: 0 0 18px; font-size: 18px; }
.hero-actions, .detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 0;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}
.btn:hover { background: var(--brand-deep); }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.7); }
.btn-ghost:hover { background: #fff; color: var(--navy); }
.btn-line { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn-line:hover { background: var(--tint); }

.stat-row, .chip-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.stat-row div, .chip-row a {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 16px;
}
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat-row strong { display: block; font-size: 26px; color: var(--brand-deep); }
.stat-row span { color: var(--muted); font-size: 13px; }
.chip-row a { font-weight: 800; }
.chip-row a:hover { background: var(--tint); color: var(--brand-deep); }

.home-grid, .catalog, .about-layout, .contact-layout {
    display: grid;
    gap: 22px;
    margin-top: 22px;
}
.home-grid { grid-template-columns: 1.4fr 0.8fr; }
.catalog { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
.about-layout { grid-template-columns: 200px minmax(0, 1fr) 240px; align-items: start; }
.contact-layout { grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.7fr); align-items: start; }
.panel, .pcard, .story, .filter, .side-nav {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel { padding: 22px; border-top: 3px solid var(--brand); }
.panel-head, .section { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section { display: block; margin-top: 36px; }
.panel-head a, .panel-more a, .prose a, .footer-html a, .contact-form a, .contact-aside a, .meta-line a { color: var(--brand-deep); font-weight: 700; }
.panel-more { margin: 16px 0 0; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    min-height: 40px;
    padding: 0 14px;
    font-weight: 800;
    cursor: pointer;
}
.tabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.news-list { display: flex; flex-direction: column; }
.news-row, .story { display: flex; gap: 12px; }
.news-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.news-row:last-child { border-bottom: 0; }
.news-date { display: block; color: var(--brand-deep); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; }
.news-date.lg { font-size: 15px; }
.news-title, .story strong { font-weight: 800; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 12px; }
.pcard { overflow: hidden; display: flex; flex-direction: column; min-height: 100%; }
.pcard:hover { transform: translateY(-2px); }
.pcard-img { aspect-ratio: 1.15; background: #f7fbfd; display: flex; align-items: center; justify-content: center; }
.pcard-img img, .story-img img, .zoom img { width: 100%; height: 100%; object-fit: contain; }
.pcard-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 16px; }
.pcard-body em { color: var(--muted); font-style: normal; font-size: 13px; }
.ph { color: var(--muted); font-size: 13px; }
.ph-lg { min-height: 240px; display: grid; place-items: center; background: #f7fbfd; border-radius: 16px; }

.band {
    margin-top: 28px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 0;
    overflow: hidden;
    border-radius: 28px;
    background: #fff;
    border: 1px solid var(--line);
}
.band img { width: 100%; height: 100%; object-fit: cover; min-height: 240px; }
.band div { padding: 32px; }

.page-head { margin-bottom: 8px; }
.crumb { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 14px; }
.crumb a { color: var(--brand-deep); }
.side-nav { display: flex; flex-direction: column; padding: 10px; }
.side-nav a { padding: 10px 12px; border-radius: 12px; font-weight: 700; }
.side-nav a[aria-current="page"], .side-nav a:hover { background: var(--tint); color: var(--brand-deep); }
.side-label { margin: 12px 12px 0; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; }
.filter { padding: 14px; position: sticky; top: 112px; }
.filter-search, .news-search { display: flex; gap: 8px; }
.filter-search { flex-direction: column; margin-bottom: 12px; }
.news-search { max-width: 520px; margin: 8px 0 0; }
.news-search input { flex: 1; }
.result-line { color: var(--muted); }

.about-photos { display: grid; gap: 12px; }
.about-photos figure { margin: 0; }
.about-photos img { width: 100%; border-radius: 18px; object-fit: cover; aspect-ratio: 4 / 3; }
.prose { overflow-wrap: anywhere; overflow-x: auto; }
.prose img { height: auto; border-radius: 8px; }
.prose table { max-width: 100%; border-collapse: collapse; }
.prose iframe, .prose video { max-width: 100%; }

.detail { display: grid; grid-template-columns: minmax(240px, 420px) minmax(0, 1fr); gap: 28px; align-items: start; }
.zoom {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    cursor: zoom-in;
    overflow: hidden;
}
.zoom span {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(14, 36, 56, 0.82);
    color: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
}
.zoom img { display: block; max-height: 460px; }
.meta-line { display: flex; gap: 12px; margin: 0 0 8px; }
.meta-line span { min-width: 48px; color: var(--muted); }
.article { padding: 22px; }
.article-zoom { margin-bottom: 18px; }
.story-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.story { align-items: center; padding: 10px; }
.story-img { width: 112px; height: 84px; flex: none; border-radius: 12px; overflow: hidden; background: #f7fbfd; display: grid; place-items: center; }
.story-img img { object-fit: cover; }
.adjacent { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.adjacent a { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.adjacent a:last-child { text-align: right; }
.adjacent small { display: block; color: var(--muted); }

.contact-form label, .form-grid { display: grid; gap: 6px; }
.form-grid { grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.form-grid .full { grid-column: 1 / -1; }
.contact-form textarea { min-height: 180px; resize: vertical; width: 100%; }
.contact-form input { width: 100%; }
.alert { padding: 12px 14px; border-radius: 12px; }
.alert.ok { background: #e8f8ef; color: #146c43; }
.alert.bad { background: #fff1f0; color: #a12622; }
.hp { position: absolute; left: -9999px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.pager a, .pager span {
    min-width: 40px;
    min-height: 40px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--line);
}
.pager .is-current { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager .is-disabled { color: #b0bec8; }

.site-footer { background: var(--navy); color: #d5e4ef; padding: 36px 0 18px; }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; }
.footer-name { margin: 0; color: #fff; font-size: 20px; font-weight: 800; }
.footer-en { margin: 0 0 8px; color: #9fd8f5; }
.footer-html a { color: #9fd8f5; }
.footer-nav { display: flex; flex-direction: column; gap: 6px; }
.footer-nav a:hover { color: #fff; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.12);
    color: #8eabc0;
    font-size: 13px;
}
.to-top {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
}
.to-top.show { opacity: 1; pointer-events: auto; }
#lightbox { border: 0; padding: 12px; border-radius: 16px; max-width: min(960px, calc(100vw - 24px)); background: #0e2438; }
#lightbox img { display: block; max-height: 80vh; margin: 0 auto; }
#lightbox::backdrop { background: rgba(6, 16, 28, 0.78); }
.lightbox-close { border: 0; background: transparent; color: #fff; cursor: pointer; margin-bottom: 8px; }
:focus-visible { outline: 3px solid #79d4f8; outline-offset: 2px; }

@media (max-width: 980px) {
    .nav-toggle { display: inline-flex; }
    .header-inner { flex-wrap: wrap; padding-bottom: 10px; }
    .head-search { flex: 1 0 100%; }
    .head-search input { width: auto; flex: 1; }
    .nav-wrap {
        display: none;
        position: static;
        margin: 0;
        padding: 0;
        background: transparent;
        border-bottom: 0;
        box-shadow: none;
        flex-direction: column;
        align-items: stretch;
        flex: 1 0 100%;
    }
    .nav-wrap.open { display: flex; }
    .nav { flex-direction: column; align-items: stretch; }
    .nav-item { display: flex; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); }
    .nav-item > a { flex: 1; border-radius: 0; }
    .sub-toggle {
        display: inline-flex;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        border: 0;
        background: transparent;
    }
    .sub-toggle::before {
        content: "";
        width: 8px;
        height: 8px;
        border-right: 2px solid var(--navy);
        border-bottom: 2px solid var(--navy);
        transform: rotate(45deg);
    }
    .nav-item.open .sub-toggle::before { transform: rotate(225deg) translate(-2px, -2px); }
    .sub, .sub.mega, .nav-item:hover > .sub, .nav-item:focus-within > .sub {
        display: none;
        position: static;
        transform: none;
        width: 100%;
        box-shadow: none;
        border: 0;
        padding: 0 0 8px 12px;
    }
    .nav-item.open > .sub { display: block; }
    .mega-grid { grid-template-columns: 1fr; }
    .home-grid, .catalog, .about-layout, .contact-layout, .band, .detail, .stat-row { grid-template-columns: 1fr; }
    .filter { position: static; }
    .hero { min-height: 0; }
    .hero-shade { background: linear-gradient(180deg, rgba(8,24,40,.35), rgba(8,24,40,.88)); }
    .form-grid, .adjacent { grid-template-columns: 1fr; }
    .adjacent a:last-child { text-align: left; }
    .footer-grid { flex-direction: column; }
}

@media (max-width: 640px) {
    .brand-text small, .meta-inner a { display: none; }
    .hero-copy, .band div, .panel { padding: 18px; }
    .story { align-items: flex-start; }
    .story-img { width: 84px; height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .pcard { transform: none; }
}
