:root {
    --primary: #00bcd4;
    --primary-dark: #0097a7;
    --white: #ffffff;
    --ink: #18434a;
    --muted: #6a858a;
    --line: #b7e7ec;
    --soft: #f5fdfe;
    --footer: #2f2b1f;
    --accent: #d9534f;
    --tint: #e9f9fb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--white);
    font-family: "Noto Sans TC", Arial, sans-serif;
    line-height: 1.65;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9)),
        radial-gradient(circle at 70% 8%, rgba(0, 188, 212, 0.13), transparent 280px);
}

.header-shell,
.home-grid,
.link-section,
.footer-shell,
.copyright {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.header-shell {
    min-height: 96px;
    display: flex;
    align-items: center;
    padding: 20px 0 14px;
}

.brand {
    display: inline-flex;
    align-items: center;
}

.brand img {
    display: block;
    width: 256px;
    max-width: 60vw;
    height: auto;
}

.brand-mark {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--primary);
    font-weight: 900;
}

.hero img {
    display: block;
    width: 100%;
    max-height: 350px;
    object-fit: cover;
}

.site-nav {
    position: relative;
    z-index: 2;
    margin-top: -25px;
}

.site-nav ul {
    display: flex;
    justify-content: center;
    gap: 0;
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 0 18px;
    list-style: none;
    border-radius: 10px;
    background: var(--primary-dark);
    box-shadow: none;
}

