body {
    /* font-family: 'Arial', sans-serif;
    background-color: #f4f4f9;
    color: #333; */
    overflow: hidden;
}

#loader {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.hidden {
    display: none;
}

.hero-section {
    position: relative;
    height: 100vh;
    color: #fff;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-section video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}


.hero-section h1 {
    font-size: 3em;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.2em;
    margin-bottom: 40px;
}


.btn-animated {
    transition: background-color 0.3s, transform 0.3s;
}

.btn-animated:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

.about-section {
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.about-section.visible {
    opacity: 1;
}

.about-section {
    padding: 60px 0;
}

.about-section .section-title {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.about-section .section-title::after {
    content: '';
    width: 50px;
    height: 3px;
    background: #007bff;
    display: block;
    margin: 10px auto 0;
}

.about-section .about-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    padding: 20px;
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}



.about-section .about-content p {
    font-size: 1.1em;
    line-height: 1.6;
}

.about-section .about-content .btn-primary {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 50px;
    transition: background-color 0.3s, transform 0.3s;
}

.about-section .about-content .btn-primary:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

.education-section {
    padding: 50px 0;
    text-align: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.education-section.visible {
    opacity: 1;
}

.education-section h2 {
    margin-bottom: 30px;
    color: #343a40;
}

.education-item {
    display: inline-block;
    margin: 10px;
    padding: 20px;
    background: #fff;
    border-radius: 50%;
    width: 200px;
    height: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    vertical-align: top;
    transition: transform 0.3s;
}

.education-item:hover {
    transform: scale(1.05);
}

.education-item h3 {
    margin-bottom: 10px;
    color: #007bff;
    font-size: 18px;
}

.project-section .section-title {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.videos-container {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    width: 100%;
    height: 300px;
    /* 調整作品集的高度 */
}

.videos-container video {
    width: 300px;
    /* 調整每個視頻的寬度 */
    height: 200px;
    /* 調整每個視頻的高度 */
    margin: 0 10px;
    /* 調整每個視頻的間距 */
    transition: transform 0.5s ease;
    /* 添加變形過渡效果 */
}

.controls {
    text-align: center;
}

button {
    margin: 10px;
}

.award-section {
    position: relative;
    height: 90vh;
    color: #fff;
    display: flex;
    justify-content: center;
}

.award-section video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.award-section .container {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}


.award-section h1 {
    font-size: 3em;
    margin-bottom: 20px;
    margin-top: 40px;
}

.award-section p {
    font-size: 1.2em;
    margin-bottom: 40px;
}


.award-section h2 {
    margin-top: 20px;
}

.award-section .card {
    height: 100%;
    max-height: 200px;
    /* 限制卡片最大高度 */
    background-color: transparent;
    /* 设置背景为透明 */
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.award-section .card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.8);
}

.award-section .card-img-top {
    height: 120px;
    /* 调整图片高度 */
    object-fit: contain;
}

.award-section .card-body {
    padding: 10px;
}

.award-section .card .card-title {
    color: white;
}

.award-section .card .card-text {
    color: white;

}



@media (min-width: 768px) {
    .about-section .about-content {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: left;
    }

    .about-section .carousel {
        margin-right: 30px;
        margin-bottom: 0;
    }
}

@media screen and (max-width: 768px) {

    /* Add your CSS rules for the media query here */
    .award-section {
        height: auto;
    }
}

/* =========================
   Premium UI Enhancements
   ========================= */

:root {
    --bg: #0b0f19;
    --surface: rgba(255, 255, 255, 0.06);
    --elevated: rgba(255, 255, 255, 0.1);
    --text: #e6e9ef;
    --muted: #a9b0c0;
    --primary: #6a8dff;
    --primary-2: #a78bfa;
    --accent: #f1c40f;
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    --radius: 16px;
}

html, body { height: 100%; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, 'Noto Sans',
        'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
    color: var(--text);
    background: radial-gradient(1200px 800px at 80% -10%, rgba(167, 139, 250, 0.15), transparent 60%),
                radial-gradient(1200px 800px at -10% 120%, rgba(106, 141, 255, 0.15), transparent 60%),
                var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loader override */
#loader {
    position: fixed; /* ensure full-viewport overlay */
    inset: 0;        /* top/right/bottom/left = 0 */
    transform: none; /* cancel earlier translate(-50%,-50%) */
    display: grid;
    place-items: center; /* center the GIF horizontally + vertically */
    background: linear-gradient(180deg, rgba(11,15,25,0.95), rgba(11,15,25,0.85));
    backdrop-filter: blur(4px);
    transition: opacity 0.5s ease;
}
#loader.hidden { opacity: 0; pointer-events: none; }

/* Glassy navbar */
.navbar {
    background: rgba(17, 20, 31, 0.45) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border) !important;
}
.navbar.scrolled { background: rgba(17, 20, 31, 0.9) !important; }
.navbar .nav-link, .navbar .navbar-brand { color: var(--text) !important; }
.navbar .nav-link:hover { color: var(--primary) !important; }
.navbar .navbar-brand { letter-spacing: 0.5px; font-weight: 600; }

/* Hero overlay & typography */
.hero-section { color: var(--text); }
.hero-section::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(11,15,25,0.2), rgba(11,15,25,0.6) 60%, rgba(11,15,25,0.9));
    z-index: 0;
}
.hero-section .container { position: relative; z-index: 1; }
.hero-section h1 { font-size: clamp(2rem, 4vw, 3.5rem); margin-bottom: 16px; text-shadow: 0 6px 24px rgba(0,0,0,0.4); }
.hero-section p { font-size: clamp(1rem, 1.2vw, 1.25rem); margin-bottom: 32px; color: var(--muted); }

