/* ============================================
   中式古典风格 · Chinese Classical Style
   竹青为韵，墨色为骨，松绿点睛
   ============================================ */

:root {
    /* Light theme - 竹纸青白 */
    --bg-primary: #f9faf4;
    --bg-secondary: #f0f2e6;
    --bg-tertiary: #e4e8d6;
    --text-primary: #1a2e1a;
    --text-secondary: #3d4a35;
    --text-tertiary: #6b7a60;
    --border-color: #CBDA99;
    --accent-color: #5a7a3a;
    --accent-hover: #4a6830;
    --accent-light: #eef3e3;
    --shadow: rgba(90, 122, 58, 0.1);
    --profile-border: #CBDA99;
    --gradient-start: #5a7a3a;
    --gradient-end: #CBDA99;
    --gold: #8fa858;
    --gold-light: #CBDA99;
    --vermillion: #5a7a3a;
    --ink: #1a2e1a;
    --ink-light: #3d4a35;
    --paper: #f9faf4;
    --paper-dark: #f0f2e6;
    --divider-pattern: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h4v4H0V0zm8 0h4v4H8V0zm8 0h4v4h-4V0zM4 4h4v4H4V4zm8 0h4v4h-4V4zM0 8h4v4H0V8zm8 0h4v4H8V8zm8 0h4v4h-4V8zM4 12h4v4H4v-4zm8 0h4v4h-4v-4zM0 16h4v4H0v-4zm8 0h4v4H8v-4zm8 0h4v4h-4v-4z' fill='%23CBDA99' fill-opacity='0.12'/%3E%3C/svg%3E");
}

.dark-theme {
    /* Dark theme - 星夜蓝 */
    --bg-primary: #0e1420;
    --bg-secondary: #141c2a;
    --bg-tertiary: #1c2636;
    --text-primary: #c8d4e8;
    --text-secondary: #9aabc4;
    --text-tertiary: #6a7d96;
    --border-color: #2a3a52;
    --accent-color: #5b8fd4;
    --accent-hover: #78a8e8;
    --accent-light: #162030;
    --shadow: rgba(0, 0, 0, 0.35);
    --profile-border: #3a4e6a;
    --gradient-start: #5b8fd4;
    --gradient-end: #8ab4e8;
    --gold: #6a9ed8;
    --gold-light: #8ab4e8;
    --vermillion: #5b8fd4;
    --ink: #c8d4e8;
    --ink-light: #9aabc4;
    --paper: #0e1420;
    --paper-dark: #141c2a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.3;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    background-image: url('../images/light-bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    transition: background-color 0.4s ease, color 0.4s ease;
    position: relative;
}

body.dark-theme {
    background-image: url('../images/dark-bg.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* ---- Petal Rain Canvas ---- */
#petalCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    pointer-events: none;
}


/* ---- Neko Cat ---- */
#neko {
    position: absolute;
    width: 72px;
    height: 72px;
    z-index: 9997;
    pointer-events: none;
    transition: none;
}

#neko img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* Sitting - gentle sway */
#neko.neko-sit img {
    animation: nekoSway 2.5s ease-in-out infinite;
}

/* Idle (face front) - breathing */
#neko.neko-idle img {
    animation: nekoBreathe 2s ease-in-out infinite;
}

/* Love - bounce with hearts */
#neko.neko-love img {
    animation: nekoBounce 0.6s ease-in-out infinite;
}

/* Running - bob up and down */
#neko.neko-run img,
#neko.neko-runRight img {
    animation: nekoRun 0.3s ease-in-out infinite;
}

#neko.neko-flip img {
    transform: scaleX(-1);
}

@keyframes nekoSway {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes nekoBreathe {
    0%, 100% { transform: scaleY(1) translateY(0); }
    50% { transform: scaleY(1.04) translateY(-2px); }
}

@keyframes nekoBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.05); }
}

@keyframes nekoRun {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-4px) rotate(-2deg); }
    75% { transform: translateY(-4px) rotate(2deg); }
}

/* ---- Hero Background ---- */
.hero-background {
    position: relative;
    width: 100%;
    overflow: visible;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.hero-video {
    display: none;
    width: 70%;
    height: auto;
    max-height: 360px;
    object-fit: cover;
    object-position: center;
}

.dark-theme .hero-video {
    display: block;
}

.dark-theme #heroImage {
    display: none;
}

