/* ===== Variables ===== */
:root {
    --bg-color: #0f0f11;
    --card-bg: rgba(20, 20, 23, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-bg: rgba(30, 30, 35, 0.8);
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --accent-primary: #8b5cf6;
    --accent-secondary: #6366f1;
    --accent-glow: rgba(139, 92, 246, 0.5);
    --gap: 1.5rem;
    --radius: 1.5rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem;
    background-image: url('bg_main.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== Typography ===== */
h1,
h2,
h3 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2.section-title {
    font-size: 1.8rem;
    margin: 4rem 0 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

h2.section-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 32px;
    background: linear-gradient(to bottom, var(--accent-secondary), var(--accent-primary));
    border-radius: 4px;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* ===== Header ===== */
header {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    margin-bottom: 2rem;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* ===== Profile ===== */
.profile-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px var(--accent-glow);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.profile-img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 0 50px var(--accent-glow);
}

.bio {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.tags {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(139, 92, 246, 0.1);
    color: #c4b5fd;
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: var(--transition);
}

.tag:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

/* ===== Quick Navigation (Sticky) ===== */
.quick-nav {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem;
    background: rgba(15, 15, 17, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    margin-bottom: 2rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
    position: sticky;
    top: 2rem;
    z-index: 100;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

.quick-nav::-webkit-scrollbar {
    height: 6px;
}

.quick-nav::-webkit-scrollbar-track {
    background: transparent;
}

.quick-nav::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

.quick-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-tab i {
    font-size: 1.1rem;
}

.nav-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.1;
    transition: var(--transition);
}

.nav-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.nav-tab:hover::before {
    opacity: 0.2;
}

.nav-tab.active {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

/* Nav Tab Color Variants */
.nav-social {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(59, 130, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
}

.nav-social::before {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.nav-social:hover {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 10px 30px -5px rgba(59, 130, 246, 0.4);
}

.nav-ai {
    background: linear-gradient(135deg, rgba(219, 39, 119, 0.15), rgba(236, 72, 153, 0.1));
    border-color: rgba(236, 72, 153, 0.3);
}

.nav-ai::before {
    background: linear-gradient(135deg, #ec4899, #f472b6);
}

.nav-ai:hover {
    border-color: rgba(236, 72, 153, 0.6);
    box-shadow: 0 10px 30px -5px rgba(236, 72, 153, 0.4);
}

.nav-vercel {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.15), rgba(16, 185, 129, 0.1));
    border-color: rgba(16, 185, 129, 0.3);
}

.nav-vercel::before {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.nav-vercel:hover {
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 10px 30px -5px rgba(16, 185, 129, 0.4);
}

.nav-gemini {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(139, 92, 246, 0.1));
    border-color: rgba(139, 92, 246, 0.3);
}

.nav-gemini::before {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.nav-gemini:hover {
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 10px 30px -5px rgba(139, 92, 246, 0.4);
}

.nav-github {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.2), rgba(100, 116, 139, 0.15));
    border-color: rgba(148, 163, 184, 0.3);
}

.nav-github::before {
    background: linear-gradient(135deg, #64748b, #94a3b8);
}

.nav-github:hover {
    border-color: rgba(148, 163, 184, 0.6);
    box-shadow: 0 10px 30px -5px rgba(148, 163, 184, 0.4);
}

.nav-comfyui {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(251, 146, 60, 0.1));
    border-color: rgba(251, 146, 60, 0.3);
}

.nav-comfyui::before {
    background: linear-gradient(135deg, #f97316, #fb923c);
}

.nav-comfyui:hover {
    border-color: rgba(251, 146, 60, 0.6);
    box-shadow: 0 10px 30px -5px rgba(251, 146, 60, 0.4);
}

.nav-huggingface {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(250, 204, 21, 0.1));
    border-color: rgba(250, 204, 21, 0.3);
}

.nav-huggingface::before {
    background: linear-gradient(135deg, #eab308, #facc15);
}

.nav-huggingface:hover {
    border-color: rgba(250, 204, 21, 0.6);
    box-shadow: 0 10px 30px -5px rgba(250, 204, 21, 0.4);
}

/* ===== Visual Showcase ===== */
.showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 260px;
    gap: 1rem;
}

.showcase-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: var(--transition);
}

.showcase-item.large {
    grid-column: span 2;
}

.showcase-item.wide {
    grid-column: span 2;
}

.showcase-item.full {
    grid-column: 1 / -1;
}

.showcase-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.showcase-item:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 15px 40px -10px rgba(139, 92, 246, 0.3);
}

.showcase-item:hover img {
    transform: scale(1.08);
}

.showcase-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.3), transparent);
    transition: var(--transition);
}

.showcase-overlay h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #fff;
}

.showcase-overlay p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.showcase-item:hover .showcase-overlay p {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Resume Box：單一大框條列 ===== */
.resume-box {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
}

/* 每一筆履歷條目 */
.rl-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    min-height: 3.2rem;
}

.rl-item:last-child {
    border-bottom: none;
}

.rl-item:hover {
    background: rgba(139, 92, 246, 0.08);
    padding-left: 2rem;
}

/* 分類徽章（小圓圈） */
.rl-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.rl-badge.award   { background: linear-gradient(135deg,#f59e0b,#fbbf24); color:#1a1000; }
.rl-badge.speaker { background: linear-gradient(135deg,#8b5cf6,#a78bfa); color:#fff; }
.rl-badge.course  { background: linear-gradient(135deg,#06b6d4,#22d3ee); color:#001a1f; }
.rl-badge.workshop{ background: linear-gradient(135deg,#10b981,#34d399); color:#001a0a; }
.rl-badge.exhibit { background: linear-gradient(135deg,#ec4899,#f472b6); color:#fff; }

.rl-item:hover .rl-badge {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(139,92,246,0.4);
}

/* 分類文字標籤 */
.rl-cat {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.65rem;
    border-radius: 2rem;
    background: rgba(139,92,246,0.12);
    color: #c4b5fd;
    border: 1px solid rgba(139,92,246,0.2);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

/* 時間段 */
.rl-period {
    font-size: 0.78rem;
    color: var(--accent-primary);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.04em;
}

/* 條目標題 */
.rl-title {
    flex: 1;
    font-size: 0.98rem;
    font-weight: 600;
    color: rgba(255,255,255,0.88);
    line-height: 1.4;
    transition: var(--transition);
}

.rl-title em {
    font-style: normal;
    background: linear-gradient(135deg,#a78bfa,#f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.rl-item:hover .rl-title {
    color: #fff;
}

/* 右側箭頭 */
.rl-arrow {
    font-size: 0.85rem;
    color: rgba(161,161,170,0.35);
    transition: var(--transition);
    flex-shrink: 0;
}

.rl-item:hover .rl-arrow {
    color: var(--accent-primary);
    transform: translateX(4px);
}

/* ===== 大型詳情 Popup (.rl-popup) ===== */
.rl-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.rl-popup-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.rl-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -47%) scale(0.95);
    width: min(92vw, 860px);
    max-height: 88vh;
    background: rgba(16,16,20,0.98);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: 0 40px 100px -20px rgba(0,0,0,0.85), 0 0 0 1px rgba(255,255,255,0.04);
    z-index: 910;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
}

.rl-popup[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* 內部雙欄佈局 */
.rl-popup-inner {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 460px;
    max-height: 88vh;
}

/* 關閉按鈕 */
.rl-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.rl-popup-close:hover {
    background: rgba(236,72,153,0.3);
    border-color: rgba(236,72,153,0.5);
    transform: rotate(90deg);
}

/* 左欄：圖片 + 連結 */
.rl-popup-left {
    display: flex;
    flex-direction: column;
    background: #0d0d11;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.rl-popup-img-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 320px;      /* 給圖片更多高度 */
    background: #08080c;
}

/* 幻燈片圖片：contain 完整顯示，不裁切 */
.rl-slide-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    transition: opacity 0.3s ease;
    display: block;
}

.rl-slide-img.fade-out {
    opacity: 0;
}

/* 幻燈片切換按鈕（上/下一張） */
.rl-slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 5;
    opacity: 0;
    pointer-events: none;
}

.rl-slide-btn:hover {
    background: rgba(139,92,246,0.7);
    border-color: rgba(139,92,246,0.8);
}

.rl-popup-img-wrap:hover .rl-slide-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.rl-slide-btn.rl-slide-prev { left: 0.6rem; }
.rl-slide-btn.rl-slide-next { right: 0.6rem; }

/* 圓點指示器 */
.rl-slide-dots {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
}

.rl-slide-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    padding: 0;
}

.rl-slide-dot.active {
    background: #a78bfa;
    transform: scale(1.3);
}

/* 圖片計數器（右下角）*/
.rl-slide-counter {
    position: absolute;
    bottom: 0.6rem;
    right: 0.8rem;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.45);
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    z-index: 5;
    display: none;
}

.rl-slide-counter.visible {
    display: block;
}

/* 無圖片時 */
.rl-popup-no-img {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: rgba(161,161,170,0.35);
    font-size: 0.85rem;
}

.rl-popup-no-img i {
    font-size: 2.5rem;
    opacity: 0.25;
}

/* 圖片底部漸層（只在有控制項時顯示） */
.rl-popup-img-wrap.has-slides::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(8,8,12,0.7), transparent);
    pointer-events: none;
    z-index: 3;
}

/* URL 連結區 */
.rl-popup-link-area {
    padding: 1rem 1.25rem;
    flex-shrink: 0;
}

.rl-popup-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #a78bfa;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border-radius: 0.75rem;
    background: rgba(139,92,246,0.1);
    border: 1px solid rgba(139,92,246,0.2);
    transition: var(--transition);
    word-break: break-all;
}

.rl-popup-link:hover {
    background: rgba(139,92,246,0.2);
    border-color: rgba(139,92,246,0.4);
    color: #c4b5fd;
}

.rl-popup-link i {
    flex-shrink: 0;
    font-size: 0.9rem;
}

/* 右欄：文字內容 */
.rl-popup-right {
    display: flex;
    flex-direction: column;
    padding: 2rem 2rem 2rem;
    overflow-y: auto;
    max-height: 88vh;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.3) transparent;
}

.rl-popup-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.rl-popup-period {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.06em;
}

.rl-popup-cat {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.75rem;
    border-radius: 2rem;
    background: rgba(139,92,246,0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139,92,246,0.25);
}

.rl-popup-right h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 1rem;
}

.rl-popup-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin-bottom: 1.25rem;
}

.rl-popup-right p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.85;
    white-space: pre-line;
}

/* 課程主題副標 */
.rl-popup-topic {
    font-size: 0.9rem;
    color: #a78bfa;
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: pre-line;
}

.rl-popup-topic:empty {
    display: none;
}

/* 條列標題中的小字課程主題 */
.rl-title small {
    font-size: 0.78rem;
    font-weight: 400;
    color: rgba(167,139,250,0.65);
    font-style: normal;
    -webkit-text-fill-color: rgba(167,139,250,0.65); /* 覆蓋 em 漸層 */
}

/* ===== 響應式：手機版 popup 改為單欄 ===== */
@media (max-width: 640px) {
    .rl-popup-inner {
        grid-template-columns: 1fr;
    }

    .rl-popup-img-wrap {
        height: 200px;
        flex: none;
    }

    .rl-popup-left {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .rl-popup-right {
        padding: 1.25rem;
    }

    .rl-period {
        display: none; /* 太擠時收起日期 */
    }
}

/* ===== Resume Timeline (舊版保留相容性) ===== */
.resume-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 0.5rem;
}
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 0.5rem;
}