/* Buttons */
.btn-animated { transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s; }
.btn-animated:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(106, 141, 255, 0.35); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border: none; border-radius: 999px; padding: 12px 24px; }

/* About block as glass card */
.about-section { padding: 80px 0; }
.about-section,
.expertise-section,
.education-section,
.project-section { position: relative; padding-top: clamp(96px, 12vw, 128px); padding-bottom: 96px; scroll-margin-top: 80px; }
.about-section::before,
.expertise-section::before,
.education-section::before,
.project-section::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100vw;
    background: rgba(16, 19, 29, 0.88);
    z-index: -1;
}
.about-section .about-content { display: block !important; }
.about-section .section-title { font-size: clamp(1.6rem, 2.5vw, 2.5rem); margin-bottom: 28px; }
.section-subtitle { color: var(--muted); }
.about-section .section-title::after { width: 64px; height: 4px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.about-section .about-content {
    max-width: 1100px;
    padding: 32px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}
.about-section .about-content p { font-size: 1.05rem; line-height: 1.75; color: var(--muted); }
.about-section .about-content .btn-primary:hover { transform: translateY(-2px); }

/* Education & Projects cards */
.education-section { padding: 80px 0; }
.education-section h2, .project-section .section-title, .award-section h1 { letter-spacing: 0.3px; color: var(--text); }
.education-section .card, .project-section .card {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.education-section .card:hover, .project-section .card:hover { transform: translateY(-4px); box-shadow: 0 18px 50px rgba(0,0,0,0.45); }
.project-section { padding-bottom: 80px; }
.card .card-img, .card .card-img-top { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.card .card-body { color: var(--text); }
.card .card-text { color: var(--muted); }

/* Education timeline */
.edu-timeline { position: relative; max-width: 1000px; margin: 0 auto; padding: 10px 0 10px 0; }
.edu-timeline::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--border); transform: translateX(-50%); }
.edu-item { position: relative; width: 50%; padding: 0 24px 24px; }
.edu-item.left { left: 0; }
.edu-item.right { left: 50%; }
.edu-marker { position: absolute; top: 8px; right: -9px; width: 14px; height: 14px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 0 4px rgba(106, 141, 255, 0.2); }
.edu-item.right .edu-marker { left: -7px; right: auto; }
.edu-card { background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; gap: 16px; align-items: center; }
.edu-logo { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; }
.edu-content p { color: var(--text); }

@media (max-width: 768px) {
  .edu-timeline::before { left: 8px; transform: none; }
  .edu-item, .edu-item.right, .edu-item.left { width: 100%; left: 0; padding-left: 32px; }
  .edu-marker { left: 2px !important; right: auto; }
}

/* Project cards */
.project-card .ratio { background: #000; }
.project-card video { width: 100%; height: 100%; object-fit: cover; border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }

/* Awards */
.award-section { min-height: 90vh; color: var(--text); }
.award-section .container { color: var(--text); }
.award-section .card {
    max-height: 220px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.award-section .card:hover { transform: translateY(-4px); box-shadow: 0 18px 50px rgba(241, 196, 15, 0.35); }
.award-section .card .card-title { color: var(--text); }
.award-section .card .card-text { color: var(--muted); }

/* Reveal utility */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Footer */
.footer { border-top: 1px solid var(--border); background: rgba(17, 20, 31, 0.9) !important; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--primary); text-decoration: underline; }

/* =========================
   Expertise / Skills Cards
   ========================= */
.expertise-section { padding: 80px 0; }
.exp-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.exp-card:hover { transform: translateY(-4px); box-shadow: 0 18px 50px rgba(0,0,0,0.45); border-color: rgba(255,255,255,0.22); }
.exp-feature { border-color: rgba(167,139,250,0.35); box-shadow: 0 14px 40px rgba(167, 139, 250, 0.15); }
.exp-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: grid; place-items: center;
    color: var(--text);
    background: radial-gradient(circle at 30% 20%, rgba(167,139,250,0.35), rgba(106,141,255,0.15));
    margin-bottom: 14px;
    animation: float 6s ease-in-out infinite;
}
.exp-title { margin: 6px 0 8px; }
.exp-text { color: var(--muted); margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text);
}
.chip--primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border: none; }
.exp-badge { font-size: 0.75rem; padding: 4px 10px; border-radius: 999px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #0b0f19; font-weight: 600; letter-spacing: .2px; }

/* Motion utilities */
@keyframes float { 0% { transform: translateY(0); } 50% { transform: translateY(-4px); } 100% { transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Skill matrix */
.skill-list {
  margin-top: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 20px 8px;
}
.skill-row { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.skill-row:last-child { border-bottom: none; }
.skill-label { color: var(--muted); font-weight: 600; }
.skill-items { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 768px) { .skill-row { grid-template-columns: 1fr; } }