.hero-image {
    width: 70%;
    height: auto;
    max-height: 360px;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.1s ease-out, opacity 0.2s ease-out;
    will-change: transform, opacity;
}

.hero-overlay {
    display: none;
}

/* ---- Theme Toggle - 印章风格 ---- */
.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.theme-toggle:hover {
    transform: scale(1.15);
    box-shadow: none;
}

/* ---- Container ---- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 20px;
    background-color: rgba(249, 250, 244, 0.68);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    min-height: 100vh;
    transition: background-color 0.4s ease;
    position: relative;
    z-index: 1;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.dark-theme .container {
    background-color: rgba(14, 20, 32, 0.82);
}

.header,
.main-content {
    background-color: transparent;
}

.research-item,
.education-item,
.publication-item {
    background: rgba(249, 250, 244, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.dark-theme .research-item,
.dark-theme .education-item,
.dark-theme .publication-item {
    background: rgba(14, 20, 32, 0.5);
}

.footer {
    background-color: rgba(249, 250, 244, 0.68);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.dark-theme .footer {
    background-color: rgba(14, 20, 32, 0.82);
}

.cinema-gallery {
    background-color: rgba(249, 250, 244, 0.68);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.dark-theme .cinema-gallery {
    background-color: rgba(14, 20, 32, 0.82);
}

/* ---- Header ---- */
.header {
    margin-bottom: 30px;
    padding: 30px;
    padding-top: 50px;
    border-bottom: none;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    position: relative;
    z-index: 2;
}

/* 水墨装饰线 */
.header::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        var(--border-color) 15%,
        var(--gold) 40%,
        var(--gold) 60%,
        var(--border-color) 85%,
        transparent 100%
    );
    margin-top: 25px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    position: relative;
}

/* ---- Profile Section ---- */
.profile-section {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
    flex: 1;
}

.profile-photo {
    width: 170px;
    height: 255px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 35px;
    border: none;
    box-shadow: none;
    transition: all 0.3s ease;
    filter: sepia(5%);
}

.profile-photo:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.name-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: -40px;
}

.name-cn {
    font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
}

.name {
    font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
    font-size: 2.6em;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 20px;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
    position: relative;
}

/* ---- About Section (inline) ---- */
.about-inline {
    margin-top: 0;
    margin-bottom: 0;
}

.about-inline .content {
    margin-top: 0;
}

.about-inline .about-title {
    display: none;
}

/* ---- Navigation ---- */
.top-nav {
    display: flex;
    gap: 20px;
    align-items: center;
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 10;
}

.folder-tab {
    padding: 0;
    background: none;
    color: #fff;
    text-decoration: none;
    font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
    font-size: 1.2em;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: none;
    transition: color 0.3s ease;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.folder-tab::before {
    display: none;
}

.folder-tab:hover {
    color: var(--accent-color);
    background: none;
    transform: none;
    box-shadow: none;
}

.dark-theme .folder-tab:hover {
    color: #78a8e8;
}

.folder-tab:active {
    background-color: var(--bg-primary);
    color: var(--accent-color);
}

.tab-label {
    position: relative;
    z-index: 2;
}

/* ---- Main Content ---- */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    background-color: transparent;
    border-radius: 0;
    padding: 10px 30px 30px;
    box-shadow: none;
    position: relative;
    z-index: 2;
}

/* ---- Section ---- */
.section {
    margin-bottom: 10px;
    padding-top: 25px;
}

/* 章节标题 - 印章 + 竖线风格 */
.section-title {
    font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
    font-size: 1.8em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    padding-left: 18px;
    border-bottom: none;
    border-image: none;
    border-left: 4px solid var(--vermillion);
    position: relative;
    letter-spacing: 0.08em;
    transition: color 0.3s ease;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        to right,
        var(--gold) 0%,
        var(--border-color) 50%,
        transparent 100%
    );
}

/* ---- Content ---- */
.content {
    font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
    font-size: 1.25em;
    line-height: 1.3;
    color: var(--text-primary);
    transition: color 0.3s ease;
    letter-spacing: 0.02em;
    font-weight: 400;
}

.content p {
    margin-bottom: 14px;
    text-indent: 0;
}

/* ---- Links - 朱红色链接 ---- */
.professor-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.professor-link:hover {
    color: var(--gold);
}

/* ---- Contact icons ---- */
.contact-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--accent-color);
}

.contact-link svg {
    flex-shrink: 0;
}