/* 每張履歷卡 */
.resume-card {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    cursor: pointer;
    position: relative;
}

/* 左側：徽章 + 時間軸線 */
.resume-card-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 56px;
}

.resume-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    z-index: 1;
    transition: var(--transition);
    box-shadow: 0 0 0 4px var(--bg-color);
}

/* 徽章顏色主題 */
.resume-badge.award {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1a1000;
}
.resume-badge.speaker {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: #fff;
}
.resume-badge.course {
    background: linear-gradient(135deg, #06b6d4, #22d3ee);
    color: #001a1f;
}
.resume-badge.workshop {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #001a0a;
}
.resume-badge.exhibit {
    background: linear-gradient(135deg, #ec4899, #f472b6);
    color: #1a001a;
}

/* 連接時間軸的垂直線 */
.resume-vline {
    width: 2px;
    flex: 1;
    min-height: 1.5rem;
    background: linear-gradient(to bottom, rgba(139,92,246,0.35), rgba(139,92,246,0.08));
    margin-top: 4px;
}

.resume-card:last-child .resume-vline {
    display: none;
}

/* 右側主體卡片 */
.resume-card-body {
    flex: 1;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.4rem 1.8rem;
    margin-bottom: 1.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

/* 卡片左邊的強調條 */
.resume-card-body::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
    background: linear-gradient(to bottom, var(--accent-secondary), var(--accent-primary));
    opacity: 0;
    transition: var(--transition);
}

.resume-card:hover .resume-card-body {
    background: var(--card-hover-bg);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 8px 32px -8px rgba(139, 92, 246, 0.3);
    transform: translateX(6px);
}

.resume-card:hover .resume-card-body::before {
    opacity: 1;
}

.resume-card:hover .resume-badge {
    transform: scale(1.12);
    box-shadow: 0 0 0 4px var(--bg-color), 0 0 20px rgba(139,92,246,0.4);
}

/* 時間段標籤 */
.resume-period {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
    opacity: 0.9;
}

/* 標題 */
.resume-card-body h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.resume-card-body h3 em {
    font-style: normal;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* 標籤行 */
.resume-tag-line {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.resume-cat {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.75rem;
    border-radius: 2rem;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.25);
    letter-spacing: 0.03em;
}

.resume-cat-sub {
    font-size: 0.75rem;
    padding: 0.2rem 0.75rem;
    border-radius: 2rem;
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.1);
}

/* 「移入查看」提示文字 */
.resume-hint {
    font-size: 0.8rem;
    color: rgba(161, 161, 170, 0.55);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.2rem;
    transition: var(--transition);
}

.resume-card:hover .resume-hint {
    color: rgba(196, 181, 253, 0.8);
}

/* ===== 履歷浮動視窗 (Popup) ===== */
.resume-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.resume-popup-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.resume-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.96);
    width: min(90vw, 680px);
    max-height: 85vh;
    background: rgba(18, 18, 22, 0.97);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: 0 30px 80px -15px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05);
    z-index: 910;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.resume-popup[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.resume-popup-inner {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 85vh;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.3) transparent;
}

