/* --------------------- */
/* Google Fonts 字體引入
/* --------------------- */
/* (繁中用) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100;300;400;500;700;900&display=swap');
/* font-family: 'Noto Sans TC', sans-serif; */
/* (英文用) */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:ital,wght@0,200;0,300;0,400;0,600;1,400;1,600&display=swap');
/* font-family: "Barlow Semi Condensed", sans-serif; */
/* (數字用) */
/* @import url('https://fonts.googleapis.com/css2?family=Geologica:wght@100..900&display=swap'); */
/* font-family: 'Geologica', sans-serif; */
/* (英文 手寫體) */
/* @import url('https://fonts.googleapis.com/css2?family=Vujahday+Script&display=swap'); */
/* font-family: 'Vujahday Script', cursive; */

@font-face {
    font-family: 'DSEG7-Classic';
    src: url('plugin/DSEG7Classic-Bold.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}
/* font-family: 'DSEG7-Classic', monospace; */

/* 直式螢幕 */
@media (orientation: portrait) {
}

/* 橫式螢幕 */
@media (orientation: landscape) {
}

/* SM */
@media (max-width: 767px) {
    :root {
        --h_rwd: 2 / 3;
        --fs_base: 13px;
    }
    input,
    select,
    textarea {
        /* 文字至少 16px，防止 iOS 自動放大 */
        font-size: 16px !important;
    }
}

/* MD */
@media (min-width: 768px) {
    :root {
        --h_rwd: 4 / 3;
        --fs_base: 14px;
    }
}

/* LG */
@media (min-width: 992px) {
    :root {
        --h_rwd: 3 / 2;
        --fs_base: 16px;
    }
}

/* XL */
@media (min-width: 1200px) {
    :root {
        --h_rwd: 16 / 9;
        --fs_base: 16px;
    }
}

/* 全域變數 */
:root {
    --reset100vh: 100vh;
    --100vh: calc(var(--reset100vh, 1vh) * 100);
    /* 應用 backdrop-filter: var(--glass_blur); */
    --glass_blur: saturate(250%) blur(10px);
    /* 應用 filter: var(--drop_shadow); */
    --drop_shadow: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.3));
    /* 應用 box: var(--box_shadow); */
    --box_shadow: 4px 4px 10px rgba(0, 0, 0, 0.1);
    /* 文字陰影 */
    --text_shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    --ff_cn: 'Barlow Semi Condensed', 'Noto Sans TC', sans-serif;
    --ff_en: 'Roboto Condensed', serif;
    --ff_en_w: 'Vujahday Script', cursive;
    --ff_dec: 'Geologica', sans-serif;
    --color_font: #3e3a39;
    --color_disabled: #b0b0b0;
    --color_ci: #ff9500;
    --color_bu: #58a6ff;
    --h_min: min(65vmin, 600px);
    --max_w: 1200px;
    --max_w_sm: 980px;
    --fs_base: 13px;
    --ls: 0.05em;
    --header_height: 66px;
}

/****** 基礎設置 ******/
html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    font-family: var(--ff_cn);
    font-size: var(--fs_base);
    font-weight: 400;
    letter-spacing: var(--ls);
    background-color: transparent;
    color: var(--color_font);
    scroll-behavior: smooth;
}
body:before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url(images/bg_noise.webp) #f3dfb8;
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    z-index: -1;
    opacity: 0.8;
}

*:focus {
    outline: none !important;
    -webkit-box-shadow: unset !important;
    box-shadow: unset !important;
}

input::-webkit-input-placeholder,
.form-control::-webkit-input-placeholder {
    color: var(--color_disabled) !important;
    font-weight: normal !important;
}

input:-ms-input-placeholder,
.form-control:-ms-input-placeholder {
    color: var(--color_disabled) !important;
    font-weight: normal !important;
}

input::placeholder,
.form-control::placeholder {
    color: var(--color_disabled) !important;
    font-weight: normal !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    background-image: url('data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 8 8%27%3e%3cpath fill=%27%23198754%27 d=%27M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z%27/%3e%3c/svg%3e') !important;
}

input:disabled + label {
    text-decoration: line-through;
}

a,
a:hover,
a:visited,
a:link,
a:active {
    text-decoration: none;
    color: inherit;
    overflow-wrap: break-word; /* 允許在內部進行換行，防止跑版 */
    word-wrap: break-word; /* 為舊版瀏覽器提供向下相容 */
    /* 確保允許文字被選取 */
    user-select: text;
    -webkit-user-select: text; /* 適用於 Chrome, Safari */
    -moz-user-select: text; /* 適用於 Firefox */
    -ms-user-select: text; /* 適用於 IE/Edge */
}

