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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition), color var(--transition);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.25rem; }

::selection {
    background-color: var(--accent-color);
    color: #ffffff;
}

[data-theme="dark"] ::selection {
    color: var(--bg-primary);
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-color);
    color: white;
    padding: 8px 16px;
    z-index: 1001;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f4;
    --text-primary: #1a1a1a;
    --text-secondary: #5f6368;
    --text-muted: #80868b;
    --accent-color: #1a73e8;
    --accent-hover: #1557b0;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --card-hover: #f8f9fa;
    --code-bg: #f1f3f4;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "Microsoft YaHei", sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;
}

[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-color: #58a6ff;
    --accent-hover: #79b8ff;
    --border-color: #30363d;
    --card-bg: #161b22;
    --card-hover: #21262d;
    --code-bg: #21262d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 80px 0;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition), border-color var(--transition);
}

[data-theme="dark"] .header {
    background: rgba(13, 17, 23, 0.85);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.theme-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all var(--transition);
    background: transparent;
}

.theme-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-btn[aria-pressed="true"] {
    background: var(--bg-tertiary);
}

@media (max-width: 640px) {
    .nav-links {
        gap: 20px;
    }
    
    .nav-links a:not(#theme-toggle) span {
        display: none;
    }
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 64px;
}

.hero-content {
    max-width: 600px;
    padding: 40px 24px;
}

.avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--accent-color), #34d399);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-lg);
}

.hero h1 {
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.highlight {
    background: linear-gradient(135deg, var(--accent-color), #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.intro {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.social-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    border: 1px solid var(--border-color);
}

.social-links a:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.about h2,
.projects h2,
.contact h2 {
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.about-content {
    max-width: 700px;
    margin: 0 auto 40px;
    text-align: center;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.about h3 {
    text-align: center;
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 500;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.skill-tag {
    padding: 6px 14px;
    border-radius: var(--radius-lg);
    background: var(--code-bg);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}

.skill-tag:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-1px);
}

.section-desc {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 0.95rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    transition: all var(--transition);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.project-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.project-card h3 {
    margin-bottom: 10px;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.project-tags span {
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--code-bg);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.project-link {
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap var(--transition);
}

.project-link:hover {
    gap: 8px;
    text-decoration: none;
}

.contact {
    text-align: center;
    background: var(--bg-secondary);
}

.contact p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.contact-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.contact-btn.email {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.contact-btn.email:hover {
    background: var(--accent-hover);
}

.contact-btn .icon {
    font-size: 1.1rem;
}

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

.footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    margin-top: 12px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-links span {
    margin: 0 8px;
    color: var(--border-color);
}

.hero-image {
    width: 180px;
    height: 180px;
    margin: 0 auto 24px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 4px var(--bg-primary);
    position: relative;
}

.hero-image::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: inset 0 -8px 20px rgba(0, 0, 0, 0.1);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradient-shift 6s ease infinite;
    font-size: 4.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.philosophy-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-color: #4a5568;
}

[data-theme="dark"] .philosophy-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-color: #4a5568;
}

.philosophy-card:hover {
    border-color: #a78bfa;
}

.philosophy-card .project-icon {
    font-size: 2.5rem;
}

.philosophy-card h3 {
    color: #e2e8f0;
}

.philosophy-card p {
    color: #a0aec0;
}

.philosophy-hero {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 100px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
    overflow: hidden;
}

.philosophy-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
}

.philosophy-hero-content {
    position: relative;
    z-index: 1;
}

.philosophy-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #e2e8f0, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.philosophy-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    font-style: italic;
}

.philosophy-section {
    padding: 80px 0;
    min-height: 100vh;
}

.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.philosophy-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    transition: all var(--transition);
}

.philosophy-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.philosophy-card-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.philosophy-card h3 {
    margin-bottom: 12px;
    font-size: 1.25rem;
}

.philosophy-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 16px;
}

.philosophy-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.philosophy-intro {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.philosophy-intro h2 {
    margin-bottom: 20px;
}

.philosophy-intro p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.8;
}

.philosophy-intro blockquote {
    margin-top: 24px;
    padding: 20px;
    background: var(--code-bg);
    border-left: 4px solid var(--accent-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .philosophy-hero h1 {
        font-size: 2.5rem;
    }
    
    .philosophy-hero {
        min-height: 40vh;
    }
}