/* ---- Research Items - 卷轴卡片风格 ---- */
.research-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.research-item {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--gold);
    border-radius: 0;
    box-shadow: 2px 2px 0 var(--shadow);
    transition: all 0.3s ease;
    align-items: stretch;
    position: relative;
}

.research-item::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 6px;
    height: 6px;
    background: var(--vermillion);
    border-radius: 50%;
    opacity: 0.6;
}

.research-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--shadow);
    border-left-color: var(--vermillion);
}

.research-text {
    flex: 2;
    min-width: 0;
}

.research-title {
    font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.3;
}

.research-supervisor,
.research-meta {
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 0.95em;
    line-height: 1.3;
}

.research-meta {
    color: var(--text-secondary);
    font-style: italic;
}

.research-highlights {
    margin: 10px 0 0 20px;
    color: var(--text-primary);
    line-height: 1.3;
}

.research-description {
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.3;
}

.research-more {
    display: none;
}

.research-more.expanded {
    display: inline;
}

.research-toggle {
    border: none;
    background: none;
    color: var(--accent-color);
    font-weight: 600;
    cursor: pointer;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 0.78em;
    font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
    border: 1px solid var(--accent-color);
    transition: all 0.3s ease;
}

.research-toggle:hover {
    background: var(--accent-color);
    color: var(--paper);
}

.research-toggle:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.research-image-wrapper {
    flex: 1;
    min-width: 240px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.research-image-frame {
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    box-shadow: 2px 2px 0 var(--shadow);
    height: 220px;
}

.research-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.research-item:hover .research-image {
    transform: scale(1.03);
}

.research-image-caption {
    margin-top: 8px;
    font-size: 0.85em;
    color: var(--text-tertiary);
    text-align: center;
    font-style: italic;
}

/* ---- Education Items ---- */
.education-item {
    margin-bottom: 18px;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--gold);
    border-radius: 0;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0 var(--shadow);
}

.education-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--shadow);
    border-left-color: var(--vermillion);
}

.education-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.education-image-wrapper {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.education-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

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

.education-text {
    flex: 1;
    min-width: 0;
}

.education-degree {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.education-school {
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 1em;
    transition: color 0.3s ease;
}

.education-year {
    color: var(--text-tertiary);
    font-size: 0.92em;
    transition: color 0.3s ease;
}

/* ---- Publication Items ---- */
.publication-item {
    margin-bottom: 18px;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--gold);
    border-radius: 0;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0 var(--shadow);
}

.publication-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--shadow);
}

.publication-content {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.publication-image-wrapper {
    flex-shrink: 0;
    width: 120px;
    height: 160px;
    overflow: hidden;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.publication-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.publication-text {
    flex: 1;
    min-width: 0;
}

.publication-title {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.publication-authors {
    color: var(--text-primary);
    margin-bottom: 5px;
    font-style: italic;
    font-size: 1em;
    transition: color 0.3s ease;
}

.publication-venue {
    color: var(--text-secondary);
    font-size: 0.95em;
    transition: color 0.3s ease;
}

/* ---- Awards List ---- */
.awards-list {
    list-style: none;
    padding-left: 0;
}

.awards-list li {
    padding: 12px 0;
    padding-left: 28px;
    position: relative;
    font-size: 1.05em;
    color: var(--text-primary);
    transition: color 0.3s ease;
    border-bottom: 1px dashed var(--border-color);
}

.awards-list li:last-child {
    border-bottom: none;
}

.awards-list li::before {
    content: "\25C6";
    color: var(--gold);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 0.8em;
    top: 14px;
    transition: all 0.3s ease;
}

.awards-list li:hover::before {
    color: var(--vermillion);
    transform: rotate(45deg);
}

/* ---- Interests List ---- */
.interests-list {
    list-style: none;
    padding-left: 0;
}

.interests-list li {
    padding: 10px 0;
    padding-left: 28px;
    position: relative;
    font-size: 1.05em;
    color: var(--text-primary);
    border-bottom: 1px dashed var(--border-color);
    transition: color 0.3s ease, border-color 0.3s ease;
}

.interests-list li:last-child {
    border-bottom: none;
}

.interests-list li::before {
    content: "\25C6";
    color: var(--gold);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 0.8em;
    top: 12px;
    transition: all 0.3s ease;
}

.interests-list li:hover::before {
    transform: rotate(45deg);
    color: var(--vermillion);
}

/* ============================================
   Gallery Page Styles
   ============================================ */

.gallery-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.back-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.3s ease;
    display: inline-block;
    width: fit-content;
    font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
}

.back-link:hover {
    color: var(--gold);
    transform: translateX(-4px);
}

.gallery-title {
    font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
    font-size: 2em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 0.08em;
}

.gallery-content {
    padding: 30px;
    background-color: var(--bg-primary);
    border-radius: 0;
    box-shadow: none;
}

.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 0;
}

.gallery-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}

