/* ========================================
   全局样式与变量
   ======================================== */
:root {
    /* 颜色方案 */
    --primary-color: #1a73e8;
    --primary-dark: #1557b0;
    --secondary-color: #2c3e50;
    --accent-color: #07c160; /* 微信绿 */
    --bg-color: #ffffff;
    --bg-light: #f5f5f5;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);

    /* 间距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* 字体 */
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;

    /* 容器宽度 */
    --container-max-width: 1200px;
    --container-padding: 1.5rem;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--bg-color);
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

/* ========================================
   通用组件
   ======================================== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-base);
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

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

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

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

.btn-secondary:hover {
    background-color: #1a252f;
    color: white;
}

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

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

.btn-full {
    width: 100%;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: var(--font-size-sm);
    color: var(--primary-color);
    background-color: #e8f0fe;
    border-radius: 4px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ========================================
   导航栏
   ======================================== */
.navbar {
    background-color: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem var(--container-padding);
}

.nav-brand {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--primary-color);
}

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

.nav-menu a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

.btn-login {
    padding: 0.5rem 1.25rem;
    background-color: var(--primary-color);
    color: white !important;
    border-radius: 6px;
}

.btn-login:hover {
    background-color: var(--primary-dark);
    color: white !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
}

/* ========================================
   Hero区域
   ======================================== */
.hero {
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    margin-bottom: 1rem;
    opacity: 0.95;
}

.hero-description {
    font-size: var(--font-size-lg);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-buttons .btn {
    color: white;
}

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

.hero-buttons .btn-primary:hover {
    background-color: #f5f5f5;
}

/* 个人简介卡片 */
.profile-card {
    background-color: white;
    color: var(--text-primary);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.profile-avatar {
    margin-bottom: 1rem;
}

.profile-card h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: 0.5rem;
}

.profile-title {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    margin-bottom: 1rem;
}

.profile-bio {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ========================================
   内容预览区
   ======================================== */
.preview {
    padding: 4rem 0;
    background-color: var(--bg-light);
}

.section-title {
    font-size: var(--font-size-2xl);
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.preview-card {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

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

.card-icon {
    margin-bottom: 1rem;
}

.preview-card h3 {
    font-size: var(--font-size-xl);
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.preview-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

.preview-footer {
    text-align: center;
    margin-top: 2rem;
}

/* ========================================
   作品页面
   ======================================== */
.page-header {
    padding: 3rem 0;
    background-color: var(--bg-light);
    text-align: center;
}

.page-header h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
}

.projects {
    padding: 4rem 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.project-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
}

.project-thumbnail {
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.project-content {
    padding: 2rem;
}

.project-content h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-meta {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.projects-footer {
    text-align: center;
    margin-top: 3rem;
}

.footer-note {
    color: var(--text-secondary);
}

/* ========================================
   登录页面
   ======================================== */
.login-section {
    padding: 4rem 0;
    min-height: calc(100vh - 300px);
    display: flex;
    align-items: center;
}

.login-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 3rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: var(--font-size-2xl);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
}

.login-content {
    margin-bottom: 2rem;
}

/* 微信登录按钮 */
.wechat-login {
    text-align: center;
    margin-bottom: 1.5rem;
}

.btn-wechat {
    width: 100%;
    padding: 1rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: var(--font-size-lg);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.btn-wechat:hover {
    background-color: #06ad56;
}

.login-tip {
    margin-top: 0.75rem;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* 分割线 */
.divider {
    text-align: center;
    position: relative;
    margin: 2rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
}

.divider span {
    background-color: white;
    padding: 0 1rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

/* 邮箱登录表单 */
.email-login .form-group {
    margin-bottom: 1.5rem;
}

.email-login label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.email-login input[type="email"],
.email-login input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: var(--font-size-base);
    transition: border-color 0.3s ease;
}

.email-login input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.forgot-link {
    font-size: var(--font-size-sm);
    color: var(--primary-color);
}

.login-footer {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.login-footer a {
    color: var(--primary-color);
}

/* ========================================
   隐私政策页面
   ======================================== */
.privacy-section {
    padding: 4rem 0;
    background-color: var(--bg-light);
}

.privacy-content {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.privacy-content h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: 0.5rem;
}

.update-date {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: var(--font-size-sm);
}

.privacy-section-block {
    margin-bottom: 2rem;
}

.privacy-section-block h2 {
    font-size: var(--font-size-xl);
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.privacy-section-block p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.privacy-section-block ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.privacy-section-block ul li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.privacy-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
}

/* ========================================
   关于页面
   ======================================== */
.about-section {
    padding: 4rem 0;
    background-color: var(--bg-light);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-intro {
    background-color: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
}

.about-intro h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: 2rem;
    text-align: center;
}

.intro-profile {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 3rem;
    align-items: start;
}

.profile-avatar-large {
    margin: 0 auto;
}

.intro-text h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: 0.5rem;
}

.intro-title {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    margin-bottom: 1rem;
}

.intro-bio {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.intro-detail {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* 技术栈 */
.about-skills {
    background-color: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
}

.about-skills h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: 2rem;
    text-align: center;
}

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

.skill-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: 8px;
    background-color: var(--bg-light);
    transition: all 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.skill-icon {
    margin-bottom: 1rem;
}

.skill-item h4 {
    font-size: var(--font-size-lg);
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.skill-item p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* 联系方式 */
.about-contact {
    background-color: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
}

.about-contact h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: 2rem;
    text-align: center;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 8px;
}

.contact-item a {
    color: var(--primary-color);
}

/* 技能标签 */
.about-tags {
    background-color: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.about-tags h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: 2rem;
    text-align: center;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.tag-cloud .tag {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-base);
}

/* ========================================
   页脚
   ======================================== */
.footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left p {
    margin-bottom: 0.25rem;
}

.icp {
    font-size: var(--font-size-sm);
    opacity: 0.8;
}

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

.footer-right a {
    color: white;
    opacity: 0.9;
}

.footer-right a:hover {
    opacity: 1;
}

.separator {
    opacity: 0.5;
}

/* ========================================
   响应式设计
   ======================================== */

/* 平板设备 (≤768px) */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background-color: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-md);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-text h1 {
        font-size: var(--font-size-2xl);
    }

    .hero-buttons {
        justify-content: center;
    }

    .project-card {
        grid-template-columns: 1fr;
    }

    .project-thumbnail {
        padding: 1rem;
    }

    .intro-profile {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-avatar-large {
        margin-bottom: 1rem;
    }

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

/* 手机设备 (≤480px) */
@media (max-width: 480px) {
    :root {
        --container-padding: 1rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero-text h1 {
        font-size: var(--font-size-xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
    }

    .section-title {
        font-size: var(--font-size-xl);
    }

    .preview-grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: var(--font-size-2xl);
    }

    .login-container {
        padding: 2rem 1.5rem;
    }

    .privacy-content,
    .about-intro,
    .about-skills,
    .about-contact,
    .about-tags {
        padding: 2rem 1.5rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }
}