h1,
h2,
h3,
h4,
h5,
h6,
a,
button {
    line-height: 1.5;
    letter-spacing: var(--ls);
}
button {
    background-color: transparent;
    border-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

p {
    line-height: 1.85;
}

u {
    text-decoration: none; /* 移除內建底線 */
    border-bottom: var(--ls) var(--color_sky) solid;
}

/* --------------------- */
/* 常用 樣式
/* --------------------- */
.view_warp {
    margin: 0 5.5vw;
}

.max_w {
    max-width: var(--max_w);
    margin-left: auto;
    margin-right: auto;
}

.max_w_sm {
    max-width: var(--max_w_sm);
    margin-left: auto;
    margin-right: auto;
}

.position_center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.img_cover {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.img_cover > img,
.img_cover > video {
    height: auto;
    width: auto;
    object-fit: cover;
    object-position: center;
}

.img_contain {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.img_contain > img,
.img_contain > video {
    height: auto;
    width: auto;
    object-fit: contain;
    object-position: center;
}

.bg_cover {
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    position: relative;
}
.bg_contain {
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    position: relative;
}

.h_rwd {
    width: 100%;
    aspect-ratio: var(--h_rwd);
}

.h_4x3 {
    width: 100%;
    aspect-ratio: 4 / 3;
}

.h_16x9 {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.h_1x1 {
    width: 100%;
    aspect-ratio: 1 / 1;
}

.bg_ci {
    background-color: var(--color_ci) !important;
    color: #ffffff !important;
}

/* 毛玻璃效果 */
.bg_glass {
    position: relative;
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: saturate(100%) blur(2px);
    border: none !important;
    overflow: hidden;
}

/* 偽元素：負責製作「漸層邊框」 */
.bg_glass.border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    /* === 漸層邊框 === */
    background: linear-gradient(to right, transparent, #ffffff);
    /* === 遮罩挖空中間 === */
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none; /* 不阻擋滑鼠點擊 */
}

/* 輪廓陰影（穿透） */
.filter_shadow {
    filter: var(--drop_shadow);
}

/* 區塊陰影（不穿透） */
.box_shadow {
    box-shadow: var(--box_shadow);
}

/* 傾斜 */
.skew_right {
    transform: skewX(-10deg);
}

/* --------------------- */
/* Youtube 影片 嵌入
/* --------------------- */
.youtube_box {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: calc(9 / 16 * 100%);
    border-radius: 4vmin;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.youtube_box iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* --------------------- */
/* 客製 圖標
/* --------------------- */
.after_arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.after_arrow::after {
    content: '';
    display: inline-block;
    background-image: url(images/icon_arrow_right_bk.svg);
    background-size: cover;
    background-position: center;
    width: 0.9em;
    height: 0.9em;
    margin: 0.1em 0 0 0.5em;
    /* 避免被 flex壓縮	 */
    flex-shrink: 0;
}
.after_arrow.color_wh::after {
    background-image: url(images/icon_arrow_right_wh.svg);
}

.best::after {
    content: url(images/icon_check_circle_gn.svg);
    width: 1.5em;
    display: inline-block;
    line-height: 0.9;
    margin: 0 3px;
    transform: translateY(20%);
}

/* --------------------- */
/* 表格 相關
/* --------------------- */
/* 搭配 checkScrollBar() 偵測 */
.scroll_bar {
    border-right: var(--color_ci) 2px dashed;
    position: relative;
    padding-top: 20px;
}

.scroll_bar::before {
    content: '向右滑動檢視更多 ▷';
    position: absolute;
    top: 0;
    right: 3px;
    background-color: var(--color_ci);
    color: #ffffff;
    font-size: 13px;
    line-height: 1;
    z-index: 100;
    border: var(--color_ci) 1px solid;
    padding: 5px 0px 5px 5px;
}

.scroll_bar tr > *:first-child {
    position: sticky;
    left: 0;
    background-color: var(--color_bg);
}

/* --------------------- */
/* 文字 相關
/* --------------------- */
.ff_cn {
    font-family: var(--ff_cn);
}

.ff_en {
    font-family: var(--ff_en);
    letter-spacing: 0.1em;
}

.ff_en_w {
    font-family: var(--ff_en_w);
    /* letter-spacing: 0.1em; */
}

.ff_dec {
    font-family: var(--ff_dec);
}
/* 截斷文字 */
.text_cut {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 1;
    -webkit-line-clamp: 1;
}

.text_ci {
    color: var(--color_ci) !important;
}

.text_start {
    text-indent: 2.3em;
}

.text_shadow {
    text-shadow: var(--text_shadow);
}

.text_circle_box {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    padding: 5%; /* 內距使用相對單位，隨螢幕縮放 */
    box-sizing: border-box;
    aspect-ratio: 1 / 1; /* 保持正圓 */
    word-wrap: break-word;
}

.mix_blebd {
    mix-blend-mode: difference;
    filter: invert(1);
}

.text_justify {
    text-align: justify;
    text-align-last: justify;
}

/* --------------------- */
/* 瀑布流 排版
/* --------------------- */
.masonry_grid {
    column-gap: 0.5rem; /* 欄位 間距 */
    width: 100%;
}
.masonry_grid > * {
    display: block;
    width: 100%;
    break-inside: avoid; /* 內容不可分割 */
    margin-bottom: 0.5rem; /* 欄位 上下間距 */
}
/* SM */
@media (max-width: 767px) {
    .masonry_grid {
        column-count: 1; /* 欄位數 */
    }
}
/* MD */
@media (min-width: 768px) {
    .masonry_grid {
        column-count: 2; /* 欄位數 */
    }
}
/* LG */
@media (min-width: 992px) {
    .masonry_grid {
        column-count: 3; /* 欄位數 */
    }
}
/* XL */
@media (min-width: 1200px) {
    .masonry_grid {
        column-count: 3; /* 欄位數 */
    }
}
.masonry_grid.is-collapsed {
    column-count: auto; /* 關閉瀑布流特性 */
    display: grid; /* 啟動網格排版 */
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start; /* 保持卡片原始高度，不強制拉伸 */
}
@media (min-width: 768px) {
    .masonry_grid.is-collapsed {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 992px) {
    .masonry_grid.is-collapsed {
        grid-template-columns: repeat(3, 1fr);
    }
}
.masonry_grid.is-collapsed > div {
    margin-bottom: 0; /* Grid 已經有 gap，不需要下邊距 */
}