/* 關閉按鈕 */
.resume-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.resume-popup-close:hover {
    background: rgba(236, 72, 153, 0.3);
    border-color: rgba(236, 72, 153, 0.5);
}

/* 圖片區塊 */
.resume-popup-img-wrap {
    width: 100%;
    height: 260px;
    overflow: hidden;
    position: relative;
    background: #0d0d11;
    flex-shrink: 0;
}

.resume-popup-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.5s ease;
}

.resume-popup[aria-hidden="false"] .resume-popup-img-wrap img {
    transform: scale(1.03);
}

/* 無圖片顯示 */
.resume-popup-no-img {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: rgba(161,161,170,0.4);
    font-size: 0.9rem;
}

.resume-popup-no-img i {
    font-size: 3rem;
    opacity: 0.3;
}

/* 圖片漸層遮罩 */
.resume-popup-img-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(18,18,22,1), transparent);
}

/* 文字內容區 */
.resume-popup-content {
    padding: 1.75rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.resume-popup-period {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.06em;
}

.resume-popup-cat {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.2rem 0.9rem;
    border-radius: 2rem;
    background: rgba(139,92,246,0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139,92,246,0.25);
    width: fit-content;
}

.resume-popup-content h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.4;
}

.resume-popup-content p {
    font-size: 0.97rem;
    color: var(--text-muted);
    line-height: 1.75;
    white-space: pre-line;
}