/* ---- Albums Grid ---- */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
    padding: 20px 0;
}

.album-collection {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.album-cover-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Album Cover - 画册风格 */
.album-cover {
    position: relative;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 3px 3px 0 var(--shadow);
}

.album-cover::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 1px solid var(--border-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.album-cover:hover {
    transform: translate(-3px, -3px);
    box-shadow: 6px 6px 0 var(--shadow);
}

.album-cover:hover::before {
    opacity: 0.5;
}

.album-cover-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.album-cover .album-photo {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 4 / 3;
    transition: transform 0.4s ease;
    filter: sepia(8%) contrast(0.96);
}

.album-cover:hover .album-photo {
    transform: scale(1.03);
    filter: sepia(0%) contrast(1);
}

.album-location {
    margin: 14px 0 0 0;
    padding: 0;
    text-align: center;
    font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
    font-size: 1.2em;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 0.1em;
}

/* Album Photos Grid */
.album-photos {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
    animation: fadeIn 0.4s ease;
}

.album-photos.active {
    display: grid;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Gallery Items ---- */
.gallery-item {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    box-shadow: 2px 2px 0 var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.gallery-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--shadow);
}

.gallery-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.04);
}

/* ---- Lightbox Modal ---- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 22, 18, 0.92);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border: 2px solid var(--border-color);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #d0dcc5;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
    background: rgba(20, 30, 18, 0.6);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid var(--shadow);
}

.lightbox-close:hover {
    background: rgba(20, 30, 18, 0.8);
    color: #f9faf4;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #d0dcc5;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    padding: 16px;
    background: rgba(20, 30, 18, 0.6);
    border: 1px solid var(--shadow);
    transition: all 0.3s ease;
    user-select: none;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(20, 30, 18, 0.8);
    color: #f9faf4;
    transform: translateY(-50%) scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(20, 30, 18, 0.8), transparent);
    padding: 30px 20px 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-caption {
    color: #f9faf4;
    font-size: 1.05em;
    font-weight: 500;
    margin: 0;
}

/* ============================================
   Section Decorative Dividers - 中式分隔
   ============================================ */
.section + .section::before {
    content: '';
    display: block;
    width: 60%;
    max-width: 400px;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        var(--border-color) 20%,
        var(--gold) 50%,
        var(--border-color) 80%,
        transparent 100%
    );
    margin: 0 auto 10px;
}

/* ============================================
   Cinematic Gallery — Editorial Archive Layout
   ============================================ */

.cinema-gallery {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.cinema-gallery-header {
    padding: 40px 40px 30px;
}

.cinema-gallery-heading {
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 2.8em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 12px 0 0;
    letter-spacing: 0.04em;
}

.cinema-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---- Each Row ---- */
.cinema-row {
    position: relative;
    display: block;
    width: 100%;
    height: 340px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    cursor: pointer;
}

.cinema-image-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.cinema-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease;
    display: block;
}

.cinema-row:hover .cinema-image {
    transform: scale(1.04);
}

/* ---- Translucent Overlay ---- */
.cinema-overlay {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 38%;
    z-index: 2;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.88) 0%,
        rgba(255, 255, 255, 0.82) 55%,
        rgba(255, 255, 255, 0.5) 80%,
        rgba(255, 255, 255, 0) 100%
    );
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 36px 40px;
    transition: background 0.4s ease;
}

.dark-theme .cinema-overlay {
    background: linear-gradient(
        to right,
        rgba(14, 20, 32, 0.9) 0%,
        rgba(14, 20, 32, 0.82) 55%,
        rgba(14, 20, 32, 0.5) 80%,
        rgba(14, 20, 32, 0) 100%
    );
}

.cinema-row:hover .cinema-overlay {
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.92) 0%,
        rgba(255, 255, 255, 0.86) 55%,
        rgba(255, 255, 255, 0.55) 80%,
        rgba(255, 255, 255, 0) 100%
    );
}

