:root {
    --portal-green: #006b45;
    --portal-green-dark: #004f35;
    --portal-green-light: #eaf6ef;
    --portal-green-soft: #f5fbf7;
    --portal-text: #1f2d2a;
    --portal-muted: #50635c;
    --portal-border: #cfe3d7;
    --portal-bg: #f7faf8;
    --portal-white: #ffffff;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    background: var(--portal-bg);
    color: var(--portal-text);
    font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: #fff;
    color: #000;
    padding: .5rem 1rem;
    z-index: 9999;
}

.skip-link:focus {
    top: 1rem;
}

.page-shell {
    width: 97%;
    max-width: none;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    box-shadow: 0 0 18px rgba(15, 23, 42, .12);
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--portal-border);
}

.portal-navbar {
    min-height: 68px;
    padding: 0;
    background: #fff;
}

.navbar-inner {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.portal-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    min-width: 0;
    flex: 0 1 auto;
    max-width: 52%;
}

.portal-brand:hover {
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: auto;
    height: clamp(42px, 4vw, 56px);
    max-width: 460px;
    object-fit: contain;
}

#mainNav2 {
    flex: 1 1 auto;
    min-width: 0;
}

.portal-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2rem;
    flex-wrap: nowrap;
}

.portal-menu .nav-link {
    color: #143c2c;
    font-size: .98rem;
    font-weight: 900;
    padding: 1.55rem .15rem;
    border-bottom: 4px solid transparent;
    white-space: nowrap;
    line-height: 1.2;
}

.portal-menu .nav-link:hover,
.portal-menu .nav-link.active {
    color: var(--portal-green);
    border-bottom-color: var(--portal-green);
}

/* Main */
.site-main {
    min-height: 520px;
}

/* Hero */
.home-hero-green {
    position: relative;
    min-height: 320px;
    overflow: hidden;
    border-bottom: 1px solid var(--portal-border);

    /* 背景圖置中 */
    background:
        linear-gradient(rgba(244, 251, 247, 0.78), rgba(233, 247, 240, 0.78)),
        url('/img/bg01.png');

    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

.home-hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
    padding: 3.2rem 1.5rem 2.8rem;
    color: var(--portal-green-dark);
    text-align: left;
}

.home-hero-content h1 {
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1.25;
    font-weight: 900;
    letter-spacing: .08em;
    margin-bottom: 1.35rem;
    color: var(--portal-green-dark);
}

.home-hero-content h2 {
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    line-height: 1.35;
    font-weight: 900;
    letter-spacing: .04em;
    margin-bottom: 1.2rem;
    color: var(--portal-green-dark);
}

.home-hero-content p {
    font-size: 1.05rem;
    line-height: 1.9;
    font-weight: 800;
    color: #244f3e;
    margin-bottom: 0;
}

/* Cards */
.home-section {
    background: #fff;
    padding-bottom: 1.6rem;
}*/

.service-area {
    margin-top: 0;
    padding-top: 1.5rem;
    position: relative;
    z-index: 3;
}

.main-card {
    display: flex;
    gap: 1.75rem;
    align-items: center;
    min-height: 158px;
    padding: 1.7rem 2rem;
    background: rgba(255,255,255,.98);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(20, 80, 50, .08);
}

.main-card-icon {
    flex: 0 0 82px;
    width: 82px;
    height: 82px;
    color: var(--portal-green);
    font-size: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-card-body h2 {
    color: var(--portal-green-dark);
    font-size: 1.35rem;
    font-weight: 900;
    margin-bottom: .75rem;
}

.main-card-body p {
    color: var(--portal-muted);
    font-size: .98rem;
    line-height: 1.7;
    font-weight: 700;
    margin-bottom: 1rem;
}

.portal-btn {
    min-width: 136px;
    background: var(--portal-green);
    border-color: var(--portal-green);
    color: #fff;
    border-radius: 5px;
    font-weight: 900;
    padding: .5rem 1.1rem;
    box-shadow: 0 4px 10px rgba(0, 107, 69, .25);
}

.portal-btn:hover {
    background: var(--portal-green-dark);
    border-color: var(--portal-green-dark);
    color: #fff;
}

/* Legacy links */
.legacy-panel {
    margin: 1.8rem 0 1.5rem;
}

.legacy-title {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--portal-green);
    font-size: 1.1rem;
    font-weight: 900;
    margin-bottom: .55rem;
}