/* ===== Bento Grid & Cards ===== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--gap);
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    padding: 2rem;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    min-height: 200px;
}

.card:hover {
    transform: translateY(-10px);
    background: var(--card-hover-bg);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
}

.card:hover::after {
    background: linear-gradient(135deg, var(--accent-secondary), transparent);
    opacity: 1;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    transition: var(--transition);
}

.card:hover .card-icon {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.card-arrow {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 1.2rem;
    color: var(--text-muted);
    opacity: 0;
    transform: translate(-10px, 10px);
    transition: var(--transition);
}

.card:hover .card-arrow {
    opacity: 1;
    transform: translate(0, 0);
    color: var(--accent-primary);
}

/* Hover Text Effects */
.card:hover .card-title {
    background: linear-gradient(to right, #fff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== Category Specific Themes ===== */

/* Social - Blue/Cyan */
.cat-social .card {
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.8), rgba(37, 99, 235, 0.1));
    border-color: rgba(59, 130, 246, 0.2);
}

.cat-social .card:hover {
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.9), rgba(37, 99, 235, 0.2));
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.3);
}

.cat-social .card-icon {
    color: #60a5fa;
    background: rgba(37, 99, 235, 0.1);
}

/* AI Studio - Rose/Purple */
.cat-ai .card {
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.8), rgba(219, 39, 119, 0.1));
    border-color: rgba(236, 72, 153, 0.2);
}

