@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* =============================================
   TABLE OF CONTENTS
   =============================================
   1. CSS Variables (Root)
   2. Base & Typography Styles (Global)
   3. Reusable Components (Buttons, etc.)
   4. Header & Navigation
   5. Footer
   6. Hero Section
   7. Research Interest Section
   8. Education Section
   9. Selected Work Section
   10. Page-Specific Styles：Landing Page
   ============================================= */


/* --- 1. CSS Variables (Root) --- */
:root {
    --font-heading: 'Jost', "Noto Sans SC", sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans SC", sans-serif;
   
    --color-background: #F4F7F9;    /* 青白 Icy Off-White for the main background */
    --color-border: #DDE4EC;        /* Cool Gray for borders */
    --color-text: #1C2D3D;          /* Deep Slate Navy for main text */
    --color-text-light:#64748B;    /* Cool Slate, muted version of the main text color */
    
    --color-primary-accent: #D63F78	; /* 鹃华 */
    --color-secondary-accent: #74B5D1; /* 涧岚 */
    --color-tertiary-accent: #CF8FCB; /* 鸢雾 */

    --color-card-1: #542249; /* 珙桐 */
    --color-card-2: #182A45; /* 岭霄 */
    --color-card-3: #474B52; /* 苍岩 */
}

/* --- 2. Base & Typography Styles (Global) --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
}

h1, h2, h3, .landing-phrase {
    font-family: var(--font-heading);
    font-weight: 600;
}

.timeline-date, .status-badge {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- 3. Reusable Components (Buttons, etc.) --- */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 0;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid transparent;
    cursor: pointer;

    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background-color: transparent;
}

/* Primary Button Modifier (Solid) */
.btn.btn-primary {
    background-color: var(--color-primary-accent);
    color: var(--color-background);
    border-color: var(--color-primary-accent);
}
.btn.btn-primary:hover {
    background-color: transparent;
    color: var(--color-primary-accent);
}

/* Secondary Button Modifier (Outline) */
.btn.btn-secondary {
    border-color: var(--color-secondary-accent);
    color: var(--color-secondary-accent);
    padding: 7px 16px;
    font-size: 0.7rem;
}
.btn.btn-secondary:hover {
    background-color: var(--color-secondary-accent);
    /* 后面的 var(--color-background) 是兜底选项，万一按钮放在卡片外面，文字就变回网页的冰白色 */
    color: var(--current-card-bg, var(--color-background));
    border-color: transparent;
}
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1rem;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-background);
    background-color: var(--color-tertiary-accent);
}

/* --- Reusable Card Component --- */
.card {
    color: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
    display: flex; /* Use flexbox for internal layout */
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card h2, 
.card h3, 
.card .project-title {
    color: var(--color-background); 
}

/* Card Layout Modifiers */
.card-vertical {
    flex-direction: column;
}
.card-horizontal {
    flex-direction: row;
}
/* Modifier for default light-background cards */
.card-default {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
}
/* --- Automatic Card Coloring --- */
.card:nth-last-child(3n + 1) { 
    --current-card-bg: var(--color-card-1); 
    background-color: var(--current-card-bg); 
    border-color: transparent;
}
.card:nth-last-child(3n + 2) { 
    --current-card-bg: var(--color-card-2); 
    background-color: var(--current-card-bg); 
    border-color: transparent;
}
.card:nth-last-child(3n + 3) { 
    --current-card-bg: var(--color-card-3); 
    background-color: var(--current-card-bg); 
    border-color: transparent;
}

/* --- 4. Header & Navigation --- */
/* Website Header */
.site-header {
    width: 100%;
    padding: 0.3rem     5%           0.1rem;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--color-background);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    transition: padding 0.3s ease-in-out;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo */
.header-logo .logo-image {
    height: 80px;
    width: auto;
    display: block;
}

/* Wordmark */
.header-mark-center {
    display: flex;
    gap: 3rem;
}
.header-wordmark {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--color-card-3);
    font-size: 1.7rem;
    pointer-events: none;
}