.site-nav a {
    display: block;
    padding: 16px 18px;
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 400;
    white-space: nowrap;
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.nav-toggle {
    display: none;
}

.nav-backdrop {
    display: none;
}

main {
    padding-top: 34px;
    background:
        linear-gradient(180deg, rgba(0, 188, 212, 0.04), transparent 280px),
        var(--white);
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.highlight-panel,
.news-panel {
    grid-column: 1 / -1;
}

.panel {
    border: 1px solid #d9e6e8;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: none;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 10px;
    color: var(--primary-dark);
}

.panel-title h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: 0.04em;
}

.title-icon {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    color: var(--primary-dark);
    font-size: 1.2rem;
}

.with-more {
    justify-content: space-between;
}

.with-more h2 {
    margin-right: auto;
}

.with-more a {
    color: #6f8f95;
    font-size: 0.9rem;
    font-weight: 700;
}

.highlight-list,
.news-list,
.contact-grid {
    padding: 0 22px 22px;
}

.highlight-list {
    padding: 4px 22px 22px;
}

.highlight-row {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    margin: 0 -12px;
    border-radius: 8px;
    border-bottom: 1px solid #e6f3f5;
    transition: background-color 0.2s ease;
}

.highlight-row:last-child {
    border-bottom: 0;
}

.highlight-row:hover {
    background: var(--soft);
}

.highlight-row:hover p {
    color: var(--primary-dark);
}

.dot {
    width: 9px;
    height: 9px;
    margin-top: 0.45em;
    border-radius: 50%;
    background: #7ac943;
    box-shadow: 0 0 0 3px rgba(122, 201, 67, 0.18);
}

.highlight-row p {
    margin: 0;
    color: #52666a;
    font-size: 0.93rem;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
}

.news-panel .news-list {
    padding-top: 4px;
}

.news-row {
    display: grid;
    grid-template-columns: 86px 14px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 46px;
    padding: 0 12px;
    margin: 0 -12px;
    border-radius: 8px;
    border-bottom: 1px solid #e6f3f5;
    color: #52666a;
    font-size: 0.92rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.news-row:last-child {
    border-bottom: 0;
}

.news-row:hover {
    background: var(--soft);
    color: var(--primary-dark);
}

.news-row:hover span:last-child {
    color: var(--primary-dark);
}

.news-row time {
    color: #2e8190;
    font-weight: 700;
}

.news-row span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-panel,
.online-panel {
    margin-top: 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.contact-card {
    min-height: 86px;
    padding: 18px 18px 16px;
    border: 1px solid #e5eeee;
    border-radius: 12px;
    background: var(--white);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.contact-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 22px rgba(0, 188, 212, 0.18);
}

.contact-card b,
.contact-card span {
    display: block;
}

.contact-card b {
    color: var(--primary-dark);
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.contact-card span {
    color: #52666a;
    font-size: 0.92rem;
}

.online-card {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 178px;
    margin: 0 22px 22px;
    padding: 34px 28px;
    border-radius: 13px;
    color: var(--white);
    background-color: #a7dfe7;
    background-image: url('../../images/online_apply_bg.jpg');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border: 1px solid transparent;
    box-shadow: 0 0 0 0 rgba(0, 188, 212, 0);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.online-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.55), 0 12px 26px rgba(0, 188, 212, 0.22);
}

.online-card > div {
    width: 50%;
    min-width: 200px;
}

.online-card span,
.online-card strong,
.online-card em {
    display: block;
}

.online-card > div {
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.online-card span {
    font-size: 1rem;
}

.online-card strong {
    margin-top: 2px;
    font-size: 1.45rem;
    letter-spacing: 0.05em;
}

.online-card em {
    width: fit-content;
    margin-top: 20px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--primary);
    font-style: normal;
    font-weight: 700;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.online-card:hover em {
    background: var(--primary-dark);
    transform: translateX(4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.link-section {
    margin-top: 18px;
    padding-bottom: 22px;
}

.related-shell {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 0 18px;
}

.related-viewport {
    overflow: hidden;
}

.related-links {
    display: flex;
    gap: 10px;
    padding: 0 0 8px;
    will-change: transform;
}

.related-links a {
    display: grid;
    flex: 0 0 142px;
    min-height: 54px;
    place-items: center;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.related-links img {
    display: block;
    width: 100%;
    max-width: 130px;
    max-height: 42px;
    object-fit: contain;
}

.link-scroll-btn {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #d9e6e8;
    border-radius: 50%;
    color: var(--primary-dark);
    background: var(--white);
    cursor: pointer;
}

.link-scroll-btn.side {
    width: 32px;
    height: 32px;
}

.site-footer {
    position: relative;
    overflow: visible;
    margin-top: 78px;
    padding: 54px 0 22px;
    color: var(--white);
    background: var(--footer);
}

.footer-illustration {
    position: absolute;
    top: -42px;
    z-index: 2;
    pointer-events: none;
}

.footer-illustration-left {
    left: 6vw;
    width: 190px;
}

.footer-illustration-right {
    right: 8vw;
    width: 175px;
}

.footer-shell {
    position: relative;
    z-index: 1;
    min-height: 92px;
    text-align: center;
}

.footer-contact {
    width: min(760px, 100%);
    margin: 0 auto;
}

.footer-contact h2 {
    display: none;
}

.footer-contact p {
    margin: 3px 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.92rem;
}

.footer-qr {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 86px;
    height: 86px;
    padding: 4px;
    background: var(--white);
}

.copyright {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.88rem;
    text-align: center;
}

/* ===== 內頁共用 ===== */
.page-head {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 30px 0 6px;
    text-align: center;
}

.page-head-title {
    margin: 0;
    color: var(--primary-dark);
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.page-head-title i {
    margin-right: 8px;
    color: var(--primary);
}

.page-head-wave {
    display: block;
    width: 130px;
    height: 10px;
    margin: 12px auto 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='10' viewBox='0 0 40 10'%3E%3Cpath d='M0 6 Q10 0 20 6 T40 6' fill='none' stroke='%2300bcd4' stroke-width='2.4'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: center;
}

.breadcrumb {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.86rem;
}

.breadcrumb a {
    color: var(--primary-dark);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .sep {
    margin: 0 6px;
    color: #b7cdd0;
}

.breadcrumb .current {
    color: var(--muted);
}

.page-wrap {
    width: min(1120px, calc(100% - 40px));
    margin: 20px auto 36px;
}

.content-panel {
    padding: 28px 30px;
    border: 1px solid #d9e6e8;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
}

.empty-state {
    margin: 30px 0;
    color: var(--muted);
    text-align: center;
}

/* ===== 列表頁 ===== */
.article-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.article-item {
    border-bottom: 1px dashed #cfe6e9;
}

.article-item:last-child {
    border-bottom: 0;
}

.article-item > a {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) 22px;
    gap: 14px;
    align-items: center;
    padding: 16px 10px;
    margin: 0 -10px;
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

.article-item > a:hover {
    background: var(--soft);
}

.article-date {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.92rem;
}

.article-body {
    min-width: 0;
}

.article-title {
    display: block;
    color: var(--ink);
    font-size: 1.02rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-summary {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-item > a:hover .article-title {
    color: var(--primary-dark);
}

.article-go {
    color: #9fc4c9;
    text-align: center;
}

.article-item > a:hover .article-go {
    color: var(--primary);
}

/* ===== 分頁 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
}

.page-btn {
    display: inline-grid;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    place-items: center;
    border: 1px solid #d9e6e8;
    border-radius: 9px;
    color: var(--primary-dark);
    font-size: 0.92rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

a.page-btn:hover {
    border-color: var(--primary);
    background: var(--soft);
}

.page-btn.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}

.page-btn.is-disabled {
    color: #c2d6d8;
    cursor: default;
}

/* ===== 詳細頁 ===== */
.news-article-head {
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e6f3f5;
    text-align: center;
}

.news-article-date {
    color: var(--muted);
    font-size: 0.9rem;
}

.news-article-title {
    margin: 8px 0 0;
    color: var(--ink);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.5;
}

/* ===== 富圖文內容 ===== */
.rich-content {
    color: #44595d;
    font-size: 1rem;
    line-height: 1.9;
}

.rich-content p {
    margin: 0 0 14px;
}

.rich-content h2 {
    margin: 28px 0 14px;
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.5;
}

.rich-content h2:first-child {
    margin-top: 0;
}

.rich-content h3 {
    margin: 22px 0 10px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
    color: var(--primary-dark);
    font-size: 1.1rem;
    font-weight: 700;
    text-align: left;
}

.rich-content h3:first-child {
    margin-top: 0;
}

.rich-content h4 {
    margin: 18px 0 8px;
    color: var(--ink);
    font-size: 1.04rem;
    font-weight: 700;
}

.rich-content a {
    color: var(--primary-dark);
    text-decoration: underline;
}

.rich-content ul,
.rich-content ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.rich-content li {
    margin: 6px 0;
}

.rich-content ol.paren {
    list-style: none;
    counter-reset: paren;
    padding-left: 0;
    margin: 8px 0;
    text-indent: 0;
}

.rich-content ol.paren > li {
    counter-increment: paren;
    padding-left: 3.4em;
    text-indent: -3.4em;
    margin: 6px 0;
}

.rich-content ol.paren > li::before {
    content: "（" counter(paren, cjk-ideographic) "）";
    color: var(--primary-dark);
    font-weight: 700;
}

.rich-content ol.num {
    list-style: decimal;
    padding-left: 26px;
    margin: 6px 0;
    text-indent: 0;
}

.rich-content ol.num > li {
    text-indent: 0;
    margin: 4px 0;
}

.rich-content .law-asterisk {
    margin: 6px 0 0;
    color: var(--accent);
    text-indent: 0;
}

.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.rich-content .note-video-clip {
    position: relative;
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 12px 0 18px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.rich-content .note-video-clip iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0;
    border: 0;
    border-radius: 0;
}

.rich-content iframe[src*="youtube"],
.rich-content iframe[src*="youtu.be"],
.rich-content iframe[src*="vimeo"],
.rich-content iframe[src*="player.vimeo"] {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
    margin: 12px 0 18px;
    border: 0;
    border-radius: 8px;
}

.rich-content table {
    width: 100%;
    margin: 8px 0 18px;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.rich-content th,
.rich-content td {
    padding: 10px 12px;
    border: 1px solid #d9e6e8;
    text-align: left;
}

.rich-content thead th {
    background: var(--primary-dark);
    color: var(--white);
    font-weight: 500;
}

.rich-content tbody tr:nth-child(even) {
    background: var(--soft);
}

/* ===== 附件列表 ===== */
.attachment-list {
    margin-top: 26px;
    padding: 18px 20px;
    border: 1px solid #d9e6e8;
    border-radius: 12px;
    background: var(--soft);
}

.attachment-title {
    margin: 0 0 12px;
    color: var(--primary-dark);
    font-size: 1.05rem;
}

.attachment-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.attachment-list li + li {
    margin-top: 8px;
}

.attachment-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #dcebed;
    border-radius: 9px;
    background: var(--white);
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.attachment-list a:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.14);
}

.attachment-list a > span {
    flex: 1;
    min-width: 0;
}

.attachment-list i {
    color: var(--primary-dark);
    font-size: 1.2rem;
}

.file-tag {
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--primary);
    color: var(--white);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 700;
}

/* ===== 返回按鈕 ===== */
.article-actions {
    margin-top: 26px;
    text-align: center;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 26px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-back:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ===== 定義表格（左欄標籤） ===== */
.rich-content .text-danger {
    color: var(--accent);
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rich-content table.def-table th.row-label {
    width: 180px;
    background: var(--soft);
    color: var(--primary-dark);
    border-left: 3px solid var(--primary);
    font-weight: 700;
    text-align: left;
    vertical-align: top;
}


.rich-content table.measure-table td {
    vertical-align: top;
}

.rich-content table.measure-table .measure-fig-col {
    width: 220px;
    text-align: center;
}

.rich-content .measure-figs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.rich-content .measure-figs img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

/* 行動版：三欄改為上下堆疊 */
@media (max-width: 720px) {
    .rich-content table.measure-table,
    .rich-content table.measure-table tbody,
    .rich-content table.measure-table tr,
    .rich-content table.measure-table th,
    .rich-content table.measure-table td {
        display: block;
        width: auto;
    }

    .rich-content table.measure-table tr {
        border: 1px solid var(--line);
        border-radius: 10px;
        margin-bottom: 14px;
        overflow: hidden;
    }

    .rich-content table.measure-table th.row-label {
        width: auto;
        border-left: 0;
        border-bottom: 1px solid var(--line);
    }

    .rich-content table.measure-table .measure-fig-col {
        width: auto;
    }

    .rich-content .measure-figs {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .rich-content .measure-figs img {
        width: auto;
        max-width: 100%;
        max-height: 150px;
    }
}

.rich-content table.progress-table {
    min-width: 620px;
}

.rich-content table.progress-table thead th {
    text-align: center;
}

.progress-head {
    padding-bottom: 16px;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--line);
    text-align: center;
}

.progress-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.5;
}

.rich-content table.progress-table .pt-item {
    background: var(--tint);
    color: var(--primary-dark);
    text-align: center;
    font-weight: 700;
}

.rich-content table.progress-table .pt-target {
    text-align: center;
    color: var(--primary-dark);
    font-weight: 700;
}

.rich-content table.progress-table tbody tr:nth-child(even) {
    background: transparent;
}

.rich-content table.progress-table .pt-label {
    background: var(--soft);
}

.rich-content table.progress-table td:last-child {
    text-align: center;
}

.rich-content table.progress-table tr.pt-rate td:last-child {
    background: var(--tint);
    color: var(--primary-dark);
    font-weight: 700;
}

/* 效率附表 */
.rich-content table.eff-table td:nth-child(3),
.rich-content table.eff-table td:nth-child(4),
.rich-content table.eff-table th:nth-child(3),
.rich-content table.eff-table th:nth-child(4) {
    text-align: center;
    white-space: nowrap;
}

/* ===== 流程圖（簡易直式） ===== */
.flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 6px 0;
}

.flow-step {
    position: relative;
    min-width: 180px;
    padding: 12px 22px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    text-align: center;
}

.flow-step.is-oval {
    border-radius: 999px;
    background: var(--tint);
    border-color: var(--primary);
}

.flow-step:not(:last-child) {
    margin-bottom: 30px;
}

.flow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -24px;
    width: 2px;
    height: 18px;
    background: var(--primary);
    transform: translateX(-50%);
}

.flow-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -26px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid var(--primary);
    transform: translateX(-50%);
    z-index: 1;
}

.flow-note {
    margin-top: 14px;
    color: var(--primary-dark);
    font-weight: 700;
    text-align: center;
}

/* ===== 審核作業流程（分階段） ===== */
.review-flow {
    display: grid;
    gap: 0;
    margin: 10px 0 6px;
}

.rf-stage {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px dashed #d7e8ea;
}

.rf-stage-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border-radius: 10px;
    background: var(--primary-dark);
    color: var(--white);
    text-align: center;
    font-weight: 700;
}

.rf-stage-name span {
    font-size: 0.82rem;
    font-weight: 400;
    opacity: 0.9;
}

.rf-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rf-box {
    padding: 10px 16px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--white);
}

.rf-decision {
    background: var(--soft);
}

.rf-no {
    display: block;
    margin-top: 4px;
    color: var(--accent);
    font-size: 0.86rem;
}

.rf-result {
    justify-self: center;
    margin-top: 14px;
    padding: 12px 28px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
}

/* ===== 申請審核作業流程圖（三欄式） ===== */
.afc {
    margin: 10px 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.afc-colhead {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr) 120px;
    background: var(--primary-dark);
    color: var(--white);
    font-weight: 700;
    text-align: center;
}

.afc-colhead span {
    padding: 10px 8px;
}

.afc-colhead small {
    display: block;
    font-weight: 400;
    font-size: 0.74rem;
    opacity: 0.9;
}

.afc-row {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr) 120px;
    border-top: 1px solid var(--line);
}

.afc-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
    background: var(--soft);
    color: var(--primary-dark);
    font-weight: 700;
    border-right: 1px solid #e1eef0;
}

.afc-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 22px 14px;
}

.afc-deadline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-left: 1px solid #e1eef0;
    color: var(--primary-dark);
    font-weight: 700;
}

.afc-node {
    position: relative;
    min-width: 220px;
    max-width: 100%;
    padding: 9px 18px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--white);
    text-align: center;
}

