:root {
    /* Fonts */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-display: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, SF Mono, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    /* Typographic Hierarchy (Design Tokens) */
    --fs-h1: 1.5rem;      /* 24px - Name / Page Title */
    --fs-h2: 1.25rem;     /* 20px - Section Headings */
    --fs-h3: 1.0rem;      /* 16px - Sub-headings (Roles, paper titles) */
    --fs-body: 0.875rem;  /* 14px - Body text (paragraphs, authors, meta, venue badge) */
    --fs-small: 0.75rem;  /* 12px - Small utility (dates, status badges, buttons, footer) */
}

/* Light Theme Variables */
:root, [data-theme="light"] {
    --bg-color: #f8fafc;
    --bg-gradient: radial-gradient(circle at 50% 50%, #f8fafc, #e2e8f0);
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #0f172a;
    --text-muted: #475569;
    --border-color: rgba(15, 23, 42, 0.08);
    --primary-color: #4f46e5;      /* Indigo 600 */
    --primary-hover: #3730a3;      /* Indigo 800 */
    --secondary-color: #7c3aed;    /* Violet 600 */
    --secondary-hover: #6d28d9;    /* Violet 800 */
    --tag-bg: rgba(79, 70, 229, 0.08);
    --venue-bg: rgba(79, 70, 229, 0.05);
    --venue-border: rgba(79, 70, 229, 0.15);
    --status-bg: rgba(16, 185, 129, 0.1);
    --status-text: #047857;
    --summary-bg: rgba(0, 0, 0, 0.02);
    --link-bg: #ffffff;
    --link-text: #475569;
    --link-border: #cbd5e1;
    --profile-link-bg: rgba(0, 0, 0, 0.02);
    --profile-link-hover-bg: rgba(79, 70, 229, 0.05);
    --bibtex-filter: none;
    --footer-text: #64748b;
    --card-shadow: 0 8px 20px -5px rgba(148, 163, 184, 0.15), 0 6px 12px -8px rgba(148, 163, 184, 0.1);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-color: #0b0f19;
    --bg-gradient: radial-gradient(circle at 50% 50%, #0e121a, #07090e);
    --card-bg: rgba(18, 24, 38, 0.65);
    --text-primary: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-color: #6366f1;      /* Indigo 500 */
    --primary-hover: #818cf8;      /* Indigo 400 */
    --secondary-color: #8b5cf6;    /* Violet 500 */
    --secondary-hover: #a78bfa;    /* Violet 400 */
    --tag-bg: rgba(99, 102, 241, 0.15);
    --venue-bg: rgba(99, 102, 241, 0.08);
    --venue-border: rgba(99, 102, 241, 0.2);
    --status-bg: rgba(52, 211, 153, 0.15);
    --status-text: #a7f3d0;
    --summary-bg: rgba(255, 255, 255, 0.03);
    --link-bg: rgba(30, 41, 59, 0.5);
    --link-text: #cbd5e1;
    --link-border: rgba(255, 255, 255, 0.1);
    --profile-link-bg: rgba(255, 255, 255, 0.03);
    --profile-link-hover-bg: rgba(99, 102, 241, 0.1);
    --bibtex-filter: invert(1) brightness(0.9);
    --footer-text: #475569;
    --card-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(255, 255, 255, 0.05);
}

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

body {
    background: var(--bg-gradient);
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    padding: 1.5rem 1rem;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.container {
    max-width: 1050px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .container {
        grid-template-columns: 260px 1fr;
        align-items: start;
    }
    
    .profile-card {
        position: sticky;
        top: 2rem;
    }
}

/* Profile Card Styling */
.profile-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem 1.25rem;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.3s ease;
}

.avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.2);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.avatar-wrapper:hover {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.35);
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background-color: var(--bg-color);
}