.legacy-title span {
    width: 8px;
    height: 2px;
    background: var(--portal-green);
    display: inline-block;
}

.legacy-title small {
    color: var(--portal-green);
    font-size: .9rem;
    font-weight: 800;
}

.legacy-links {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.legacy-link {
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .35rem;
    align-items: center;
    color: var(--portal-green);
    border-right: 1px solid var(--portal-border);
    transition: background .15s ease;
}

.legacy-link:last-child {
    border-right: none;
}

.legacy-link:hover {
    background: var(--portal-green-light);
    color: var(--portal-green-dark);
}

.legacy-link i {
    font-size: 1.8rem;
}

.legacy-link strong {
    font-size: .95rem;
    color: var(--portal-green-dark);
    font-weight: 900;
}

/* Footer */
.site-footer {
    background: linear-gradient(180deg, #006b45 0%, #004f35 100%);
    color: #fff;
}

.footer-info {
    display: grid;
    grid-template-columns: 1.5fr 1.2fr 1.4fr 1.3fr;
    gap: 0;
    padding: 1.35rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,.18);
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.4rem;
    border-right: 1px solid rgba(255,255,255,.24);
    line-height: 1.55;
    font-size: .98rem;
}

.footer-item:first-child {
    padding-left: 0;
}

.footer-item:last-child {
    border-right: none;
    padding-right: 0;
}

.footer-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 2px solid rgba(255,255,255,.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-icon i {
    font-size: 1.45rem;
}

.footer-bottom {
    min-height: 44px;
    padding: .65rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    font-size: .95rem;
    color: #e8fff3;
}

.footer-social {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: .65rem;
}

.footer-social a {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-social a:hover {
    background: rgba(255,255,255,.18);
}

/* Inner pages */
.page-header {
    padding: 2rem 2.5rem;
    background: #f4fbf6;
    border-bottom: 1px solid var(--portal-border);
}

.page-title {
    color: var(--portal-green-dark);
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: .25rem;
}

.page-content {
    padding: 2rem 2.5rem;
}

.search-panel {
    background: #f7fbf8;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.table-panel {
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.table-panel table {
    margin-bottom: 0;
}

.table-panel thead th {
    background: #eaf6ef;
    color: var(--portal-green-dark);
    white-space: nowrap;
    font-weight: 800;
}

/* RWD */
@media (max-width: 1199.98px) {
    .portal-brand {
        max-width: 45%;
    }

    .brand-logo {
        max-width: 360px;
        height: 48px;
    }

    .portal-menu {
        gap: 1rem;
    }

    .portal-menu .nav-link {
        font-size: .9rem;
    }

    .main-card {
        padding: 1.4rem;
    }
}

@media (max-width: 991.98px) {
    .portal-navbar {
        min-height: auto;
        padding: .65rem 0;
    }

    .navbar-inner {
        flex-wrap: wrap;
    }

    .portal-brand {
        max-width: calc(100% - 64px);
    }

    .brand-logo {
        max-width: 310px;
        height: 44px;
    }

    #mainNav2 {
        flex-basis: 100%;
    }

    .portal-menu {
        align-items: stretch;
        gap: 0;
        padding-top: .75rem;
    }

    .portal-menu .nav-link {
        padding: .85rem 0;
        font-size: 1rem;
        border-bottom: 1px solid var(--portal-border);
        white-space: normal;
    }

    .home-hero-content {
        text-align: center;
    }

    .main-card {
        min-height: auto;
    }

    .legacy-links {
        grid-template-columns: repeat(2, 1fr);
    }

    .legacy-link {
        border-bottom: 1px solid var(--portal-border);
    }

    .footer-info {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 1rem;
    }

    .footer-item:nth-child(2) {
        border-right: none;
    }
}

@media (max-width: 767.98px) {
    .brand-logo {
        max-width: 240px;
        height: 36px;
    }

    .home-hero-content {
        padding: 2.4rem 1.2rem;
    }

    .main-card {
        display: block;
        text-align: center;
    }

    .main-card-icon {
        margin: 0 auto 1rem;
    }

    .legacy-links {
        grid-template-columns: 1fr;
    }

    .footer-info {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }

    .footer-item {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,.18);
        padding: 1rem 0;
    }

    .footer-item:last-child {
        border-bottom: none;
    }

    .footer-bottom {
        display: block;
        text-align: center;
        padding: 1rem;
    }

    .footer-social {
        position: static;
        transform: none;
        justify-content: center;
        margin-top: .75rem;
    }
}

/* =========================
   首頁 Hero 區塊 - 綠色版
========================= */
.hero-banner {
    position: relative;
    overflow: hidden;
    margin: 0 0 28px;
    padding: 0;
    border-radius: 0 0 28px 28px;
}

.hero-banner__inner {
    position: relative;
    padding: 72px 24px 78px;
    min-height: 290px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-banner__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 820px;
    text-align: left;
}

.hero-banner__title {
    margin: 0 0 18px;
    font-size: clamp(38px, 5vw, 64px);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0.03em;
    color: #005b49;
}

.hero-banner__subtitle {
    margin: 0 0 18px;
    font-size: clamp(24px, 3vw, 42px);
    font-weight: 800;
    line-height: 1.35;
    color: #006b56;
}

.hero-banner__text {
    margin: 0;
    font-size: 20px;
    line-height: 1.9;
    color: #315f57;
    font-weight: 600;
}

/* 綠色版漸層 */
.hero-banner-green {
    background:
        linear-gradient(135deg, #f4fbf7 0%, #e9f7f0 38%, #d8efe5 100%);
    border: 1px solid #d3e8de;
}

/* 左上柔光 */
.hero-banner-green::before {
    content: "";
    position: absolute;
    top: -80px;
    left: -80px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(96, 181, 145, 0.20) 0%, rgba(96, 181, 145, 0) 72%);
    z-index: 1;
}

/* 右下藍綠淡色區塊 */
.hero-banner-green::after {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -70px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(115, 170, 199, 0.16) 0%, rgba(115, 170, 199, 0) 72%);
    z-index: 1;
}

/* 再加一層幾何柔區塊 */
.hero-banner__inner::before {
    content: "";
    position: absolute;
    top: 30px;
    right: 10%;
    width: 220px;
    height: 220px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255,255,255,0.35), rgba(169, 219, 196, 0.18));
    transform: rotate(16deg);
    z-index: 1;
}