.afc-node.start {
    border-radius: 999px;
    background: #e9f9fb;
}

.afc-node.decision {
    background: var(--soft);
}

.afc-node:not(:last-child)::after {
    content: "▼";
    position: absolute;
    left: 50%;
    bottom: -18px;
    transform: translateX(-50%);
    color: var(--primary);
    font-size: 0.7rem;
}

.afc-no {
    display: block;
    margin-top: 4px;
    color: var(--accent);
    font-size: 0.84rem;
    font-style: normal;
}

.afc-pass {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.86rem;
}

.afc-result {
    padding: 14px;
    text-align: center;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
    border-top: 1px solid var(--line);
}

/* ===== 管理辦法（法規長文） ===== */
.law-doc {
    color: #44595d;
}

.law-head {
    padding-bottom: 16px;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--line);
    text-align: center;
}

.law-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.5;
}

.law-meta {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.law-articles {
    display: grid;
    gap: 4px;
}

.law-article {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
    padding: 16px 8px;
    border-bottom: 1px dashed #d7e8ea;
}

.law-article:last-child {
    border-bottom: 0;
}

.law-no {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.98rem;
}

.law-text p {
    margin: 0 0 10px;
    line-height: 1.9;
}

.law-text p:last-child {
    margin-bottom: 0;
}

.rich-content ol.law-ol {
    list-style: none;
    counter-reset: lawol;
    padding-left: 0;
    margin: 6px 0 10px;
}

.rich-content ol.law-ol > li {
    counter-increment: lawol;
    padding-left: 2.6em;
    text-indent: -2.6em;
    margin: 5px 0;
    line-height: 1.85;
}

.rich-content ol.law-ol > li::before {
    content: counter(lawol, cjk-ideographic) "、";
    font-weight: 700;
    color: var(--ink);
}

/* ===== 檔案下載 ===== */
.download-group + .download-group {
    margin-top: 26px;
}

.download-group-title {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--line);
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.download-group-title i {
    margin-right: 6px;
    color: var(--primary);
}

.download-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.download-list li {
    border-bottom: 1px dashed #cfe6e9;
}

.download-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 10px;
    margin: 0 -10px;
    border-radius: 10px;
    color: var(--ink);
    transition: background-color 0.2s ease;
}