/* Social Icon */
.header-nav-social {
    display: flex;
    align-items: center;
    gap: 1.8rem;
}

.icon-container {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
}

.social-icon {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* 将纯黑转换成 #4F4F4F */
    /* 魔法原理：invert(31%) 刚好能把黑色 RGB(0,0,0) 提亮到 RGB(79,79,79)，完美等同于 #4F4F4F */
    filter: invert(31%);
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.icon-container:hover .social-icon {
    filter: brightness(0) saturate(100%) invert(21%) sepia(16%) saturate(1868%) hue-rotate(290deg) brightness(99%) contrast(89%);
}

/* --- Mobile Header --- */
.mobile-nav-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(244, 247, 249, 0.9);
    backdrop-filter: blur(25px); 
    -webkit-backdrop-filter: blur(25px);

    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateY(-100%);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.mobile-nav-container.active {
    transform: translateY(0);
}

.menu-toggle {
    display: none;
    width: 28px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}
.menu-toggle span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: var(--color-text);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: center;
}
.menu-toggle.active span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
    transform: translateY(-5px) rotate(-45deg);
}

/* This styles the container for the icons */
.mobile-nav-social {
    display: flex; /* Arranges the icons in a horizontal row */
    justify-content: center;
    gap: 2.5rem;
    margin-top: 0.5rem;
}

/* This makes the icons larger and easier to tap on mobile */
.mobile-nav-social .icon-container {
    width: 28px;
    height: 28px;
}

@media (max-width: 992px) {
    .header-nav-center, .header-nav-social {
        display: none;
    }
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    .header-logo .logo-image {
        height: 70px; 
    }
}

@media (min-width: 993px) {
    .header-nav-center, .header-nav-social {
        display: flex;
    }
    .menu-toggle {
        display: none;
    }
    /* 强制隐藏手机菜单，防止窗口从窄变宽时残留 */
    .mobile-nav-container {
        transform: translateY(-100%) !important;
    }
}

/* --- 5. Footer --- */
footer {
    position: relative;
    background-color: var(--color-border);
    overflow: hidden;
    padding: 3rem 5%;
    
    background-image: url("images/foot_pattern.svg");
    background-repeat: repeat;
    background-position: top center;
    background-size: 180px;
    background-attachment: fixed;
}
footer::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(28, 45, 61, 0.70);
    z-index: 1;
}
footer > * {
    position: relative;
    z-index: 2;
}
.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    font-family: var(--font-heading);
    color: var(--color-background);
    font-size: 0.9rem;
}

/* Style for each of the three sections */
.footer-brand,
.footer-copyright,
.footer-action {
    flex: 1; /* Each section takes up equal space */
}

.footer-logo-image {
    height: 75px; /* Control logo size */
    width: auto;
    display: block;
    opacity: 0.8; /* Subtly fade the logo for a softer look */
    transition: opacity 0.3s ease;
}
.footer-logo-image:hover {
    opacity: 1; /* Bring to full opacity on hover */
}

.footer-brand {
    text-align: left;
}
.footer-copyright {
    text-align: center;
}
.footer-action {
    flex: 1;
    text-align: right;
}

.footer-action .btn-secondary {
    background-color: var(--color-background);
    color: var(--color-text);
    border-color: transparent;
}
.footer-action .btn-secondary:hover {
    background-color: transparent; /* 背景完全抽空，透出 Footer 的深色滤镜和花纹 */
    color: var(--color-background); /* 文字反转成白色，漂浮在夜色中 */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); /* 加一点极弱的环境阴影，防止文字完全贴死在背景上 */
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column; /* Stack the elements vertically */
        gap: 1.5rem;
    }

    .footer-brand,
    .footer-copyright,
    .footer-action {
        text-align: center;
    }
}

