/* =========================================================================
   中文版型 01：首頁 — 區塊樣式（S1～S6）
   數值來源：Figma「01-首頁」Copy as code → CSS（all layers）；變數定義在 site.css。
   ========================================================================= */

/* ---------- S1 首屏輪播：高 750px、內距 128px 80px 40px ---------- */
/* 版面分兩列：上方舞台（文字）＋下方底列（縮圖與操作）。照片鋪滿兩列；影片項只鋪舞台列（02H-03 v0.3） */
.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 750px;
    overflow: hidden;
    background: var(--color-placeholder);
}

.hero__slides {
    position: relative;
    grid-row: 1 / -1;
    grid-column: 1;
}

.hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--motion-slow) var(--motion-ease), visibility 0s linear var(--motion-slow);
}

.hero__slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--motion-slow) var(--motion-ease), visibility 0s linear 0s;
}

.hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 文字壓在照片上：左側加淺色漸層以維持對比（Figma 線框為灰底，未定義；工程端補上） */
.hero__slides::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.75) 40%, rgba(255, 255, 255, 0) 75%);
    pointer-events: none;
}

.hero__inner {
    position: relative;
    grid-row: 1;
    grid-column: 1;
    width: 100%;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 128px var(--gutter) 40px;
}

.hero__bottom {
    position: relative;
    grid-row: 2;
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 var(--gutter) 40px;
}

.hero__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
}

/* 主標：54px / 700 / 行高 115% */
.hero__title {
    color: var(--color-ink);
    font-size: 54px;
    font-weight: 700;
    line-height: 1.15;
}

.hero__title-line {
    display: block;
}

.hero__intro {
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.8;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

/* 縮圖列：每張 160×90、間距 16px；寬度 512px（一次 3 張），其餘橫向捲動 */
.hero__thumbs {
    display: flex;
    gap: 16px;
    max-width: 512px;
    overflow-x: auto;
    scrollbar-width: none;
}

.hero__thumbs::-webkit-scrollbar {
    display: none;
}

.hero__thumb {
    flex: 0 0 160px;
    height: 90px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: var(--radius-small);
    background: #B0B8C4;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease);
}

.hero__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__thumb:hover,
.hero__thumb[aria-pressed="true"] {
    opacity: 1;
}

.hero__thumb[aria-pressed="true"] {
    border-color: var(--color-ink);
}

/* 底列：左側影片連結（待影片欄位）、右側上一張／暫停／下一張，間距 8px */
.hero__bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-top: auto;
}

.hero__controls {
    display: flex;
    gap: 8px;
    margin-left: auto;              /* v0.03_T04：照片與影片都固定靠右，不因左側影片連結出現與否而移動 */
}

.hero__controls .round-button {
    background: rgba(255, 255, 255, 0.6);
}

.round-button__play {
    display: none;
}

.hero.is-paused .round-button__pause {
    display: none;
}

.hero.is-paused .round-button__play {
    display: inline;
}

/* ---------- S1 影片項（v0.03_T04，2026-11-26 會議第 4、6 項；依 DEMO 呈現，Figma 無影片版面） ----------
   影片與照片用同一個版面：播放器與照片同大小、文字與漸層同樣疊在上面，縮圖與上一張／暫停／下一張留在原位，切換時位置不變。
   iframe 與播放器同大小、不放大裁切，影片比例不同時由 YouTube 自行補黑邊（畫面完整不截斷）；不顯示 YouTube 控制列，
   播放器不攔截點擊（只當畫面），操作一律用首屏自己的按鈕。 */
.hero__slide--video {
    background: #000000;
}

.hero__player {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #000000;
}

.hero__poster,
.hero__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.hero__frame {
    pointer-events: none;
}

.hero__poster {
    object-fit: cover;
}
/* 影片項的縮圖標記 */
.hero__thumb {
    position: relative;
}

.hero__thumb-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    padding-left: 2px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--color-ink);
    font-size: 14px;
    transform: translate(-50%, -50%);
}

/* 底列左側：暫停影片・顯示照片／觀看完整影片（Figma：14px、行高 160%、#666666） */
.hero__media-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

/* v0.03_T04：照片時影片連結只隱藏、保留位置（visibility 隱藏同樣不可點、不進 Tab、輔助科技不讀），
   底列與首屏高度在照片與影片間不變，上一張／下一張不跳動 */
.hero__media-links[hidden] {
    display: flex !important;       /* 蓋過 site.css 全站的 [hidden] { display: none !important; }（本選擇器較精確） */
    visibility: hidden;
}

.hero__media-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-muted);
    font: inherit;
    font-size: 14px;
    line-height: 1.6;
    text-decoration: none;
    cursor: pointer;
}