.download-list a:hover {
    background: var(--soft);
}

.download-icon {
    color: var(--primary-dark);
    font-size: 1.35rem;
}

.download-name {
    flex: 1;
    min-width: 0;
}

.download-list a:hover .download-name {
    color: var(--primary-dark);
}

.download-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.download-date,
.download-size {
    font-style: normal;
}

.download-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--white);
    font-size: 0.86rem;
    font-weight: 700;
    transition: background-color 0.2s ease;
}

.download-list a:hover .download-btn {
    background: var(--primary-dark);
}

/* ===== 問與答（手風琴） ===== */
.faq-list {
    display: grid;
    gap: 12px;
}

.faq-item {
    border: 1px solid #d9e6e8;
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 18px;
    border: 0;
    background: var(--soft);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.faq-question:hover {
    background: #ecfafc;
}

.faq-q-mark {
    display: inline-grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
}

.faq-q-text {
    flex: 1;
    font-size: 1.02rem;
}

.faq-arrow {
    color: var(--primary-dark);
    transition: transform 0.25s ease;
}

.faq-item.is-open .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s ease;
}

.faq-item.is-open .faq-answer {
    grid-template-rows: 1fr;
}

.faq-answer-inner {
    overflow: hidden;
}

.faq-item.is-open .faq-answer-inner {
    padding: 16px 18px;
}