/* General Section Styling */
main section {
    padding: 6rem 5%;
}
main section:nth-child(even) {
    background-color: #f9f9f9;
}
.container {
    max-width: 1280px;
    margin: 0 auto;
}
.section-heading {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--color-text);
}

/* --- 6. Hero Section --- */
.hero-section {
    background-color: var(--color-background);
    padding-top: 10rem;
    padding-bottom: 6rem;
}
.hero-container {
    display: flex;
    align-items: center;
    gap: 4rem;
}
.hero-text { flex: 1.5; }
.hero-text h1 {
    font-size: 3.6rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.1;
}
.hero-text .tagline {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.hero-facts {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    font-size: 1rem;
    color: var(--color-text-light);
}
.fact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.fact-item i {
    color: var(--color-text);
    width: 20px; /* Ensures consistent alignment */
    text-align: center;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}
.hero-buttons .btn {
    padding: 9px 21px;
    font-size: 0.9rem;
}

.hero-photo {
    flex: 1;
    max-width: 350px;
}
.hero-photo img {
    width: 100%;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* --- 7. Research Interest Section --- */
.interest-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin: 0 auto;
    max-width: 1300px;
}

.interest-card.card-vertical {
    width: 360px; 
    padding: 2rem 1.8rem;
    display: flex;
    flex-direction: column;
    
    background-color: transparent !important; 
    border: 4px solid var(--current-card-bg, var(--color-border)) !important;
    box-shadow: none;
}
.interest-card h2,
.interest-card h3,
.interest-card .interest-title {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 0 0.6rem 0;
    color: var(--current-card-bg, var(--color-text)) !important
}
.interest-card .interest-body {
    display: flex;
    flex-direction: column;
}
.interest-card .interest-text {
    color: var(--color-text-light) !important;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .interests-row {
        gap: 1.5rem;
        padding: 0 1.5rem;
    }
    .interest-card.card-vertical {
        width: 100%;
        min-height: auto; 
        padding: 1.8rem 1.5rem;
    }
}

/* --- 8. Education Section --- */
.timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 5px; /* Start line at the dot */
    bottom: 5px; /* End line at the last dot */
    width: 2px;
    background-color: var(--color-border);
}
.timeline-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 3rem; /* Changed from margin-bottom for better line alignment */
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-dot {
    position: absolute;
    left: 0;
    top: 5px;
    width: 18px;
    height: 18px;
    border: 3px solid var(--color-text);
    border-radius: 50%;
    background-color: var(--color-background);
}
.timeline-date {
    font-weight: 500;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}
.timeline-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.timeline-content p {
    color: var(--color-text-light);
}

/* --- CTA and button Section --- */
.cta-section { text-align: center; }
.cta-section p {
    max-width: 60ch;
    margin: 1.5rem auto 2.5rem;
    color: var(--color-text-light);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

@media (max-width: 768px) {
    main section { padding: 4rem 5%; }
    .section-heading {
        font-size: 2rem;
        margin-bottom: 3rem;
    }

    .hero-section { padding-top: 8rem; }
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
    }
    .hero-text h1 { font-size: 2rem; }
    .hero-text .tagline {font-size: 1.1rem;}
    .quick-facts { align-items: center; }
    .hero-buttons { justify-content: center; }

    .timeline::before { left: 8px; }
    .timeline-item { padding-left: 40px; }
}