.profile-card .name {
    font-family: var(--font-display);
    font-size: var(--fs-h1);
    font-weight: 800;
    margin-bottom: 0.2rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.native-name {
    font-family: var(--font-sans);
    font-size: var(--fs-h3);
    font-weight: 500;
    color: var(--text-muted);
    display: block;
    margin-top: 0.05rem;
}

.profile-card .role {
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0.5rem;
    margin-bottom: 0.15rem;
}

.profile-card .affiliation {
    color: var(--text-muted);
    font-size: var(--fs-body);
    margin-bottom: 0.25rem;
}

.profile-card .email {
    color: var(--text-muted);
    font-size: var(--fs-body);
    margin-bottom: 1rem;
}

.divider {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

.profiles-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.profiles-list a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--profile-link-bg);
    border: 1px solid var(--border-color);
}

.profiles-list a:hover {
    color: var(--primary-color);
    background: var(--profile-link-hover-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15);
}

.profiles-list a svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Main Content Area Styling */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.3s ease;
}

.section h2 {
    font-family: var(--font-display);
    font-size: var(--fs-h2);
    font-weight: 800;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.4rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 1.5px;
}

/* Bio Section Styling */
.bio-content p {
    margin-bottom: 0.85rem;
    color: var(--text-muted);
    font-size: var(--fs-body);
    line-height: 1.6;
}

.bio-content p:last-child {
    margin-bottom: 0;
}

.bio-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.bio-content a:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
}

/* News Section Styling */
.news-list {
    display: flex;
    flex-direction: column;
}

.news-item {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    align-items: baseline;
    transition: transform 0.2s ease;
}

.news-item:first-child {
    padding-top: 0;
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-item:hover {
    transform: translateX(4px);
}

.news-item .date {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--primary-color);
    font-size: var(--fs-small);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--tag-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    text-align: center;
    display: inline-block;
}

.news-item div:last-child {
    color: var(--text-muted);
    font-size: var(--fs-body);
}

.news-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.news-item a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Publications Section Styling */
.publications-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.publication-year {
    font-family: var(--font-display);
    font-size: var(--fs-h2);
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.2rem;
    border-bottom: 2px solid var(--border-color);
    width: 100%;
    position: relative;
}

.publication-year:first-child {
    margin-top: 0;
}

.publication {
    display: grid;
    grid-template-columns: 85px 1fr;
    gap: 1.25rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.01);
}

.publication:hover {
    transform: translateY(-2px) scale(1.002);
    border-color: var(--primary-color);
    box-shadow: var(--card-shadow);
}

.pub-venue {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-body);
    color: var(--primary-color);
    letter-spacing: 0.05em;
    background: var(--venue-bg);
    padding: 0.4rem 0.3rem;
    border-radius: 8px;
    text-align: center;
    height: fit-content;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid var(--venue-border);
}

.pub-left-award {
    font-size: 2rem;
    text-align: center;
    line-height: 1;
    margin: 0.1rem 0;
    filter: drop-shadow(0 2px 4px rgba(234, 179, 8, 0.25));
}

.pub-left {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
}

.pub-left-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pub-left-links .pub-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--fs-small);
    font-weight: 700;
    padding: 0.25rem 0.3rem;
    width: 100%;
    box-sizing: border-box;
}

.pub-left-links .pub-link-icon {
    font-size: var(--fs-small);
}

.publication h3 {
    margin: 0 0 0.35rem 0;
    font-size: var(--fs-h3);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.pub-title {
    color: var(--text-primary);
}

.copy-title-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 0 0.35rem;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    vertical-align: middle;
    outline: none;
}

.publication:hover .copy-title-btn {
    opacity: 0.6;
}

.copy-title-btn:hover {
    color: var(--primary-color) !important;
    opacity: 1 !important;
    transform: scale(1.1);
}

.copy-title-btn:active {
    transform: scale(0.95);
}

.copy-title-btn svg {
    display: block;
}

.copy-title-btn.copied {
    color: var(--status-text) !important;
    opacity: 1 !important;
}

