html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ===== 查詢區 ===== */
.search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.search-bar input,
.search-bar select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 120px;
}

.search-bar button {
    padding: 6px 14px;
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-bar button:hover {
    background-color: #0b5ed7;
}

/* ===== 表格 ===== */
.table-custom {
    width: 100%;
    border-collapse: collapse;
}

.table-custom th {
    background-color: #f8f9fa;
    text-align: left;
    padding: 10px;
    border-bottom: 2px solid #dee2e6;
}

.table-custom td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

/* zebra */
.table-custom tr:nth-child(even) {
    background-color: #fafafa;
}

/* hover */
.table-custom tr:hover {
    background-color: #f1f5ff;
}

/* ===== 分頁 ===== */
.pagination {
    margin-top: 20px;
}

.pagination a {
    display: inline-block;
    padding: 6px 10px;
    margin-right: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover {
    background-color: #0d6efd;
    color: white;
}

.pagination span {
    display: inline-block;
    padding: 6px 10px;
    margin-right: 5px;
    background-color: #0d6efd;
    color: white;
    border-radius: 4px;
}

/* ===== 標題 ===== */
.page-title {
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: bold;
}

/* =========================
   Front Patent Search
========================= */

.patent-page {
    width: 97%;
    max-width: none;
    margin: 0 auto;
    padding: 48px 24px 72px;
    color: #003f31;
    box-sizing: border-box;
}

.patent-page-header {
    margin-bottom: 28px;
}

.patent-page-header h1 {
    color: #00533f;
    font-size: 40px;
    font-weight: 900;
    margin: 0 0 10px;
}

.patent-page-header p {
    color: #4e6f65;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.patent-search-card {
    background: #ffffff;
    border: 1px solid #b9dfcf;
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 28px;
    box-shadow: 0 14px 36px rgba(0, 83, 63, 0.08);
}

.patent-search-grid {
    display: grid;
    grid-template-columns: 1.4fr 180px 160px 180px 200px auto;
    gap: 14px;
    align-items: end;
}

.patent-field label {
    display: block;
    color: #004b36;
    font-weight: 900;
    margin-bottom: 6px;
}

.patent-field input,
.patent-field select {
    width: 100%;
    height: 46px;
    border: 1px solid #a9d7c6;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 16px;
    color: #003f31;
    background: #fff;
    box-sizing: border-box;
}

.patent-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.patent-actions button {
    height: 46px;
    border: none;
    border-radius: 999px;
    padding: 0 24px;
    background: #00533f;
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
}

.patent-actions a {
    height: 46px;
    border-radius: 999px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e5f3ec;
    color: #00533f;
    text-decoration: none;
    font-weight: 900;
}

.patent-table-wrap {
    overflow-x: auto;
    border: 1px solid #b9dfcf;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 14px 36px rgba(0, 83, 63, 0.08);
}

.patent-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1180px;
}

.patent-table th {
    background: #00533f;
    color: #ffffff;
    padding: 14px 16px;
    text-align: left;
    font-weight: 900;
    white-space: nowrap;
}

.patent-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e2eee8;
    vertical-align: top;
    line-height: 1.6;
    color: #003f31;
}

.patent-table tbody tr:hover {
    background: #f3fbf7;
}

.patent-empty {
    text-align: center;
    padding: 36px;
    color: #6a7f78;
    font-weight: 700;
}

.patent-pager {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 28px;
}

.patent-pager a {
    min-width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #e5f3ec;
    color: #00533f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 900;
}

.patent-pager a.active {
    background: #00533f;
    color: #ffffff;
}

@media (max-width: 1200px) {
    .patent-search-grid {
        grid-template-columns: 1fr 1fr;
    }

    .patent-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 576px) {
    .patent-page {
        padding: 32px 16px 56px;
    }

    .patent-page-header h1 {
        font-size: 32px;
    }

    .patent-search-grid {
        grid-template-columns: 1fr;
    }

    .patent-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .patent-actions button,
    .patent-actions a {
        width: 100%;
    }
}

/* ================================
   Contact Page
================================ */

.contact-page {
    background: linear-gradient(180deg, #f7fbf9 0%, #ffffff 70%);
    padding: 56px 20px 72px;
    min-height: calc(100vh - 260px);
}

.contact-container {
    width: min(1080px, 100%);
    margin: 0 auto;
}

.contact-header {
    margin-bottom: 26px;
}

.contact-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: #00795f;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.page-title {
    margin: 0 0 10px;
    color: #005b49;
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 900;
    letter-spacing: 0.04em;
}

.contact-header p {
    margin: 0;
    color: #55756d;
    font-size: 17px;
    line-height: 1.7;
}

.contact-card {
    background: #ffffff;
    border: 1px solid rgba(0, 111, 87, 0.18);
    border-radius: 24px;
    box-shadow: 0 20px 45px rgba(0, 80, 60, 0.10);
    padding: 36px;
}

.contact-form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 24px;
    margin-top: 22px;
}

.form-full {
    width: 100%;
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #005b49;
    font-size: 15px;
    font-weight: 800;
}

.form-control-custom {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border: 1px solid #b8dcd2;
    border-radius: 12px;
    background-color: #ffffff;
    color: #173d35;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.form-control-custom::placeholder {
    color: #8a9f99;
}

.form-control-custom:focus {
    border-color: #00795f;
    box-shadow: 0 0 0 4px rgba(0, 121, 95, 0.12);
    background-color: #fcfffe;
}

.textarea-custom {
    min-height: 150px;
    padding-top: 14px;
    line-height: 1.7;
    resize: vertical;
}

