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

:root {
    --bg-color: #ffffff;
    --text-color: #1d1d1f;
    --secondary-text: #86868b;
    --border-color: #d2d2d7;
    --card-bg: rgba(255, 255, 255, 0.8);
    --accent-color: #007aff;
    --hover-bg: rgba(0, 122, 255, 0.1);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #000000;
    --text-color: #f5f5f7;
    --secondary-text: #a1a1a6;
    --border-color: #424245;
    --card-bg: rgba(30, 30, 30, 0.8);
    --accent-color: #0a84ff;
    --hover-bg: rgba(10, 132, 255, 0.2);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
    min-height: 100vh;
}

body:not(.home-page) {
    background: var(--bg-color);
}

body:not(.home-page) .aurora {
    opacity: 0.4;
}

.hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    display: none;
}

.home-page .hero-bg {
    display: block;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
}

.aurora {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

.logo {
    margin-left: 20px;
}

.logo img {
    height: 40px;
    width: auto;
}

nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
    background: rgba(255, 255, 255, 0.7);
    padding: 6px;
    border-radius: 24px;
    border: 1px solid rgba(210, 210, 215, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] nav ul {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(66, 66, 69, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

nav a {
    display: block;
    padding: 8px 20px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    border-radius: 18px;
    white-space: nowrap;
}

nav a:hover,
nav a.active {
    background: var(--accent-color);
    color: white;
}

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-right: 20px;
}

.theme-toggle {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(210, 210, 215, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(66, 66, 69, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.theme-toggle:hover {
    background: var(--hover-bg);
}

.theme-toggle .icon {
    transition: var(--transition);
    position: absolute;
}

.theme-toggle .sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-toggle .moon-icon {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.lang-selector {
    position: relative;
    cursor: pointer;
}

.current-lang {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(210, 210, 215, 0.2);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .current-lang {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(66, 66, 69, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.lang-selector:hover .current-lang {
    background: var(--hover-bg);
}

.flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    background-size: cover;
    background-position: center;
}

.flag.china {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 20"><rect fill="%23DE2910" width="30" height="20"/><path fill="%23FFDE00" d="M5,3 L6,7 L10,7 L7,9 L8,13 L5,11 L2,13 L3,9 L0,7 L4,7 Z"/><path fill="%23FFDE00" d="M12,2 L12.5,3 L13.5,3 L12.7,3.7 L13,4.7 L12.2,4 L11.4,4.7 L11.7,3.7 L10.9,3 L11.9,3 Z"/><path fill="%23FFDE00" d="M12,6 L12.5,7 L13.5,7 L12.7,7.7 L13,8.7 L12.2,8 L11.4,8.7 L11.7,7.7 L10.9,7 L11.9,7 Z"/><path fill="%23FFDE00" d="M12,10 L12.5,11 L13.5,11 L12.7,11.7 L13,12.7 L12.2,12 L11.4,12.7 L11.7,11.7 L10.9,11 L11.9,11 Z"/><path fill="%23FFDE00" d="M9,8 L9.5,9 L10.5,9 L9.7,9.7 L10,10.7 L9.2,10 L8.4,10.7 L8.7,9.7 L7.9,9 L8.9,9 Z"/></svg>');
}

.flag.usa {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 20"><rect fill="%23B22234" width="30" height="20"/><rect y="1.54" fill="white" width="30" height="1.54"/><rect y="4.62" fill="white" width="30" height="1.54"/><rect y="7.69" fill="white" width="30" height="1.54"/><rect y="10.77" fill="white" width="30" height="1.54"/><rect y="13.85" fill="white" width="30" height="1.54"/><rect y="16.92" fill="white" width="30" height="1.54"/><rect fill="%233C3B6E" width="12" height="10.77"/></svg>');
}

.flag.japan {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 20"><rect fill="white" width="30" height="20"/><circle fill="%23BC002D" cx="15" cy="10" r="6"/></svg>');
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(210, 210, 215, 0.2);
    border-radius: 12px;
    padding: 8px;
    min-width: 140px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .lang-dropdown {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(66, 66, 69, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}

.lang-option:hover {
    background: var(--hover-bg);
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
}

.hero {
    position: relative;
    width: 100%;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    z-index: 1;
}

.hero h1 {
    font-size: 72px;
    font-weight: 700;
    margin-bottom: 40px;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--accent-color), #5856d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
}

.hero-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
}

.info-item {
    padding: 16px 28px;
    background: var(--card-bg);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hero-tags {
    margin-bottom: 40px;
}

.tag-group {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tag {
    padding: 8px 16px;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.tag:hover {
    background: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.hero-motto {
    padding: 24px 32px;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero-motto span {
    font-size: 22px;
    font-style: italic;
    color: var(--secondary-text);
    font-weight: 400;
}

.page-title {
    text-align: center;
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 60px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-color), #5856d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(0, 122, 255, 0.2);
}

.projects-section {
    padding: 80px 0;
}

.projects-section h1 {
    text-align: center;
    font-size: 48px;
    font-weight: 600;
    margin-bottom: 60px;
    letter-spacing: -0.02em;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.project-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-desc {
    font-size: 14px;
    color: var(--secondary-text);
    margin-bottom: 16px;
    flex: 1;
    line-height: 1.4;
}

.project-links {
    display: flex;
    gap: 10px;
}

.project-link {
    display: inline-block;
    padding: 6px 12px;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    transition: var(--transition);
}

.project-link:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.github-link {
    background: #333;
}

[data-theme="dark"] .github-link {
    background: #555;
}

.password {
    display: inline-block;
    padding: 4px 8px;
    background: var(--hover-bg);
    border-radius: 4px;
    font-size: 12px;
    color: var(--secondary-text);
    margin-left: 8px;
}

footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer-content p {
    color: var(--secondary-text);
    font-size: 14px;
    margin-bottom: 8px;
}

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

.footer-emails {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.footer-emails span {
    color: var(--secondary-text);
    font-size: 14px;
}

.footer-separator {
    width: 1px;
    height: 14px;
    background: var(--border-color);
}

@media (max-width: 1200px) {
    .project-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 4px;
    }
    
    nav a {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    header .container {
        padding: 0 30px;
    }
}

@media (max-width: 600px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 20px;
    }
    
    header .container {
        padding: 0 20px;
    }
    
    .logo {
        margin-left: 0;
    }
    
    .controls {
        margin-right: 0;
    }
    
    .hero h1 {
        font-size: 48px;
    }
    
    .hero-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .info-item {
        width: 100%;
    }
    
    .page-title {
        font-size: 40px;
    }
}