.cat-ai .card:hover {
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.9), rgba(219, 39, 119, 0.2));
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 0 10px 30px -10px rgba(236, 72, 153, 0.3);
}

.cat-ai .card-icon {
    color: #f472b6;
    background: rgba(219, 39, 119, 0.1);
}

.cat-ai .card:nth-child(2n) {
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.8), rgba(192, 38, 211, 0.1));
    border-color: rgba(217, 70, 239, 0.2);
}

.cat-ai .card:nth-child(3n) {
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.8), rgba(244, 63, 94, 0.1));
    border-color: rgba(251, 113, 133, 0.2);
}

/* Vercel - Emerald/Teal */
.cat-vercel .card {
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.8), rgba(5, 150, 105, 0.1));
    border-color: rgba(16, 185, 129, 0.2);
}

.cat-vercel .card:hover {
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.9), rgba(5, 150, 105, 0.2));
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 10px 30px -10px rgba(16, 185, 129, 0.3);
}

.cat-vercel .card-icon {
    color: #34d399;
    background: rgba(5, 150, 105, 0.1);
}

/* Gemini/Opal - Violet/Indigo */
.cat-gemini .card {
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.8), rgba(124, 58, 237, 0.1));
    border-color: rgba(139, 92, 246, 0.2);
}

.cat-gemini .card:hover {
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.9), rgba(124, 58, 237, 0.2));
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.3);
}

.cat-gemini .card-icon {
    color: #a78bfa;
    background: rgba(124, 58, 237, 0.1);
}

/* Github - Slate/Gray */
.cat-github .card {
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.8), rgba(71, 85, 105, 0.2));
    border-color: rgba(148, 163, 184, 0.2);
}

