﻿@charset "UTF-8";
/* theme2026/motion.css
 * 2026 新版前台：低干擾的閱讀動畫。
 * 參考 Motion Library：#125 柔和上浮、#126 逐行淡入、#162 連結底線滑入、
 *   #286 螢光筆劃記、#117 導覽列捲動縮小、#112 卡片浮起、
 *   #206 手風琴問答、#211 回到頂部進度環、#289 表格十字高亮。
 * 需搭配 base.css（色彩變數）與 motion.js。
 * 原則：預設內容可見；JS 準備好才加 will-reveal；尊重 prefers-reduced-motion。
 */

/* ---------- #125 柔和上浮 ---------- */
/* 元素依閱讀順序從下方 18px 輕輕浮上淡入，沒有彈跳也沒有縮放。
   進場只播一次，由 motion.js 的 IntersectionObserver 加 .is-visible。 */
[data-reveal]:not([data-reveal="lines"]).will-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .9s cubic-bezier(.22, .61, .36, 1),
                transform .9s cubic-bezier(.22, .61, .36, 1);
    transition-delay: var(--reveal-delay, 0s);
}

    [data-reveal]:not([data-reveal="lines"]).will-reveal.is-visible {
        opacity: 1;
        transform: none;
    }

/* ---------- #126 逐行淡入 ---------- */
/* 文章內文的每段／標題／圖表依序從微模糊變清楚，間隔 0.28s 接近閱讀速度。 */
[data-reveal="lines"].will-reveal > * {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(4px);
    transition: opacity 1.1s ease-out,
                transform 1.1s ease-out,
                filter 1.1s ease-out;
    transition-delay: calc(var(--line-index, 0) * .28s);
}

    [data-reveal="lines"].will-reveal.is-visible > * {
        opacity: 1;
        transform: none;
        filter: none;
    }

/* ---------- #162 連結底線滑入 ---------- */
/* 滑過時底線從左長出，移開時往右收走，讓「哪裡可以點」更清楚。 */
.sjy-link {
    position: relative;
}

    .sjy-link::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -2px;
        height: 1px;
        background: currentColor;
        opacity: .42;
        transform: scaleX(0);
        transform-origin: right center;
        transition: transform .45s cubic-bezier(.7, 0, .2, 1);
        pointer-events: none;
    }

    .sjy-link:hover::after,
    .sjy-link:focus-visible::after {
        transform: scaleX(1);
        transform-origin: left center;
        opacity: .72;
    }

/* ---------- #286 螢光筆劃記 ---------- */
/* 文章重點詞（mark／JS 標記的 strong）滑過時，背後由左劃過一道淡金色帶。 */
.articleDetial-con mark,
.articleDetial-con .hl-mark,
.faq-a mark,
.faq-a .hl-mark {
    background-image: linear-gradient(transparent 58%,
                                      rgba(179, 138, 73, .22) 58%,
                                      rgba(179, 138, 73, .22) 96%,
                                      transparent 96%);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 100%;
    transition: background-size .55s ease;
}

    .articleDetial-con mark:hover,
    .articleDetial-con mark:focus-visible,
    .articleDetial-con .hl-mark:hover,
    .articleDetial-con .hl-mark:focus-visible,
    .faq-a mark:hover,
    .faq-a .hl-mark:hover {
        background-size: 100% 100%;
    }

/* ---------- #117 導覽列捲動縮小 ---------- */
/* 往下捲時導覽列變矮、Logo 縮小，加上毛玻璃與淡陰影；只在桌機版作用。 */
.site-header {
    transition: background-color .35s ease,
                box-shadow .35s ease,
                border-color .35s ease;
}

    .site-header .nav,
    .site-header .brand img {
        transition: padding .35s ease, height .35s ease;
    }

@media (min-width: 981px) {
    .site-header.is-scrolled {
        background-color: rgba(255, 254, 250, .98);
        box-shadow: 0 4px 18px rgba(46, 53, 46, .06);
    }

        .site-header.is-scrolled .nav {
            padding-top: 8px;
            padding-bottom: 8px;
        }

        .site-header.is-scrolled .brand img {
            height: 34px;
        }
}