/* ===== 排放百大地圖 ===== */
.map-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 0.96rem;
}

.map-filter label {
    color: var(--primary-dark);
    font-weight: 700;
}

.map-filter select {
    padding: 8px 14px;
    border: 1px solid #cde3e6;
    border-radius: 9px;
    background: var(--white);
    color: var(--ink);
    font: inherit;
}

.map-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
}

.map-canvas {
    height: 460px;
    border-radius: 12px;
    border: 1px solid #d9e6e8;
    z-index: 0;
}

.map-list {
    max-height: 460px;
    overflow-y: auto;
    padding-right: 4px;
}

.map-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e1eef0;
    border-radius: 10px;
    margin-bottom: 10px;
}

.map-rank {
    display: inline-grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
}

.map-item-body {
    flex: 1;
    min-width: 0;
}

.map-item-name {
    display: block;
    color: var(--ink);
    font-size: 0.98rem;
}

.map-item-meta {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.83rem;
}

.map-locate {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid #cde3e6;
    border-radius: 9px;
    background: var(--white);
    color: var(--primary-dark);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.map-locate:hover {
    background: var(--primary);
    color: var(--white);
}

.map-popup-wrap .leaflet-popup-content {
    margin: 12px 14px;
}

.map-popup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    line-height: 1.5;
}