.dark-theme .cinema-row:hover .cinema-overlay {
    background: linear-gradient(
        to right,
        rgba(14, 20, 32, 0.94) 0%,
        rgba(14, 20, 32, 0.86) 55%,
        rgba(14, 20, 32, 0.55) 80%,
        rgba(14, 20, 32, 0) 100%
    );
}

/* ---- Typography ---- */
.cinema-title {
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 2em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
    margin: 0 0 12px;
    letter-spacing: 0.01em;
}

.cinema-meta {
    display: flex;
    gap: 18px;
    margin-bottom: 8px;
}

.cinema-meta-item {
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 0.92em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.cinema-icon {
    color: var(--gold);
    font-size: 0.85em;
}

.cinema-tags {
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 0.88em;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    letter-spacing: 0.04em;
}

.cinema-desc {
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 1em;
    color: var(--text-secondary);
    margin: 0 0 10px;
    line-height: 1.4;
}

.cinema-stats {
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 0.82em;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ---- Responsive ---- */
@media screen and (max-width: 768px) {
    .cinema-gallery-header {
        padding: 30px 24px 20px;
    }

    .cinema-gallery-heading {
        font-size: 2em;
    }

    .cinema-row {
        height: 280px;
    }

    .cinema-overlay {
        width: 50%;
        padding: 24px 24px;
    }

    .cinema-title {
        font-size: 1.5em;
    }
}

@media screen and (max-width: 480px) {
    .cinema-gallery {
        border-left: none;
        border-right: none;
    }

    .cinema-gallery-header {
        padding: 24px 16px 16px;
    }

    .cinema-gallery-heading {
        font-size: 1.5em;
    }

    .cinema-row {
        height: 200px;
    }

    .cinema-overlay {
        width: 55%;
        padding: 16px 14px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .cinema-title {
        font-size: 1.15em;
        margin-bottom: 6px;
        line-height: 1.2;
    }

    .cinema-meta {
        gap: 10px;
        margin-bottom: 5px;
    }

    .cinema-meta-item {
        font-size: 0.82em;
    }

    .cinema-desc {
        font-size: 0.82em;
        line-height: 1.3;
        margin-bottom: 6px;
    }

    .cinema-stats {
        font-size: 0.72em;
    }
}

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    padding: 28px 20px;
    margin-top: 40px;
    border-top: none;
    position: relative;
}

.footer::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        var(--border-color) 15%,
        var(--gold) 40%,
        var(--gold) 60%,
        var(--border-color) 85%,
        transparent 100%
    );
    margin-bottom: 20px;
}

.footer-text {
    font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
    font-size: 0.85em;
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.6;
    letter-spacing: 0.05em;
}

/* ============================================
   Responsive Design
   ============================================ */
