/* =========================================================
   首頁「關於」右欄：精簡簡介＋技術收合（2026-11-26）
   動畫只在 js/home_about.js 加上 .anim-ready／.toggle-ready 後才生效，
   JS 沒載入時內容照常全部顯示。
   ========================================================= */

/* 首頁版不包面板（bare）：標題上方不留空 */
.home-intro.is-bare .home-lead { margin-top: 0; }

/* ---------- 標題：逐字打出 ---------- */
.home-lead {
    margin: 6px 0 18px;
    min-height: 1.35em;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 900;
    line-height: 1.35;
    letter-spacing: .5px;
    color: #f1f5f9;
}
.home-lead-name {
    color: var(--accent, #00d9ff);
    text-shadow: 0 0 18px rgba(0, 217, 255, .55);
}
.home-lead-caret {
    display: inline-block;
    width: 3px;
    height: 1em;
    margin-left: 6px;
    vertical-align: -.12em;
    background: var(--accent, #00d9ff);
    box-shadow: 0 0 10px var(--accent, #00d9ff);
    animation: homeCaret 1s step-end infinite;
}
.home-lead.is-typing .home-lead-caret { animation: none; }
@keyframes homeCaret { 50% { opacity: 0; } }

/* ---------- 段落與標籤依序淡入 ---------- */
.home-intro.anim-ready .home-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .7s ease, transform .7s cubic-bezier(.16, 1, .3, 1);
    transition-delay: calc(1.5s + var(--d, 0) * .2s);
}
.home-intro.anim-ready.is-revealed .home-reveal {
    opacity: 1;
    transform: none;
}

/* 重點字：底線由左往右畫出 */
.home-intro .intro-content strong {
    background: linear-gradient(rgba(251, 191, 36, .45), rgba(251, 191, 36, .45)) no-repeat 0 100% / 100% 2px;
}
.home-intro.anim-ready .intro-content strong {
    background-size: 0 2px;
    transition: background-size .8s ease calc(2s + var(--d, 0) * .2s);
}
.home-intro.anim-ready.is-revealed .intro-content strong { background-size: 100% 2px; }

/* ---------- 快速認識 ---------- */
.home-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed rgba(255, 255, 255, .14);
}
.home-facts-label {
    margin-right: 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #38bdf8;
}
.home-fact { padding: 6px 14px; font-size: 13px; }
.home-fact i { margin-right: 4px; font-size: 12px; color: #38bdf8; }

/* 逐一彈出＋掃光（用 translate/scale，不影響原本 hover 的 transform） */
.home-intro.anim-ready .home-fact { opacity: 0; translate: 0 10px; scale: .92; }
.home-intro.anim-ready.is-revealed .home-fact {
    animation: homeFactIn .55s cubic-bezier(.34, 1.56, .64, 1) forwards;
    animation-delay: calc(2.1s + var(--i, 0) * .12s);
}
.home-intro.anim-ready.is-revealed .home-fact::before {
    animation: homeSweep 1s ease;
    animation-delay: calc(2.5s + var(--i, 0) * .12s);
}
@keyframes homeFactIn { to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes homeSweep { from { left: -100%; } to { left: 100%; } }

/* ---------- 技術收合 ---------- */
.tech-toggle { display: none; }
.tech-stack.toggle-ready .tech-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding: 10px 20px;
    border-radius: 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #e2f7ff;
    background: var(--surface-chip);
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
    cursor: pointer;
    transition: border-color .25s, box-shadow .25s, transform .25s, background .25s;
}
.tech-stack.toggle-ready .tech-toggle:hover {
    background: var(--surface-hover-tint);
    border-color: var(--surface-border-hover);
    box-shadow: var(--surface-shadow-hover);
    transform: translateY(-2px);
}
.tech-toggle:focus-visible { outline: 2px solid #00d9ff; outline-offset: 3px; }
.tech-toggle i { color: #38bdf8; transition: transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.tech-stack.is-open .tech-toggle i { transform: rotate(180deg); }

/* 未展開時按鈕呼吸光暈，提示還有更多 */
.tech-stack.toggle-ready:not(.is-open) .tech-toggle { animation: homePulse 2.6s ease-in-out infinite; }
@keyframes homePulse {
    50% { box-shadow: 0 0 0 4px rgba(0, 217, 255, .12), 0 0 18px rgba(0, 217, 255, .35); }
}

/* 收合區：高度平滑展開（grid 0fr → 1fr） */
.tech-more {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: -22px;            /* 抵銷 .tech-categories 的 gap，收合時不留空 */
    opacity: 0;
    transition: grid-template-rows .6s cubic-bezier(.16, 1, .3, 1), margin-top .6s, opacity .4s;
}
.tech-stack.is-open .tech-more { grid-template-rows: 1fr; margin-top: 0; opacity: 1; }
.tech-more-inner {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-height: 0;
    overflow: hidden;
}
/* 展開時標籤一顆顆浮現 */
.tech-stack.is-open .tech-more .category-title,
.tech-stack.is-open .tech-more .tech-item {
    animation: homeChipIn .45s cubic-bezier(.34, 1.56, .64, 1) both;
    animation-delay: calc(.15s + var(--i, 0) * 22ms);
}
@keyframes homeChipIn { from { opacity: 0; translate: 0 12px; scale: .9; } }

/* ---------- 減少動態效果 ---------- */
@media (prefers-reduced-motion: reduce) {
    .home-intro.anim-ready .home-reveal,
    .home-intro.anim-ready .home-fact { opacity: 1; transform: none; translate: none; scale: none; transition: none; animation: none; }
    .home-intro.anim-ready .intro-content strong { background-size: 100% 2px; transition: none; }
    .home-lead-caret,
    .tech-stack.toggle-ready .tech-toggle,
    .tech-stack.is-open .tech-more .category-title,
    .tech-stack.is-open .tech-more .tech-item { animation: none !important; }
    .tech-more { transition: none; }
}

/* =========================================================
   首頁右欄：專業領域（2026-11-27，只作用在 .home-expertise，關於頁不受影響）
   卡片大小與樣式維持原本（index-about.css），只加動畫：
   進場依序翻起＋圖示彈出；滑過時光暈跟著游標、底線由左往右畫出
   ========================================================= */
.home-expertise .expertise-cards {
    perspective: 900px;
    opacity: 1 !important;          /* 外層面板已有 AOS，內層不再重複淡入 */
    transform: none !important;
}
/* 光暈跟著游標（位置由 js/home_about.js 設定 --mx／--my） */
.home-expertise .expertise-card.card::before {
    background: radial-gradient(160px circle at var(--mx, 100%) var(--my, 0%), rgba(0, 217, 255, .16), transparent 70%);
}
/* 底線：滑過時由左往右畫出 */
.home-expertise .card-glow { opacity: 1; transform: scaleX(0); transform-origin: left; transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
.home-expertise .expertise-card:hover .card-glow { transform: scaleX(1); }

/* 進場（JS 加 .anim-ready 才生效） */
.home-expertise.anim-ready .expertise-card { opacity: 0; translate: 0 20px; rotate: x 18deg; }
.home-expertise.anim-ready.is-revealed .expertise-card {
    animation: homeCardIn .8s cubic-bezier(.16, 1, .3, 1) forwards;
    animation-delay: calc(.3s + var(--i, 0) * .1s);
}
.home-expertise.anim-ready.is-revealed .card-icon {
    animation: homeIconPop .6s cubic-bezier(.34, 1.56, .64, 1) both;
    animation-delay: calc(.6s + var(--i, 0) * .1s);
}
@keyframes homeCardIn { to { opacity: 1; translate: 0 0; rotate: x 0deg; } }
@keyframes homeIconPop { from { opacity: 0; scale: .4; } }

/* ---------- 專業領域：動畫強化（2026-11-27） ---------- */
/* 1. 進場後每張卡掃過一道光；滑過時再掃一次 */
.home-expertise .expertise-card.card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(0, 217, 255, .22) 50%, transparent 70%);
    translate: -120% 0;
    pointer-events: none;
}
.home-expertise.is-revealed .expertise-card.card::after {
    animation: homeSheen 1.1s ease forwards;
    animation-delay: calc(.9s + var(--i, 0) * .1s);
}
.home-expertise .expertise-card.card:hover::after { animation: homeSheenHover .9s ease; }
@keyframes homeSheen { to { translate: 120% 0; } }
@keyframes homeSheenHover { from { translate: -120% 0; } to { translate: 120% 0; } }

/* 2. 圖示待機呼吸光（依序錯開）；滑過時改成搖一下 */
.home-expertise.is-revealed .card-icon i {
    animation: homeBreath 3.2s ease-in-out infinite;
    animation-delay: calc(1.8s + var(--i, 0) * .45s);
}
.home-expertise .expertise-card:hover .card-icon i { animation: homeWiggle .6s ease; }
@keyframes homeBreath { 50% { scale: 1.1; filter: drop-shadow(0 0 6px rgba(0, 217, 255, .9)); } }
@keyframes homeWiggle { 25% { rotate: -14deg; } 50% { rotate: 10deg; } 75% { rotate: -5deg; } }

/* 3. 滑過時卡片跟著游標微微傾斜（角度由 js/home_about.js 設定 --rx／--ry），標題右移 */
.home-expertise .expertise-card.card:hover {
    transform: perspective(700px) translateY(-4px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform .15s ease-out, border-color .35s, background .35s;
}
.home-expertise .card-text h3 { transition: color .3s, translate .3s; }
.home-expertise .expertise-card:hover .card-text h3 { translate: 3px 0; }

@media (prefers-reduced-motion: reduce) {
    .home-expertise.anim-ready .expertise-card { opacity: 1; translate: none; rotate: none; animation: none !important; }
    .home-expertise .card-icon,
    .home-expertise .card-icon i,
    .home-expertise .expertise-card.card::after { animation: none !important; }
    .home-expertise .expertise-card.card:hover { transform: translateY(-4px); }
}

/* =========================================================
   首頁左欄：聯絡按鈕＋座右銘動畫（2026-11-27，只作用在 .home-left，關於頁不受影響）
   樣式大小維持原本（index-about.css），只加動畫；JS 加 .anim-ready 才生效
   ========================================================= */
/* ---- 聯絡按鈕 ---- */
/* 進場：依序彈出（fill 用 backwards，結束後不蓋掉 hover 的位移） */
.home-left.anim-ready:not(.is-revealed) .contact-btn { opacity: 0; }
.home-left.anim-ready.is-revealed .contact-btn {
    animation: homeBtnIn .6s cubic-bezier(.34, 1.56, .64, 1) backwards;
    animation-delay: calc(.2s + var(--i, 0) * .12s);
}
@keyframes homeBtnIn { from { opacity: 0; translate: 0 14px; scale: .85; } }

/* 待機：品牌圖示輪流發光 */
.home-left.is-revealed .contact-btn i {
    animation: homeIconGlow 3.6s ease-in-out infinite;
    animation-delay: calc(1.2s + var(--i, 0) * 1.2s);
}
@keyframes homeIconGlow { 0%, 30%, 100% { filter: none; } 15% { filter: drop-shadow(0 0 7px currentColor); } }

/* 滑過：磁吸跟著游標（--tx／--ty 由 JS 設定）、掃光、圖示彈跳 */
.home-left .contact-btn:hover { translate: var(--tx, 0) var(--ty, 0); }
.home-left .contact-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
    translate: -120% 0;
    pointer-events: none;
}
.home-left .contact-btn:hover::after { animation: homeSheenHover .8s ease; }
.home-left .contact-btn:hover i { animation: homeBounce .6s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes homeBounce { 30% { translate: 0 -5px; } 60% { translate: 0 1px; } }

/* ---- 座右銘 ---- */
/* 進場：文字逐字由模糊浮現（JS 會把字拆成 .motto-char） */
.motto-char { display: inline-block; }
.home-left.anim-ready:not(.is-revealed) .motto-char,
.home-left.anim-ready:not(.is-revealed) .motto-text cite,
.home-left.anim-ready:not(.is-revealed) .motto-icon { opacity: 0; }
.home-left.anim-ready.is-revealed .motto-char {
    animation: homeCharIn .7s cubic-bezier(.16, 1, .3, 1) backwards;
    animation-delay: calc(.5s + var(--c, 0) * .07s);
}
@keyframes homeCharIn { from { opacity: 0; translate: 0 .35em; filter: blur(6px); } }

/* 署名：字距由寬收攏 */
.home-left.anim-ready.is-revealed .motto-text cite {
    animation: homeCiteIn 1s cubic-bezier(.16, 1, .3, 1) backwards;
    animation-delay: 1.5s;
}
@keyframes homeCiteIn { from { opacity: 0; letter-spacing: .6em; } }

/* 引號：從兩側滑入，之後緩慢漂浮 */
.home-left.anim-ready.is-revealed .motto-icon {
    animation: homeQuoteIn .9s cubic-bezier(.16, 1, .3, 1) backwards;
    animation-delay: .3s;
}
.home-left.anim-ready.is-revealed .motto-icon-right { animation-name: homeQuoteInR; }
@keyframes homeQuoteIn { from { opacity: 0; translate: -24px 0; } }
@keyframes homeQuoteInR { from { opacity: 0; translate: 24px 0; } }
.home-left.is-revealed .motto-icon i { display: inline-block; animation: homeFloat 4s ease-in-out infinite 1.4s; }
.home-left.is-revealed .motto-icon-right i { animation-delay: 3.4s; }
@keyframes homeFloat { 50% { translate: 0 -5px; } }

/* 滑過：文字像波浪一樣跳一輪 */
.home-left .motto-section:hover .motto-char {
    animation: homeWave .6s ease;
    animation-delay: calc(var(--c, 0) * .035s);
}
@keyframes homeWave { 40% { translate: 0 -4px; color: #7eeaff; } }

@media (prefers-reduced-motion: reduce) {
    .home-left.anim-ready .contact-btn,
    .home-left.anim-ready .motto-char,
    .home-left.anim-ready .motto-text cite,
    .home-left.anim-ready .motto-icon { opacity: 1 !important; }
    .home-left .contact-btn,
    .home-left .contact-btn i,
    .home-left .contact-btn::after,
    .home-left .motto-char,
    .home-left .motto-text cite,
    .home-left .motto-icon,
    .home-left .motto-icon i { animation: none !important; }
    .home-left .contact-btn:hover { translate: none; }
}

/* =========================================================
   關於頁：專業證照＋精選專案與研究（2026-11-28）
   樣式沿用 index-about.css，只修截字並加入與上方區塊同系列的動畫
   ========================================================= */
/* 證照：名稱與說明不再被截成「…」（最多兩行），欄數依寬度自動排 */
#about .home-certs .cert-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); perspective: 900px; }
#about .home-certs .cert-info h4,
#about .home-certs .cert-info .cert-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    text-overflow: clip;
}
@media (max-width: 576px) { #about .home-certs .cert-grid { grid-template-columns: 1fr; } }

/* 共用：滑過時光暈跟著游標（--mx／--my 由 JS 設定）＋掃光；進場後自動掃一次 */
.home-certs .cert-item.card,
.home-works .work-item.card { position: relative; overflow: hidden; }
.home-certs .cert-item.card:hover,
.home-works .work-item.card:hover {
    background: radial-gradient(180px circle at var(--mx, 100%) var(--my, 0%), rgba(0, 217, 255, .14), transparent 70%), var(--surface-panel);
}
.home-certs .cert-item.card::after,
.home-works .work-item.card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(0, 217, 255, .2) 50%, transparent 70%);
    translate: -120% 0;
    pointer-events: none;
}
.home-certs.is-revealed .cert-item.card::after,
.home-works.is-revealed .work-item.card::after {
    animation: homeSheen 1.1s ease forwards;
    animation-delay: calc(.7s + var(--i, 0) * .08s);
}
.home-certs .cert-item.card:hover::after,
.home-works .work-item.card:hover::after { animation: homeSheenHover .9s ease; }

/* 證照：依序翻起、徽章彈出；徽章輪流呼吸發光，滑過時搖一下 */
.home-certs.anim-ready:not(.is-revealed) .cert-item { opacity: 0; }
.home-certs.anim-ready.is-revealed .cert-item {
    animation: homeCertIn .7s cubic-bezier(.16, 1, .3, 1) backwards;
    animation-delay: calc(.15s + var(--i, 0) * .07s);
}
@keyframes homeCertIn { from { opacity: 0; translate: 0 18px; rotate: x 18deg; } }
.home-certs.anim-ready.is-revealed .cert-badge-icon {
    animation: homeIconPop .6s cubic-bezier(.34, 1.56, .64, 1) backwards;
    animation-delay: calc(.4s + var(--i, 0) * .07s);
}
.home-certs.is-revealed .cert-badge-icon > * {
    animation: homeBreath 3.2s ease-in-out infinite;
    animation-delay: calc(1.8s + var(--i, 0) * .35s);
}
.home-certs .cert-item:hover .cert-badge-icon > * { animation: homeWiggle .6s ease; }

/* 精選專案與研究：由左依序滑入、類型標籤彈出；滑過時外連箭頭往右上飛出再回來 */
.home-works.anim-ready:not(.is-revealed) .work-item { opacity: 0; }
.home-works.anim-ready.is-revealed .work-item {
    animation: homeWorkIn .8s cubic-bezier(.16, 1, .3, 1) backwards;
    animation-delay: calc(.2s + var(--i, 0) * .15s);
}
@keyframes homeWorkIn { from { opacity: 0; translate: -28px 0; } }
.home-works.anim-ready.is-revealed .work-type {
    animation: homeIconPop .6s cubic-bezier(.34, 1.56, .64, 1) backwards;
    animation-delay: calc(.5s + var(--i, 0) * .15s);
}
.home-works .work-action-icon i { display: inline-block; }
.home-works .work-item:hover .work-action-icon i { animation: homeArrowOut .6s ease; }
@keyframes homeArrowOut {
    45% { translate: 8px -8px; opacity: 0; }
    46% { translate: -8px 8px; opacity: 0; }
}
.home-works .work-year { transition: color .3s; }
.home-works .work-item:hover .work-year { color: #7eeaff; }

@media (prefers-reduced-motion: reduce) {
    .home-certs.anim-ready .cert-item,
    .home-works.anim-ready .work-item { opacity: 1 !important; }
    .home-certs .cert-item,
    .home-certs .cert-badge-icon,
    .home-certs .cert-badge-icon > *,
    .home-works .work-item,
    .home-works .work-type,
    .home-works .work-action-icon i,
    .home-certs .cert-item.card::after,
    .home-works .work-item.card::after { animation: none !important; }
}

/* =========================================================
   關於頁：職涯經歷時間軸（2026-11-28）
   樣式沿用 index-experience.css，JS 加 .tl-enhanced 後才有以下效果：
   1. 中軸隨捲動被光束填滿，光點在最前端；2. 光束經過的年份點亮、連接線畫出；
   3. 卡片內的公司、標籤、工作項目依序出現，重點字底線畫出；4. 滑過時光暈跟游標＋掃光
   ========================================================= */
.tl-enhanced::before { opacity: .35; }
.tl-progress {
    position: absolute;
    height: 0;
    border-radius: 4px;
    background: linear-gradient(180deg, #00d9ff, #6493fa 60%, #a78bfa);
    box-shadow: 0 0 14px #00d9ff, 0 0 32px rgba(0, 217, 255, .6);
    pointer-events: none;
    z-index: 0;
}
.tl-head {
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e0fbff;
    box-shadow: 0 0 10px #00d9ff, 0 0 26px #00d9ff, 0 0 46px rgba(0, 217, 255, .6);
    translate: -50% 0;
    animation: tlHead 1.6s ease-in-out infinite;
}
@keyframes tlHead { 50% { scale: 1.35; } }

/* 年份：光束經過時點亮，連接線由中軸往卡片畫出 */
.tl-enhanced .timeline-year { transition: scale .5s cubic-bezier(.34, 1.56, .64, 1), box-shadow .5s, border-color .5s; }
.tl-enhanced .timeline-item.is-active .timeline-year {
    scale: 1.06;
    border-color: #00d9ff;
    box-shadow: 0 0 0 4px rgba(0, 217, 255, .12), 0 0 26px rgba(0, 217, 255, .6);
}
.tl-enhanced .timeline-year::before { transition: transform .6s cubic-bezier(.16, 1, .3, 1) .1s; }
.tl-enhanced .timeline-item:nth-child(odd) .timeline-year::before { transform-origin: right center; }
.tl-enhanced .timeline-item:nth-child(even) .timeline-year::before { transform-origin: left center; }
.tl-enhanced .timeline-item:not(.is-active) .timeline-year::before { transform: translateY(-50%) scaleX(0); }

/* 卡片內容依序出現 */
.tl-enhanced .timeline-item:not(.is-in) .company,
.tl-enhanced .timeline-item:not(.is-in) .sub-role-badge,
.tl-enhanced .timeline-item:not(.is-in) .timeline-tasks li { opacity: 0; }
.tl-enhanced .timeline-item.is-in .sub-role-badge {
    animation: homeIconPop .55s cubic-bezier(.34, 1.56, .64, 1) backwards;
    animation-delay: calc(.3s + var(--k, 0) * .1s);
}
.tl-enhanced .timeline-item.is-in .company { animation: tlSlide .6s cubic-bezier(.16, 1, .3, 1) .35s backwards; }
.tl-enhanced .timeline-item.is-in .timeline-tasks li {
    animation: tlSlide .6s cubic-bezier(.16, 1, .3, 1) backwards;
    animation-delay: calc(.5s + var(--k, 0) * .12s);
}
@keyframes tlSlide { from { opacity: 0; translate: 0 12px; } }
.tl-enhanced .timeline-tasks li strong {
    background: linear-gradient(rgba(251, 191, 36, .45), rgba(251, 191, 36, .45)) no-repeat 0 100% / 0 2px;
    transition: background-size .7s ease calc(.8s + var(--k, 0) * .12s);
}
.tl-enhanced .timeline-item.is-in .timeline-tasks li strong { background-size: 100% 2px; }

/* 滑過：光暈跟游標（--mx／--my 由 JS 設定）＋掃光 */
.tl-enhanced .timeline-content:hover {
    background: radial-gradient(260px circle at var(--mx, 100%) var(--my, 0%), rgba(0, 217, 255, .12), transparent 70%), var(--surface-panel);
}
.tl-enhanced .timeline-content::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(0, 217, 255, .16) 50%, transparent 70%);
    translate: -120% 0;
    pointer-events: none;
}
.tl-enhanced .timeline-content:hover::after { animation: homeSheenHover 1s ease; }

/* =========================================================
   關於頁：個人自傳（2026-11-28）
   樣式沿用 index-experience.css，JS 加 .ab-enhanced 後：
   1. 卡片依序浮起，圖示、標題接續出現，重點字底線畫出
   2. 內文段落依序浮現（全文顯示，不收合）
   3. 滑過時光暈跟游標＋掃光、圖示搖一下
   ========================================================= */
/* 自傳內文改靠左對齊：原本左右對齊遇到長英文詞時，會把整行中文字距撐開（如「在 未 來 的 職 涯」） */
#autobiography .autobio-body p,
#autobiography .autobio-body li { text-align: left; }

.ab-enhanced { align-items: stretch; perspective: 1200px; }  /* 同一列兩張卡等高；按鈕固定在卡片底部 */

/* 進場 */
.ab-enhanced .autobio-card:not(.is-in) { opacity: 0; }
.ab-enhanced .autobio-card.is-in { animation: abCardIn .8s cubic-bezier(.16, 1, .3, 1) backwards; animation-delay: calc(var(--col, 0) * .15s); }
@keyframes abCardIn { from { opacity: 0; translate: 0 30px; rotate: x 10deg; } }
.ab-enhanced .autobio-card.is-in .autobio-icon { animation: homeIconPop .6s cubic-bezier(.34, 1.56, .64, 1) backwards; animation-delay: calc(.4s + var(--col, 0) * .15s); }
.ab-enhanced .autobio-card.is-in .autobio-title-wrap { animation: tlSlide .6s cubic-bezier(.16, 1, .3, 1) backwards; animation-delay: calc(.5s + var(--col, 0) * .15s); }

/* 重點字底線畫出（展開的段落展開後才畫） */
.ab-enhanced .autobio-body strong {
    background: linear-gradient(rgba(251, 191, 36, .45), rgba(251, 191, 36, .45)) no-repeat 0 100% / 0 2px;
    transition: background-size .8s ease 1.1s;
}
.ab-enhanced .autobio-card.is-in .autobio-body strong { background-size: 100% 2px; }

/* 內文段落依序浮現 */
.ab-enhanced .autobio-card.is-in .autobio-body > * {
    animation: tlSlide .6s cubic-bezier(.16, 1, .3, 1) backwards;
    animation-delay: calc(.6s + var(--col, 0) * .15s + var(--k, 0) * .12s);
}

/* 滑過：光暈跟游標＋掃光、圖示搖一下 */
.ab-enhanced .autobio-card { position: relative; overflow: hidden; }
.ab-enhanced .autobio-card:hover {
    background: radial-gradient(300px circle at var(--mx, 100%) var(--my, 0%), rgba(0, 217, 255, .1), transparent 70%), var(--surface-panel);
}
.ab-enhanced .autobio-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(0, 217, 255, .12) 50%, transparent 65%);
    translate: -120% 0;
    pointer-events: none;
}
.ab-enhanced .autobio-card:hover::after { animation: homeSheenHover 1.1s ease; }
.ab-enhanced .autobio-icon i { display: inline-block; }
.ab-enhanced .autobio-card:hover .autobio-icon i { animation: homeWiggle .6s ease; }

@media (prefers-reduced-motion: reduce) {
    .ab-enhanced .autobio-card:not(.is-in) { opacity: 1; }
    .ab-enhanced .autobio-card,
    .ab-enhanced .autobio-card *,
    .ab-enhanced .autobio-card::after { animation: none !important; }
}

/* ---------- 個人自傳：重點摘要句＋主題分頁（2026-11-28） ---------- */
/* 分頁模式：一次只顯示一張卡，置中單欄 */
.ab-tabs { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
#autobiography .autobio-card[hidden] { display: none !important; }
.autobio-summary {
    position: relative;
    z-index: 1;
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.7;
    letter-spacing: .3px;
    color: #7eeaff;
}
.ab-enhanced .autobio-card:not(.is-in) .autobio-summary { opacity: 0; }
.ab-enhanced .autobio-card.is-in .autobio-summary {
    animation: tlSlide .6s cubic-bezier(.16, 1, .3, 1) backwards;
    animation-delay: calc(.55s + var(--col, 0) * .15s);
}

.autobio-nav {
    position: relative;
    z-index: 5;
    max-width: 1240px;
    margin: 40px auto 0;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    border-radius: 16px;
    background: rgba(2, 6, 23, .55);
    border: 1px solid var(--surface-border);
    backdrop-filter: var(--surface-blur);
    -webkit-backdrop-filter: var(--surface-blur);
    box-sizing: border-box;
}
.autobio-nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    color: rgba(241, 245, 249, .85);
    text-decoration: none;
    background: var(--surface-chip);
    border: 1px solid transparent;
    transition: color .3s, background .3s, border-color .3s, box-shadow .3s, transform .3s;
}
.autobio-nav-item i { color: #38bdf8; font-size: 13px; transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.autobio-nav-item:hover { color: #fff; border-color: var(--surface-border); transform: translateY(-2px); }
.autobio-nav-item:hover i { transform: scale(1.2) rotate(-8deg); }
.autobio-nav-item:focus-visible { outline: 2px solid #00d9ff; outline-offset: 2px; }
.autobio-nav-item.is-current {
    color: #fff;
    background: var(--surface-hover-tint);
    border-color: var(--surface-border-hover);
    box-shadow: 0 0 16px rgba(0, 217, 255, .35);
}
@media (max-width: 768px) {
    .autobio-nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .autobio-nav::-webkit-scrollbar { display: none; }
    .autobio-nav-item { flex: 0 0 auto; }
}