.hero__media-link:hover {
    color: var(--color-ink);
    text-decoration: underline;
}

/* 無 JavaScript 備援：列出影片的完整影片連結；有 JavaScript 時隱藏 */
.hero__video-list {
    display: none;
}

.no-js .hero__video-list {
    display: block;
    padding: 0;
    list-style: none;
}

.hero__video-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--color-ink);
    font-size: 14px;
    text-decoration: underline;
}

/* ---------- S2 產品介紹：卡片 320×420、一屏 4 張、無間距 ---------- */
/* v0.03：產品資料來源為樣本時，標題下方 14px 小字「樣本資料」（正常文流，不覆蓋卡片） */
.products__sample-notice {
    margin: 8px 0 0;
    color: var(--color-muted);
    font-size: 14px;
    line-height: 1.6;
}

.products__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.products__viewport::-webkit-scrollbar {
    display: none;
}

.products__track {
    display: flex;
}

.products__item {
    flex: 0 0 25%;
    scroll-snap-align: start;
}

.product-card {
    position: relative;
    display: block;
    aspect-ratio: 320 / 420;
    overflow: hidden;
    background: var(--color-subtle);
    color: var(--color-white);
    text-decoration: none;
}

.product-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 暗化遮罩：預設 35%，滑過 15% */
.product-card__shade {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    transition: background-color var(--motion-fast) var(--motion-ease);
}

/* 內容：內距 156px 16px 19px，分類名稱置中、箭頭貼底 */
.product-card__body {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 156px 16px 19px;
    text-align: center;
}

.product-card__name {
    font-size: 28px;
    font-weight: 500;
    line-height: 1.4;
}

.product-card__arrow {
    font-size: 24px;
    line-height: 1.4;
    transition: transform var(--motion-fast) var(--motion-ease);
}

.product-card:hover .product-card__shade,
.product-card:focus-visible .product-card__shade {
    background: rgba(0, 0, 0, 0.15);
}

/* 滑過時箭頭右移 8px */
.product-card:hover .product-card__arrow,
.product-card:focus-visible .product-card__arrow {
    transform: translateX(8px);
}

.product-card:focus-visible {
    outline: 3px solid var(--color-ink);
    outline-offset: -3px;
}

/* ---------- S3 AI 驅動專區：左文 632px、右圖 632×510 ---------- */
.ai__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: center;
}

.ai__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
}

.ai__text .section-title {
    margin-top: 0;
}

.ai__intro {
    font-size: 16px;
    line-height: 1.8;
}

.ai__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* 說明區固定高度，切換頁籤時下方連結不跳動 */
.js .ai__details {
    min-height: 58px;
}

.ai__detail {
    font-size: 16px;
    line-height: 1.8;
}

.js .ai__detail {
    display: none;
}

.js .ai__detail.is-active {
    display: block;
}

.js .ai__detail-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.ai__detail-label {
    font-weight: 500;
}

.ai__media {
    position: relative;
    aspect-ratio: 632 / 510;
    overflow: hidden;
    background: var(--color-media);
}

.ai__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--motion-slow) var(--motion-ease), visibility 0s linear var(--motion-slow);
}

/* 未選的圖片淡出後設為 visibility: hidden（無 JavaScript 時的保障）；
   有 JavaScript 時切換當下即由 home.js 加 aria-hidden，淡出期間報讀軟體也只讀到目前頁籤的圖片 */
.ai__image.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--motion-slow) var(--motion-ease), visibility 0s linear 0s;
}

/* ---------- S4 六大核心入口：卡片 416×320、內距 32px、底色 #F0F2F5、圓角 8px ---------- */
.missions__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.mission-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    min-height: 320px;
    height: 100%;
    padding: 32px;
    border-radius: var(--radius-card);
    background: var(--color-card);
    color: var(--color-ink);
    text-decoration: none;
    transition: background-color var(--motion-fast) var(--motion-ease);
}

.mission-card:hover {
    background: #E6E9EE;
}

.mission-card__top {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mission-card__number {
    color: var(--color-subtle);
    font-size: 14px;
    line-height: 1.6;
}

/* 圖示底框 48×48、圓角 8px */
.mission-card__icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-card);
    background: var(--color-placeholder);
}

.mission-card__icon svg {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mission-card__title {
    font-size: 24px;
    font-weight: 500;
    line-height: 1.4;
}

.mission-card__desc {
    color: var(--color-muted);
    font-size: 14px;
    line-height: 1.6;
}

.mission-card__more {
    font-size: 14px;
    line-height: 1.6;
}

.mission-card:hover .mission-card__more {
    text-decoration: underline;
}

/* ---------- S5 最新消息：左欄 416px、右列表 848px；每列高 160px ---------- */
.news__grid {
    display: grid;
    grid-template-columns: 416fr 848fr;
    gap: 16px;
    align-items: start;
}

.news__head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
}