.copied-check {
    font-size: var(--fs-small);
    font-weight: 700;
    color: var(--status-text);
    animation: scaleIn 0.15s ease-out;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.publication .status {
    font-size: var(--fs-small);
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    background: var(--status-bg);
    color: var(--status-text);
    border-radius: 5px;
    margin-left: 0.5rem;
    vertical-align: middle;
    letter-spacing: 0.05em;
}

.publication .authors {
    margin: 0 0 0.35rem 0;
    font-size: var(--fs-body);
    color: var(--text-muted);
}

.publication .authors strong {
    color: var(--text-primary);
    font-weight: 700;
}

.publication .summary {
    margin: 0.5rem 0;
    font-size: var(--fs-body);
    color: var(--text-muted);
    background: var(--summary-bg);
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--primary-color);
    border-radius: 0 6px 6px 0;
    line-height: 1.45;
}

.publication .meta {
    margin: 0 0 0.5rem 0;
    font-size: var(--fs-small);
    color: var(--text-muted);
}

.pub-award {
    margin: 0.35rem 0;
    font-size: var(--fs-body);
    font-weight: 700;
    color: #ca8a04;
    background: rgba(202, 138, 4, 0.05);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid #ca8a04;
    display: inline-block;
}

[data-theme="dark"] .pub-award {
    color: #fde047;
    background: rgba(253, 224, 71, 0.08);
    border-left-color: #fde047;
}

.publication .links {
    margin: 0.5rem 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pub-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--fs-small);
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.65rem;
    background: var(--link-bg);
    color: var(--link-text);
    border: 1px solid var(--link-border);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pub-link:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.2);
}

.pub-link-icon {
    font-size: var(--fs-small);
}

.pub-link-bib img {
    width: 12px;
    height: 12px;
    object-fit: contain;
    filter: var(--bibtex-filter);
    transition: filter 0.2s ease;
}

.pub-link-bib:hover img {
    filter: brightness(0) invert(1);
}

/* Service Section Styling */
.services-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .services-list {
        grid-template-columns: 1fr 1fr;
    }
}

.service-group {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.15rem;
    box-shadow: var(--card-shadow);
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.3s ease;
}

.service-group h3 {
    margin: 0 0 0.75rem 0;
    font-size: var(--fs-h3);
    font-weight: 800;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.service-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.service-items li {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    font-size: var(--fs-body);
    line-height: 1.4;
}

.service-items li .date {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
}

.service-items li span:last-child {
    color: var(--text-muted);
}

.service-items li span:last-child a,
.service-items li span:last-child .service-item-name {
    color: var(--text-primary);
    font-weight: normal;
}

.service-items li span:last-child a {
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.service-items li span:last-child a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Theme Toggle Button */
.theme-toggle-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

#theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    transform: scale(1.08) rotate(15deg);
    border-color: var(--primary-color);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.15);
}

#theme-toggle .sun-icon {
    display: none;
    font-size: var(--fs-h2);
}

#theme-toggle .moon-icon {
    display: block;
    font-size: var(--fs-h2);
}

[data-theme="light"] #theme-toggle .sun-icon {
    display: block;
}

[data-theme="light"] #theme-toggle .moon-icon {
    display: none;
}

/* Footer Styling */
footer {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    color: var(--footer-text);
    font-size: var(--fs-small);
    transition: border-color 0.4s ease, color 0.4s ease;
}

/* Responsive adjustment for Mobile and Tablets */
@media (max-width: 1023px) {
    body {
        padding: 4.5rem 0.75rem 1.5rem 0.75rem;
    }
}

@media (max-width: 640px) {
    .news-item {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
    
    .news-item .date {
        align-self: start;
        width: fit-content;
    }
    
    .publication {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    
    .pub-left {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
    }
    
    .pub-left-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    
    .pub-left-links .pub-link {
        width: auto;
        font-size: var(--fs-small);
        padding: 0.25rem 0.5rem;
    }
    
    .pub-venue {
        width: fit-content;
        padding: 0.3rem 0.6rem;
    }
}