.form-note {
    margin-top: 6px;
    color: #78928b;
    font-size: 13px;
}

.readonly-patent-box {
    padding: 16px 18px;
    border: 1px solid #b8dcd2;
    border-left: 6px solid #00795f;
    border-radius: 14px;
    background: #f3faf7;
    color: #004f40;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.8;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 32px;
}

.btn-submit,
.btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 132px;
    height: 48px;
    padding: 0 24px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.btn-submit {
    border: none;
    background: #005b49;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(0, 91, 73, 0.24);
}

.btn-submit:hover {
    background: #00795f;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 91, 73, 0.28);
}

.btn-cancel {
    border: 1px solid #cfe5df;
    background: #eef7f4;
    color: #005b49;
}

.btn-cancel:hover {
    background: #e0f1ec;
    color: #00473a;
}

.alert-success-custom,
.alert-warning-custom {
    margin-bottom: 22px;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
}

.alert-success-custom {
    background: #e9f8f1;
    color: #006442;
    border: 1px solid #b9e5d0;
}

.alert-warning-custom {
    background: #fff8e5;
    color: #8a5a00;
    border: 1px solid #f1d58a;
}

.text-danger {
    color: #c0392b;
    font-size: 14px;
}

.validation-summary {
    margin-bottom: 18px;
}

/* ================================
   Contact Page RWD
================================ */

@media (max-width: 768px) {
    .contact-page {
        padding: 36px 14px 56px;
    }

    .contact-card {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-submit,
    .btn-cancel {
        width: 100%;
    }
}

.apply-link {
    color: #006fd6;
    font-weight: 700;
    text-decoration: none;
}

.apply-link:hover {
    color: #005b49;
    text-decoration: underline;
}

.apply-separator {
    display: inline-block;
    margin: 0 4px;
    color: #7c9991;
}

/* =========================
   首頁 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;
    }
}

/* 可轉讓專利公告聯絡資訊 */
.patent-contact-info {
    margin-top: 28px;
    color: #003f31;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.8;
}

.patent-contact-info p {
    margin: 0 0 8px;
}

.required-mark {
    color: #d32f2f;
    font-weight: 900;
    margin-right: 4px;
}

.honeypot-field {
    display: none !important;
}

.receiver-info-section {
    margin-top: 28px;
    padding: 24px;
    border: 1px solid #cfe3d7;
    border-radius: 18px;
    background: #f7fbf8;
}

.receiver-info-section h3 {
    margin: 0 0 18px;
    color: #004f35;
    font-size: 1.4rem;
    font-weight: 900;
}

.receiver-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.receiver-card {
    background: #ffffff;
    border: 1px solid #d7e8df;
    border-radius: 14px;
    padding: 18px 20px;
    color: #003f31;
    font-weight: 700;
}

.receiver-line {
    line-height: 1.8;
    margin-bottom: 6px;
}

.receiver-line:last-child {
    margin-bottom: 0;
}

/* ================================
   Patent Table Mobile Card RWD
   手機版表格改為卡片式，不使用橫向 scrollbar
================================ */

@media (max-width: 768px) {
    .patent-table-wrap {
        overflow-x: visible !important;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .patent-table {
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: separate;
        border-spacing: 0 14px;
    }

    .patent-table thead {
        display: none;
    }

    .patent-table tbody {
        display: block;
        width: 100%;
    }

    .patent-table tr {
        display: block;
        width: 100%;
        margin-bottom: 14px;
        border: 1px solid #b9dfcf;
        border-radius: 18px;
        background: #ffffff;
        box-shadow: 0 10px 24px rgba(0, 83, 63, 0.08);
        overflow: hidden;
    }

    .patent-table td {
        display: grid;
        grid-template-columns: 118px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 12px 14px;
        border-bottom: 1px solid #e2eee8;
        color: #003f31;
        line-height: 1.7;
        word-break: break-word;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .patent-table td:last-child {
        border-bottom: none;
    }

    .patent-table td::before {
        content: attr(data-label);
        color: #00533f;
        font-weight: 900;
        white-space: normal;
    }

    .patent-table td[colspan] {
        display: block;
        text-align: center;
    }

    .patent-table td[colspan]::before {
        content: "";
        display: none;
    }

    .patent-table td[data-label="發明名稱"],
    .patent-table td[data-label="專利名稱"] {
        font-weight: 700;
    }

    .patent-table td[data-label="業務洽談"] a,
    .patent-table td[data-label="線上申請"] a {
        display: inline-flex;
        width: fit-content;
        min-height: 36px;
        padding: 6px 16px;
        border-radius: 999px;
        align-items: center;
        justify-content: center;
        background: #00533f;
        color: #ffffff;
        font-weight: 900;
        text-decoration: none;
    }

    .patent-empty {
        padding: 24px 18px;
        border: 1px solid #b9dfcf;
        border-radius: 18px;
        background: #ffffff;
    }
}

@media (max-width: 420px) {
    .patent-page {
        width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    .patent-table td {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 10px;
        padding: 11px 12px;
        font-size: 15px;
    }
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.captcha-image {
    width: 130px;
    height: 44px;
    border: 1px solid #b7dacb;
    border-radius: 8px;
    background: #f5fbf7;
}

.captcha-refresh-button {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid #00533f;
    border-radius: 999px;
    background: #ffffff;
    color: #00533f;
    font-weight: 700;
    cursor: pointer;
}

.captcha-refresh-button:hover,
.captcha-refresh-button:focus {
    background: #00533f;
    color: #ffffff;
}

.captcha-input {
    max-width: 180px;
}