@media screen and (max-width: 768px) {
    .container {
        padding: 15px;
        padding-top: 15px;
        max-width: 100%;
        border-left: none;
        border-right: none;
    }

    .header-top {
        flex-direction: column;
        gap: 20px;
    }

    .profile-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .profile-photo {
        width: 170px;
        height: 240px;
    }

    .name {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    .top-nav {
        position: relative;
        transform: none;
        width: 100%;
        justify-content: flex-start;
        padding-top: 0;
        flex-wrap: wrap;
        bottom: auto;
        right: auto;
        margin-top: 20px;
    }

    .folder-tab {
        margin-bottom: 0;
    }

    .section-title {
        font-size: 1.3em;
    }

    .content {
        font-size: 1em;
    }

    .publication-item {
        padding: 14px;
    }

    .publication-content {
        flex-direction: column;
        gap: 15px;
    }

    .publication-image-wrapper {
        width: 100%;
        height: 200px;
    }

    .research-item {
        flex-direction: column;
    }

    .research-image-wrapper {
        max-width: 100%;
        width: 100%;
        align-items: stretch;
    }

    .research-image-frame {
        height: 200px;
    }

    .education-content {
        flex-direction: column;
        gap: 15px;
    }

    .education-image-wrapper {
        width: 80px;
        height: 80px;
        align-self: flex-start;
    }

    .publication-title {
        font-size: 1em;
    }

    .interests-list li {
        font-size: 1em;
        padding: 10px 0;
        padding-left: 22px;
    }

    .main-content {
        padding: 10px 15px 20px;
    }
}

@media screen and (max-width: 480px) {
    .hero-image,
    .hero-video {
        width: 100%;
        max-height: 260px;
        object-fit: cover;
        object-position: center;
    }

    .container {
        padding: 10px;
    }

    .header {
        padding: 15px 12px;
        padding-top: 20px;
    }

    .profile-section {
        flex-direction: row;
        align-items: flex-start;
        gap: 14px;
    }

    .profile-photo {
        width: 110px;
        height: 155px;
        margin-top: 0;
        border: none;
        box-shadow: none;
    }

    .name {
        font-size: 1.35em;
        margin-bottom: 8px;
        letter-spacing: 0.02em;
    }

    .name-section {
        margin-top: 0;
        flex: 1;
        min-width: 0;
    }

    .about-inline .content {
        font-size: 0.88em;
        line-height: 1.35;
    }

    .about-inline .content p {
        margin-bottom: 6px;
    }

    .top-nav {
        display: none;
    }

    .header::after {
        margin-top: 15px;
    }

    .main-content {
        padding: 8px 12px 16px;
    }

    .section {
        padding-top: 16px;
        margin-bottom: 6px;
    }

    .section-title {
        font-size: 1.25em;
        padding-left: 12px;
        border-left-width: 3px;
        margin-bottom: 12px;
    }

    .content {
        font-size: 0.95em;
    }

    .research-item {
        padding: 14px;
        gap: 14px;
        flex-direction: column;
    }

    .research-title {
        font-size: 1em;
    }

    .research-supervisor,
    .research-meta {
        font-size: 0.85em;
    }

    .research-description {
        font-size: 0.88em;
    }

    .research-image-wrapper {
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }

    .research-image-frame {
        height: 180px;
    }

    .research-toggle {
        font-size: 0.72em;
    }

    .education-item {
        padding: 12px;
    }

    .education-content {
        flex-direction: row;
        gap: 12px;
    }

    .education-image-wrapper {
        width: 60px;
        height: 60px;
        padding: 6px;
    }

    .education-degree {
        font-size: 0.95em;
    }

    .education-school {
        font-size: 0.88em;
    }

    .education-year {
        font-size: 0.82em;
    }

    .awards-list li {
        font-size: 0.9em;
        padding: 8px 0 8px 22px;
    }

    .theme-toggle {
        top: 8px;
        left: 8px;
        width: 36px;
        height: 36px;
        font-size: 1.1em;
    }

    .footer {
        padding: 20px 12px;
        margin-top: 24px;
    }

    .footer-text {
        font-size: 0.78em;
    }

    /* Gallery album page */
    .gallery-title {
        font-size: 1.4em;
    }

    .gallery-content {
        padding: 12px;
    }

    .gallery-grid {
        gap: 4px;
    }

    .gallery-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }

    .gallery-item {
        padding: 1px;
    }

    body {
        background-attachment: scroll;
    }

    body.dark-theme {
        background-image: url('../images/dark-bg-mobile.jpeg');
        background-size: cover;
        background-position: center top;
        background-attachment: scroll;
    }
}

/* ============================================
   Editorial Album Layout
   ============================================ */

/* Album container - replaces old gallery grid */
.album-editorial {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* Album back link */
.album-back-link {
    position: fixed;
    top: 22px;
    left: 60px;
    z-index: 999;
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: color 0.3s ease;
}

.album-back-link:hover {
    color: var(--accent-color);
}

/* Hero cover section */
.album-hero {
    position: relative;
    width: 100%;
    max-height: 35vh;
    overflow: hidden;
    margin-bottom: clamp(40px, 6vw, 80px);
    transition: opacity 0.1s ease-out;
}

.album-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.album-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.45), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px 48px;
}

