/* ===== 基础重置与变量 ===== */
:root {
    /* 苹果风格配色 - 浅色模式 */
    --primary-color: #0071e3;
    --primary-dark: #005bb5;
    --primary-light: #4da3ff;
    --accent-color: #5e5ce6;
    --accent-glow: rgba(94, 92, 230, 0.4);
    --text-color: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-light: #86868b;
    --bg-color: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-card: #ffffff;
    --bg-dark: #1d1d1f;
    --border-color: #d2d2d7;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 30px rgba(0, 113, 227, 0.3);
    --transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    --border-radius: 12px;
    --border-radius-lg: 20px;
    
    /* 科幻渐变 */
    --gradient-primary: linear-gradient(135deg, #0071e3 0%, #5e5ce6 100%);
    --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.9) 0%, rgba(245,245,247,0.9) 100%);
}

/* 深色模式 - Atom Dark 主题 */
[data-theme="dark"] {
    --primary-color: #528bff;
    --primary-dark: #4078c0;
    --primary-light: #61afef;
    --accent-color: #c678dd;
    --accent-glow: rgba(198, 120, 221, 0.4);
    --text-color: #abb2bf;
    --text-secondary: #828997;
    --text-light: #5c6370;
    --bg-color: #282c34;
    --bg-secondary: #21252b;
    --bg-card: #2c313a;
    --bg-dark: #21252b;
    --border-color: #3e4451;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(82, 139, 255, 0.4);
    --gradient-card: linear-gradient(145deg, rgba(44,49,58,0.9) 0%, rgba(33,37,43,0.9) 100%);
    --gradient-hero: linear-gradient(135deg, #282c34 0%, #21252b 50%, #1e2227 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

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

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

ul {
    list-style: none;
}

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0.75rem 0;
    transition: var(--transition);
}

[data-theme="dark"] .navbar {
    background: rgba(40, 44, 52, 0.85);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

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

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

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 主题切换按钮 */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

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

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

.menu-toggle {
    background: none;
    border: 0;
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== 按钮样式 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 980px;
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.02);
}

/* ===== Hero 区域 ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
    color: white;
    text-align: center;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease;
}

/* 照片区域 */
.hero-image {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem;
}

.profile-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

.glow-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #0071e3, #5e5ce6, #bf5af2, #0071e3);
    animation: rotate 4s linear infinite;
    z-index: 1;
}

.glow-ring::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 50%;
    background: var(--gradient-hero);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.hero-description {
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.hero .btn-secondary {
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.hero .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 社交链接 */
.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.social-links a {
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
}

.social-links a:hover {
    color: white;
    transform: translateY(-3px);
}

/* 背景动画 */
.hero-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: #bf5af2;
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, 30px) scale(0.9); }
    75% { transform: translate(20px, 50px) scale(1.05); }
}

/* ===== 通用区域样式 ===== */
section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
    font-size: 1.125rem;
}

/* ===== 关于我 ===== */
.about {
    background: var(--bg-secondary);
}

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

.about-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.0625rem;
}

.about-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ===== 技能 ===== */
.skills-section {
    background: var(--bg-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.skill-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.skill-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.skill-card p {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.skill-bar {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    width: 0;
    transition: width 1.5s ease;
}

/* ===== 作品集 ===== */
.portfolio {
    background: var(--bg-secondary);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.portfolio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

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

.portfolio-image {
    height: 200px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.portfolio-info {
    padding: 1.5rem;
}

.portfolio-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.portfolio-info p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.portfolio-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.portfolio-tags span {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 980px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===== 博客 ===== */
.blog {
    background: var(--bg-color);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    gap: 1.25rem;
    transition: var(--transition);
}

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

.blog-date {
    text-align: center;
    min-width: 60px;
}

.blog-date .day {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.blog-date .month {
    font-size: 0.75rem;
    color: var(--text-light);
}

.blog-content h3 {
    font-size: 1.0625rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.4;
}

.blog-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.blog-link {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
}

.blog-link:hover {
    text-decoration: underline;
}

/* ===== 联系区域 ===== */
.contact {
    background: var(--bg-secondary);
}

.contact-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.0625rem;
}

.contact-info {
    max-width: 500px;
    margin: 0 auto 2.5rem;
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-details h4 {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.125rem;
    font-weight: 400;
}

.contact-details a {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9375rem;
}

.contact-details a:hover {
    text-decoration: underline;
}

.contact-form {
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-secondary);
    color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

.form-message {
    text-align: center;
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
}

.form-message.error {
    display: block;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

/* ===== 页脚 ===== */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-info h4 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.footer-info p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8125rem;
}

/* ===== 动画 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滚动动画 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 内容与无障碍补充 ===== */
section, main {
    scroll-margin-top: 80px;
}

a:focus-visible, button:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 5px;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 2000;
    padding: 12px 20px;
    background: var(--bg-card);
    color: var(--text-color);
    border-radius: 8px;
}

.skip-link:focus { top: 12px; }
.skill-symbol { font-size: 2rem; font-weight: 600; }
.stat-number { font-size: clamp(1.5rem, 4vw, 2.5rem); }
.skill-card p, .stat-label { color: var(--text-secondary); }
.content-note { font-size: 0.8125rem !important; }
.status-label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-size: 0.8125rem;
}
.project-more { margin-top: 1.5rem; }
.portfolio-grid, .blog-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}
.public-contact { text-align: center; }
.public-contact p {
    margin: 0.75rem 0 1.5rem;
    color: var(--text-secondary);
}
.contact-emails {
    margin-top: 1.5rem;
    text-align: left;
}
.contact-emails > div {
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
}
.contact-emails dt {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}
.contact-emails dd { margin: 0; min-width: 0; }
.contact-emails a {
    color: var(--primary-color);
    overflow-wrap: anywhere;
}
.contact-emails a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .animate-on-scroll { opacity: 1; transform: none; }
}

/* ===== 响应式设计 ===== */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.75rem;
    }
    
    .about-stats {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        visibility: hidden;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 1.5rem;
        transform: translateY(-150%);
        transition: var(--transition);
        z-index: 999;
        border-bottom: 1px solid var(--border-color);
    }

    [data-theme="dark"] .nav-links {
        background: rgba(33, 37, 43, 0.95);
    }

    .nav-links.active {
        visibility: visible;
        transform: translateY(0);
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-buttons .btn {
        width: 200px;
    }

    .section-title {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .blog-card {
        flex-direction: column;
    }

    .blog-date {
        display: flex;
        gap: 0.5rem;
        align-items: baseline;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.875rem;
    }

    .hero-image {
        width: 140px;
        height: 140px;
    }

    .about-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    section {
        padding: 4rem 0;
    }
}