.hero-banner__inner::after {
    content: "";
    position: absolute;
    left: 6%;
    bottom: 20px;
    width: 180px;
    height: 180px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,0.28), rgba(160, 204, 224, 0.14));
    transform: rotate(-12deg);
    z-index: 1;
}

/* RWD */
@media (max-width: 992px) {
    .hero-banner__inner {
        min-height: 250px;
        padding: 58px 20px 62px;
    }

    .hero-banner__title {
        font-size: clamp(34px, 4.6vw, 52px);
    }

    .hero-banner__subtitle {
        font-size: clamp(22px, 3vw, 34px);
    }

    .hero-banner__text {
        font-size: 18px;
        line-height: 1.8;
    }
}

@media (max-width: 768px) {
    .hero-banner {
        border-radius: 0 0 20px 20px;
    }

    .hero-banner__inner {
        min-height: auto;
        padding: 44px 18px 48px;
    }

    .hero-banner__content {
        text-align: left;
    }

    .hero-banner__title {
        margin-bottom: 14px;
        font-size: 34px;
    }

    .hero-banner__subtitle {
        margin-bottom: 14px;
        font-size: 22px;
        line-height: 1.45;
    }

    .hero-banner__text {
        font-size: 16px;
        line-height: 1.8;
    }

    .hero-banner__inner::before,
    .hero-banner__inner::after {
        display: none;
    }
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
    background: #f6fbf8;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    margin-bottom: 0;
}

.site-header {
    flex: 0 0 auto;
}

.site-main {
    flex: 1 0 auto;
}

.site-footer {
    flex: 0 0 auto;
    margin-top: auto;
    width: 100%;
    background: #006b4f;
    color: #ffffff;
}

.footer-bottom {
    width: 100%;
    text-align: center;
    padding: 18px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    background: #006b4f;
    color: #ffffff;
}

.patent-before-search {
    margin-top: 28px;
    padding: 22px 26px;
    border: 1px solid #bfe3d2;
    border-radius: 18px;
    background: #f7fbf8;
    color: #005f46;
    font-weight: 800;
    text-align: center;
}