.news__head .section-title {
    margin-top: 0;
}

.news__intro {
    font-size: 16px;
    line-height: 1.8;
}

.news__item + .news__item {
    border-top: 1px solid var(--color-border);
}

.news-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 24px;
    min-height: 160px;
    padding: 24px;
    color: var(--color-ink);
    text-decoration: none;
}

.news-row__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.news-row__day {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
}

.news-row__month {
    color: var(--color-subtle);
    font-size: 14px;
    line-height: 1.6;
}

.news-row__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

/* 標題 24px / 500，超過兩行以刪節號截斷 */
.news-row__title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.news-row__arrow {
    color: var(--color-subtle);
    font-size: 24px;
    line-height: 1.4;
    transition: transform var(--motion-fast) var(--motion-ease);
}

.news-row:hover .news-row__title {
    text-decoration: underline;
}

.news-row:hover .news-row__arrow {
    transform: translateX(8px);
}

/* ---------- S6 看見科技：內距 120px 80px 80px；右側影片 632×420 ---------- */
.film {
    padding-bottom: 80px;
}

.film__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: center;
}

.film__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
}

.film__text .section-title {
    margin-top: 0;
}

/* 影片區：封面與播放器共用同一個 632×420 比例的框，點播後播放器取代封面，版面不跳動 */
.film__media {
    position: relative;
    aspect-ratio: 632 / 420;
    overflow: hidden;
    background: var(--color-media);
}

.film__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.film__poster {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 632 / 420;
    overflow: hidden;
    background: var(--color-media);
    text-decoration: none;
}

.film__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 播放鈕：80×80、白 60%、外框 1px #BFC7CF */
.film__play {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    padding-left: 4px;
    border: 1px solid #BFC7CF;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--color-text);
    font-size: 32px;
    line-height: 1;
    transition: transform var(--motion-fast) var(--motion-ease), background-color var(--motion-fast) var(--motion-ease);
}

.film__poster:hover .film__play {
    background: rgba(255, 255, 255, 0.85);
    transform: scale(1.06);
}

/* ---------- 響應式（工程端暫定） ---------- */
@media (max-width: 1023px) {
    .hero {
        min-height: 620px;
    }

    .hero__inner {
        padding-top: 96px;
    }

    .hero__title {
        font-size: 44px;
    }

    .products__item {
        flex-basis: 50%;
    }

    .ai__grid,
    .film__grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .missions__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .news__grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 767px) {
    .hero {
        min-height: 560px;
    }

    .hero__inner {
        padding-top: 56px;
        padding-bottom: 32px;
    }

    .hero__bottom {
        gap: 32px;
        padding-bottom: 24px;
    }

    .hero__slides::after {
        background: rgba(255, 255, 255, 0.82);
    }

    .hero__title {
        font-size: 34px;
    }

    .hero__actions .button--ghost {
        padding-left: 0;
        padding-right: 0;
    }

    .hero__thumbs {
        max-width: 100%;
    }

    .hero__thumb {
        flex-basis: 120px;
        height: 68px;
    }

    /* v0.03_T04 修正1（H-T04-01）：手機寬度影片連結獨佔一列、不換行、固定高度；
       暫停後按鈕換字（「播放影片」）或隱藏時底列高度不變，縮圖與上一張／下一張不跳動 */
    .hero__bar {
        flex-wrap: wrap;
        justify-content: flex-end;
        row-gap: 8px;
    }

    .hero__media-links {
        flex: 1 0 100%;
        flex-wrap: nowrap;
        height: 44px;
        white-space: nowrap;
    }

    .products__item {
        flex-basis: 80%;
    }

    .product-card__body {
        padding-top: 45%;
    }

    .product-card__name {
        font-size: 24px;
    }

    .missions__grid {
        grid-template-columns: 1fr;
    }

    .mission-card {
        min-height: 240px;
        padding: 24px;
    }

    .mission-card__title {
        font-size: 20px;
    }

    .news-row {
        grid-template-columns: 56px minmax(0, 1fr) 16px;
        gap: 16px;
        min-height: 0;
        padding: 20px 0;
    }

    .news-row__day {
        font-size: 28px;
    }

    .news-row__month {
        font-size: 12px;
    }

    .news-row__title {
        font-size: 18px;
    }

    .news-row__arrow {
        font-size: 18px;
    }

    .film__play {
        width: 64px;
        height: 64px;
        font-size: 26px;
    }
}