.map-popup-table th,
.map-popup-table td {
    border: 1px solid #d5e2e4;
    padding: 6px 8px;
    vertical-align: top;
}

.map-popup-table th {
    width: 26%;
    background: #f7fbfc;
    color: var(--ink);
    font-weight: 700;
    white-space: nowrap;
}

.map-popup-table .map-popup-value {
    color: #1565c0;
    font-weight: 700;
}

@media (max-width: 980px) {
    .site-nav {
        position: static;
        z-index: auto;
        margin-top: 0;
        background: transparent;
    }

    .map-layout {
        grid-template-columns: 1fr;
    }

    .map-list {
        max-height: none;
    }

    .nav-toggle {
        display: inline-grid;
        place-items: center;
        position: fixed;
        top: 14px;
        right: 14px;
        width: 46px;
        height: 46px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 12px;
        color: var(--white);
        background: var(--primary);
        font-size: 1.3rem;
        box-shadow: none;
        cursor: pointer;
        z-index: 60;
    }

    .site-nav ul {
        position: fixed;
        top: 0;
        right: 0;
        flex-direction: column;
        justify-content: flex-start;
        width: min(78vw, 300px);
        height: 100vh;
        height: 100dvh;
        margin: 0;
        padding: 76px 0 24px;
        border-radius: 0;
        background: var(--primary-dark);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 50;
    }

    .site-nav ul.is-open {
        transform: translateX(0);
    }

    .site-nav a {
        padding: 16px 24px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 40;
    }

    .nav-backdrop.is-open {
        opacity: 1;
        visibility: visible;
    }

    body.nav-open {
        overflow: hidden;
    }

    .home-grid,
    .footer-shell {
        grid-template-columns: 1fr;
    }

    .related-links {
        display: flex;
    }

    .footer-illustration {
        display: none;
    }

    .footer-qr {
        position: static;
        transform: none;
        display: block;
        margin: 16px auto 0;
    }
}

@media (max-width: 620px) {
    .header-shell,
    .home-grid,
    .link-section,
    .footer-shell,
    .copyright,
    .page-head,
    .page-wrap {
        width: calc(100% - 28px);
    }

    .content-panel {
        padding: 20px 16px;
    }

    .page-head-title {
        font-size: 1.4rem;
    }

    .article-item > a {
        grid-template-columns: 1fr;
        gap: 4px;
        align-items: start;
    }

    .article-go {
        display: none;
    }

    .article-title {
        white-space: normal;
    }

    .law-article {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .rf-stage {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .afc-colhead,
    .afc-row {
        grid-template-columns: 72px minmax(0, 1fr) 60px;
    }

    .afc-node {
        min-width: 0;
        width: 100%;
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .afc-flow {
        padding: 18px 8px;
    }

    .brand img {
        width: 256px;
        max-width: 80vw;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .news-row {
        grid-template-columns: 82px 14px minmax(0, 1fr);
    }

    .footer-illustration-left,
    .footer-illustration-right {
        width: 130px;
    }
}