.cat-github .card:hover {
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.9), rgba(71, 85, 105, 0.3));
    border-color: rgba(148, 163, 184, 0.5);
    box-shadow: 0 10px 30px -10px rgba(148, 163, 184, 0.3);
}

.cat-github .card-icon {
    color: #e2e8f0;
    background: rgba(71, 85, 105, 0.2);
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
    pointer-events: none;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--accent-secondary);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.6);
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--card-border);
    margin-top: 6rem;
}

/* ===== Desktop Layout (1024px+) ===== */
@media (min-width: 1024px) {
    header {
        display: flex;
        gap: 3rem;
        text-align: left;
        align-items: center;
        padding: 3rem;
    }

    .profile-img {
        margin-bottom: 0;
        width: 180px;
        height: 180px;
        flex-shrink: 0;
    }

    .header-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    header h1 {
        margin-bottom: 0;
        text-align: left;
    }

    header .bio {
        margin: 0;
        text-align: left;
        max-width: none;
    }

    header .tags {
        justify-content: flex-start;
    }

    .resume-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .resume-item {
        padding: 1.5rem;
    }

    .resume-icon {
        width: 60px;
        height: 60px;
    }

    .resume-content h3 {
        font-size: 1.2rem;
    }

    .resume-content p {
        font-size: 0.95rem;
    }
}

/* ===== Tablet (769px - 1023px) ===== */
@media (max-width: 1023px) and (min-width: 769px) {
    .bento-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.25rem;
    }

    .card {
        padding: 1.5rem;
        min-height: 160px;
    }

    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .showcase-grid {
        grid-auto-rows: 220px;
    }
}

/* ===== Mobile (768px-) ===== */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2.section-title {
        font-size: 1.5rem;
        margin: 2.5rem 0 1.5rem;
    }

    /* Sticky nav mobile */
    .quick-nav {
        top: 1rem;
        padding: 1rem;
        gap: 0.5rem;
    }

    .nav-tab {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .nav-tab span {
        display: none;
    }

    .nav-tab i {
        font-size: 1.3rem;
    }

    /* Showcase mobile */
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
    }

    .showcase-item.large,
    .showcase-item.wide {
        grid-column: span 2;
    }

    .showcase-item.full {
        grid-column: 1 / -1;
    }

    .showcase-overlay {
        padding: 1rem;
    }

    .showcase-overlay h3 {
        font-size: 1rem;
    }

    /* Bento grid mobile */
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .card {
        padding: 1rem;
        min-height: 120px;
        border-radius: 1rem;
    }

    .card.wide {
        grid-column: span 1;
    }

    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
        border-radius: 10px;
    }

    .card-title {
        font-size: 0.9rem;
        line-height: 1.3;
        margin-bottom: 0.25rem;
    }

    .card-desc {
        font-size: 0.75rem;
        line-height: 1.2;
    }

    .card-arrow {
        top: 1rem;
        right: 1rem;
        font-size: 1rem;
    }

    /* Resume mobile */
    .resume-item {
        flex-direction: row;
        text-align: left;
        gap: 1rem;
        padding: 1.25rem;
    }

    .resume-icon {
        width: 50px;
        height: 50px;
    }

    .resume-content h3 {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .resume-content p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .resume-item.featured {
        transform: scale(1);
    }

    /* Header mobile */
    header {
        padding: 2rem 1.5rem;
    }

    .profile-img {
        width: 120px;
        height: 120px;
        margin-bottom: 1.5rem;
    }

    .bio {
        font-size: 1rem;
    }

    .tags {
        gap: 0.5rem;
    }

    .tag {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }

    /* Back to top mobile */
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}

/* ===== Very Small Screens (400px-) ===== */
@media (max-width: 400px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .card {
        min-height: 100px;
    }

    .showcase-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
    }

    .showcase-item.large,
    .showcase-item.wide {
        grid-column: span 1;
    }
}