/* --- 9. Selected Work Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: stretch;
    max-width: 950px;
    margin-left: auto;
    margin-right: auto;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
}
.project-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}
.project-links {
    margin-top: auto; /* Pushes the links to the bottom of the card */
    padding-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.project-card {
    padding: 2rem 2%;
}
/* --- Project Card State Controller --- */
/* default */
.project-card .status-badge,
.project-card .links-upcoming {
    display: none;
}
.project-card .links-available {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* .in-progress */
.project-card.in-progress .status-badge,
.project-card.in-progress .links-upcoming {
    display: block;
}
.project-card.in-progress .links-available {
    display: none;
}
/* ---special visual style for status "In Progress" --- */
.project-card.in-progress {
    position: relative;
    border-left: none;
}
.project-card.in-progress::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 8px;
    background: linear-gradient(135deg, #C79FCB 0%, #EAAEC0 100%);
    z-index: 10;
}
.status-badge {
    display: inline-block;
    flex-shrink: 0;
    margin-top: 4px;
    background: linear-gradient(135deg, #C79FCB 0%, #EAAEC0 100%);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 99px;
    animation: pulse 2.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(199, 159, 203, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(199, 159, 203, 0); }
    100% { box-shadow: 0 0 0 0 rgba(199, 159, 203, 0); }
}

.links-upcoming p {
    font-size: 0.9rem;
    color: var(--color-tertiary-accent);
    font-style: italic;
    font-weight: bold;
    margin: 0;
}

@media (max-width: 480px) {
    .project-header {
        flex-direction: column; /* Stack the badge below the text */
        align-items: flex-start;
    }
    .status-badge {
        margin-top: 1rem; /* Add some space when stacked */
    }
}
@media (max-width: 768px) {
    .project-card, 
    .post-card-content {
        padding: 2.5rem 1.5rem;
    }
}

/* --- 10. Landing Page  --- */
.landing-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    /* Changed from dark theme to your new light background */
    background-color: var(--color-background); 
    /* Default text color now uses your main text variable */
    color: var(--color-text); 
    overflow: hidden;
    cursor: pointer;
}

.landing-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-container {
    text-align: center;
    animation: fadeIn 1.5s ease-out both;
}

/* This wrapper will act as the positioning container */
.clock-wrapper {
    position: relative; /* Establishes a positioning context for the icon */
    width: 200px; /* Should match the width of .time-chart */
    height: 200px; /* Should match the height of .time-chart */
    margin: 0 auto; /* Keeps the whole clock component centered */
}

.clock-center-icon {
    /* Absolute positioning to place it on top of the clock */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* The key to perfect centering */
    width: 60px;
    height: 54px;
    /* Ensure the icon is on top of the SVG arcs */
    z-index: 10;
}

.time-chart {
    width: 200px;
    height: 200px;
    transform: rotate(-90deg); /* Start arcs from the top */
}

.time-track {
    fill: none;
    /* Faint track using a transparent version of the main text color */
    stroke: hsla(from var(--color-text) h s l / 0.15); 
    stroke-width: 8;
}

.time-arc {
    fill: none;
    stroke: var(--color-text); 
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

#hours-arc { 
    stroke: var(--color-primary-accent); 
    stroke-width: 10; 
}
#minutes-arc { 
    stroke: var(--color-secondary-accent); 
    stroke-width: 8; 
}
#seconds-arc { 
    stroke: var(--color-text-light); 
    stroke-width: 4; 
    opacity: 0.8;
}

.landing-phrase {
    font-size: 1.2rem;
    color: var(--color-text); 
    margin-top: 2.5rem;
    letter-spacing: 0.5px;
}

.landing-instruction {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--color-text-light);
    opacity: 0.7;
    margin-top: 2.5rem;
    letter-spacing: 0.5px;
    text-transform: lowercase;

    animation: breathing-effect 3s ease-in-out infinite;
}
/* A simple fade-in animation for the whole container */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* --- Animation for Breathing Effect --- */
@keyframes breathing-effect {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.5;
    }
}

@media (max-width: 480px) {
    .clock-wrapper {
        width: 160px;
        height: 160px;
    }

    .time-chart {
        width: 160px;
        height: 160px;
    }

    .clock-center-icon {
        width: 48px;
        height: 43.2px;
    }

    .landing-phrase {
        font-size: 1rem;
        margin-top: 2rem;
    }

    .time-track {
        stroke-width: 6;
    }
    .time-arc {
        stroke-width: 6;
    }
    #hours-arc { stroke-width: 8; }
    #seconds-arc { stroke-width: 3; }
}