:root {
    --bg: #f8f9fa;
    --card-bg: white;
    --text: #2c3e50;
    --text-secondary: #34495e;
    --text-muted: #7f8c8d;
    --accent: #5dade2;
    --accent-hover: #2980b9;
    --venue: #27ae60;
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.05);
    --shadow-hover: rgba(0, 0, 0, 0.1);
    --toggle-bg: #e0e0e0;
}

[data-theme="dark"] {
    --bg: #121212;
    --card-bg: #1e1e1e;
    --text: #e0e0e0;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --accent: #64b5f6;
    --accent-hover: #90caf9;
    --venue: #81c784;
    --border: #333333;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
    --toggle-bg: #333333;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #121212;
        --card-bg: #1e1e1e;
        --text: #e0e0e0;
        --text-secondary: #cccccc;
        --text-muted: #888888;
        --accent: #64b5f6;
        --accent-hover: #90caf9;
        --venue: #81c784;
        --border: #333333;
        --shadow: rgba(0, 0, 0, 0.3);
        --shadow-hover: rgba(0, 0, 0, 0.5);
        --toggle-bg: #333333;
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    line-height: 1.6; color: var(--text); background: var(--bg); padding-top: 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

.top-controls { position: fixed; top: 16px; right: 16px; display: flex; gap: 10px; z-index: 1000; }
.language-toggle, .theme-toggle {
    border: none; background: var(--toggle-bg); color: var(--text); cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: background 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}
.language-toggle {
    min-width: 76px; height: 40px; padding: 0 12px; border-radius: 20px; font-size: 13px; font-weight: 700;
}
.theme-toggle {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--toggle-bg); color: var(--text); font-size: 18px; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: background 0.3s ease, transform 0.3s ease;
}

.language-toggle:hover, .theme-toggle:hover { transform: scale(1.05); }
.container { max-width: 900px; margin: 0 auto; padding: 60px 20px; }
header { text-align: center; margin-bottom: 60px; padding-bottom: 40px; border-bottom: 2px solid var(--border); }
.name { font-size: 42px; font-weight: 700; margin-bottom: 10px; color: var(--text-secondary); }
.subtitle { font-size: 16px; color: var(--text-muted); margin-bottom: 20px; }
.contact { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-top: 25px; }
.contact a { color: var(--accent); text-decoration: none; font-weight: 600; transition: all 0.3s ease; border-bottom: 2px solid transparent; }
.contact a:hover { color: var(--accent-hover); border-bottom: 2px solid var(--accent-hover); }
.section { margin-bottom: 50px; }
.section-title { font-size: 24px; font-weight: 700; margin-bottom: 25px; color: var(--text); padding-bottom: 10px; border-left: 4px solid var(--accent); padding-left: 15px; }

.intro {
    font-size: 15px; line-height: 1.8; color: var(--text-secondary); background: var(--card-bg); padding: 25px;
    border-radius: 8px; box-shadow: 0 2px 8px var(--shadow); transition: background 0.3s ease, box-shadow 0.3s ease;
}

.intro a, .paper-links a, .project-links a { color: var(--accent); text-decoration: none; font-weight: 600; }
.intro a:hover, .paper-links a:hover, .project-links a:hover { text-decoration: underline; }

.paper, .project {
    background: var(--card-bg); border-radius: 8px; padding: 20px; margin-bottom: 20px; display: flex; gap: 20px;
    transition: all 0.3s ease; box-shadow: 0 2px 8px var(--shadow);
}

.paper:hover, .project:hover { box-shadow: 0 4px 16px var(--shadow-hover); }
.paper-img, .edu-logo { flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.paper-img img { width: auto; height: auto; max-width: 200px; max-height: 150px; }
.paper-content, .edu-info { flex: 1; }
.paper-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.paper-authors { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.paper-authors strong { color: var(--accent); }
.paper-venue { font-size: 13px; color: var(--venue); font-weight: 600; margin-bottom: 8px; }
.paper-links, .project-links { display: flex; gap: 15px; flex-wrap: wrap; font-size: 13px; }
.paper-description { font-size: 13px; color: var(--text-secondary); margin-top: 10px; }

.project-img { flex: 0 0 200px; display: flex; align-items: center; justify-content: center; }
.project-img img { display: block; width: 100%; height: 150px; object-fit: contain; border-radius: 4px; }
.project-content { flex: 1; min-width: 0; }
.project-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.project-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.project-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.project-highlight { font-size: 13px; color: var(--venue); font-weight: 600; margin-bottom: 8px; }
.project-description { font-size: 13px; color: var(--text-secondary); margin-top: 10px; line-height: 1.6; }

.education { display: flex; gap: 20px; margin-bottom: 20px; align-items: flex-start; }
.edu-logo img { width: auto; height: auto; max-width: 120px; max-height: 120px; }
.edu-school { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.edu-time { font-size: 13px; color: var(--text-muted); }
.edu-degree { font-size: 13px; color: var(--accent); font-weight: 600; }
.edu-details { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.edu-details a { color: var(--accent); text-decoration: none; font-weight: 600; }
.edu-details a:hover { text-decoration: underline; }

@media (max-width: 700px) {
    .container { padding: 40px 15px; }
    .name { font-size: 32px; }
    .paper, .project { flex-direction: column; }
    .paper-img { width: 100%; height: 120px; }
    .project-img { flex-basis: auto; width: 100%; height: 160px; }
}