.album-hero-title {
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 2.8rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.15em;
    margin: 0 0 8px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.album-hero-tagline {
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.08em;
    margin: 0 0 6px;
    font-style: italic;
}

.album-hero-date {
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
    font-weight: 300;
    letter-spacing: 0.1em;
}

/* ---- Photo group layouts ---- */
.photo-group {
    margin-bottom: clamp(60px, 8vw, 120px);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.photo-group.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.photo-group .album-photo:nth-child(2) { transition-delay: 0.15s; }
.photo-group .album-photo:nth-child(3) { transition-delay: 0.3s; }

/* Individual photo styling */
.album-editorial .album-photo {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 2px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.dark-theme .album-editorial .album-photo {
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.album-editorial .album-photo:hover {
    transform: scale(1.015);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.album-editorial .album-photo img {
    width: 100%;
    display: block;
}

/* Photo sequence number */
.album-editorial .album-photo::after {
    content: attr(data-seq);
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-family: 'EB Garamond', monospace;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.05em;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Mode A — Full width hero shot */
.layout-A {
    display: block;
}

.layout-A .album-photo {
    width: 100%;
    aspect-ratio: auto;
}

.layout-A .album-photo img {
    height: auto;
    object-fit: contain;
}

/* Mode B — Asymmetric duo (65/32) */
.layout-B {
    display: grid;
    grid-template-columns: 65fr 32fr;
    gap: 16px;
    align-items: end;
}

/* Mode B reversed */
.layout-B-rev {
    display: grid;
    grid-template-columns: 32fr 65fr;
    gap: 16px;
    align-items: end;
}

/* Mode C — Triple equal */
.layout-C {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    align-items: end;
}

/* Mode D — Centered small (contemplative) */
.layout-D {
    display: flex;
    justify-content: center;
}

.layout-D .album-photo {
    width: 55%;
    aspect-ratio: auto;
}

.layout-D .album-photo img {
    height: auto;
    object-fit: contain;
}

/* Mode E — Vertical pair */
.layout-E {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    align-items: end;
}

/* ---- Interstitial text ---- */
.interstitial {
    text-align: center;
    margin: clamp(40px, 6vw, 80px) 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.interstitial.visible {
    opacity: 1;
    transform: translateY(0);
}

.interstitial p {
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 1.1rem;
    font-style: italic;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.6;
}

/* ---- Album footer ---- */
.album-fin {
    text-align: center;
    padding: 60px 0 40px;
    margin-top: 40px;
}

.album-fin::before {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: var(--border-color);
    margin: 0 auto 30px;
}

.album-fin-text {
    font-family: 'EB Garamond', Garamond, serif;
    font-size: 1rem;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    margin: 0 0 20px;
}

.album-fin .back-link {
    font-size: 0.9rem;
}

/* ---- Album Lightbox ---- */
.album-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    align-items: center;
    justify-content: center;
}

.album-lightbox.active {
    display: flex;
}

.album-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 2px;
}

.album-lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.album-lightbox-close::before,
.album-lightbox-close::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 1.5px;
    background: rgba(255,255,255,0.7);
    transition: background 0.3s;
}

.album-lightbox-close::before { transform: rotate(45deg); }
.album-lightbox-close::after { transform: rotate(-45deg); }
.album-lightbox-close:hover::before,
.album-lightbox-close:hover::after { background: #fff; }

.album-lightbox-prev,
.album-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 2rem;
    cursor: pointer;
    padding: 20px;
    transition: color 0.3s;
    user-select: none;
    font-family: 'EB Garamond', serif;
}

.album-lightbox-prev:hover,
.album-lightbox-next:hover { color: #fff; }
.album-lightbox-prev { left: 20px; }
.album-lightbox-next { right: 20px; }

/* ---- Responsive ---- */
@media screen and (max-width: 768px) {
    .album-hero {
        aspect-ratio: 16 / 9;
    }

    .album-hero-overlay {
        padding: 24px 28px;
    }

    .album-hero-title {
        font-size: 1.8rem;
    }

    .layout-B,
    .layout-B-rev {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .layout-C {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .layout-D .album-photo {
        width: 70%;
    }

    .layout-E {
        max-width: 100%;
        gap: 10px;
    }
}

@media screen and (max-width: 480px) {
    .album-hero {
        aspect-ratio: 16 / 9;
        margin-bottom: 40px;
    }

    .album-hero-overlay {
        padding: 16px 20px;
    }

    .album-hero-title {
        font-size: 1.4rem;
        letter-spacing: 0.08em;
    }

    .album-hero-tagline {
        font-size: 0.82rem;
    }

    .album-editorial {
        padding: 0 12px 40px;
    }

    .photo-group {
        margin-bottom: clamp(40px, 6vw, 60px);
    }

    .layout-B,
    .layout-B-rev,
    .layout-C,
    .layout-E {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .layout-C .album-photo {
        aspect-ratio: auto;
    }

    .layout-D .album-photo {
        width: 90%;
    }

    .layout-E .album-photo {
        aspect-ratio: auto;
    }

    .interstitial p {
        font-size: 0.95rem;
    }

    .album-lightbox-prev { left: 8px; padding: 12px; }
    .album-lightbox-next { right: 8px; padding: 12px; }
}