/* ---------- #112 卡片浮起 ---------- */
/* 文章推薦商品、大哉問卡、人生課題卡：hover 上浮、陰影加深，不換版面。 */
.sjy-lift {
    transition: transform .45s cubic-bezier(.2, .7, .2, 1),
                box-shadow .45s cubic-bezier(.2, .7, .2, 1);
}

    .sjy-lift:hover {
        transform: translateY(-6px);
        box-shadow: 0 18px 34px -16px rgba(46, 53, 46, .22);
    }

/* ---------- #206 手風琴問答 ---------- */
/* 用 grid-template-rows 0fr→1fr 平滑展開，一次只開一題。
   JS 會在 .faq-list 上加 .sjy-accordion、在 q 上加 role/tabindex/aria-expanded。 */
.faq-list.sjy-accordion .faq-q {
    position: relative;
    padding-right: 3em;
    cursor: pointer;
    user-select: none;
}

    .faq-list.sjy-accordion .faq-q::after {
        content: "+";
        position: absolute;
        right: 1.2em;
        top: 50%;
        transform: translateY(-50%);
        color: var(--green-dark);
        font-size: 20px;
        line-height: 1;
        transition: transform .3s ease;
    }

    .faq-list.sjy-accordion .faq-q:focus-visible {
        outline: 2px solid var(--green);
        outline-offset: -2px;
    }

.faq-list.sjy-accordion li.sjy-acc-open .faq-q::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-list.sjy-accordion .faq-a {
    display: grid;
    grid-template-rows: 0fr;
    padding: 0 1.5em 0 3.5em;
    opacity: 0;
    transition: grid-template-rows .45s ease,
                padding .45s ease,
                opacity .3s ease;
}

    .faq-list.sjy-accordion .faq-a > * {
        overflow: hidden;
        min-height: 0;
    }

.faq-list.sjy-accordion li.sjy-acc-open .faq-a {
    grid-template-rows: 1fr;
    padding: 0 1.5em 1.8em 3.5em;
    opacity: 1;
}

/* ---------- #211 回到頂部進度環 ---------- */
/* 只在長文章頁由 JS 產生；外圈隨整頁捲動比例畫滿。 */
.sjy-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 40;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--green-dark);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
}

    .sjy-to-top.show {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .sjy-to-top svg {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        transform: rotate(-90deg);
    }

    .sjy-to-top circle {
        fill: none;
        stroke-width: 2.5;
    }

    .sjy-to-top .track {
        stroke: rgba(78, 102, 89, .18);
    }

    .sjy-to-top .bar {
        stroke: var(--green-dark);
        stroke-linecap: round;
        stroke-dasharray: 119.38;
        stroke-dashoffset: 119.38;
        transition: stroke-dashoffset .15s linear;
    }

    .sjy-to-top .arrow {
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        font-size: 17px;
        line-height: 1;
    }

    .sjy-to-top:focus-visible {
        outline: 2px solid var(--green);
        outline-offset: 3px;
    }

@media (max-width: 680px) {
    .sjy-to-top {
        right: 12px;
        bottom: 14px;
        width: 40px;
        height: 40px;
    }
}

/* ---------- #289 表格十字高亮 ---------- */
/* 滑過表格任一格時，整列與整欄淡淡亮起，該格再深一點，方便對照。 */
.sjy-table-x tr.row-hl > td,
.sjy-table-x td.col-hl {
    background-color: rgba(179, 138, 73, .10) !important;
}

    .sjy-table-x td.cell-hl {
        background-color: rgba(179, 138, 73, .22) !important;
        font-weight: 600;
    }

/* ---------- 減少動態效果 ---------- */
@media (prefers-reduced-motion: reduce) {
    [data-reveal].will-reveal,
    [data-reveal].will-reveal.is-visible,
    [data-reveal="lines"].will-reveal > *,
    [data-reveal="lines"].will-reveal.is-visible > * {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }

    .site-header,
    .site-header .nav,
    .site-header .brand img,
    .sjy-lift,
    .sjy-link::after,
    .faq-list.sjy-accordion .faq-a,
    .faq-list.sjy-accordion .faq-q::after,
    .sjy-to-top,
    .sjy-to-top .bar,
    .articleDetial-con mark,
    .articleDetial-con .hl-mark {
        transition: none !important;
    }
}
