/* ========================================
   全局样式 / Global Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 颜色系统 - 参考苹果官网极简风格 */
    --color-bg: #ffffff;
    --color-bg-alt: #f5f5f7;
    --color-bg-dark: #1d1d1f;
    --color-text: #1d1d1f;
    --color-text-secondary: #6e6e73;
    --color-text-light: #86868b;
    --color-primary: #0071e3;
    --color-primary-hover: #0077ed;
    --color-primary-light: #e8f3ff;
    --color-border: #d2d2d7;
    --color-error: #ff3b30;
    --color-overlay: rgba(0, 0, 0, 0.4);

    /* 渐变色 */
    --gradient-hero: linear-gradient(180deg, #f0f1f3 0%, #f5f5f7 50%, #f8f9fa 80%, #ffffff 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);

    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    --font-family-zh: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;

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

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* 阴影 - 增强体积感 */
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family), var(--font-family-zh);
    color: var(--color-text);
    background: var(--gradient-hero);
    background-attachment: fixed;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

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

/* ========================================
   导航栏 / Navigation
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 1000;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

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

.nav-links {
    display: flex;
    gap: var(--spacing-md);
}

.nav-link {
    font-size: 0.875rem;
    color: var(--color-text);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--color-primary);
    background-color: var(--color-primary-light);
}

/* ========================================
   Hero 区 / Hero Section
   ======================================== */
.hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-sm) var(--spacing-md);
    background: transparent;
    position: relative;
}

/* Hero 区背景装饰 */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(0, 113, 227, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(142, 68, 173, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-container {
    text-align: center;
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
    line-height: 1.2;
    white-space: nowrap;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   按钮样式 / Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0055c8 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background-color: var(--color-bg-alt);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-link {
    display: inline-flex;
    align-items: center;
    color: var(--color-primary);
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0;
}

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

/* ========================================
   通用区块样式 / Section Styles
   ======================================== */
section {
    padding: var(--spacing-lg) var(--spacing-sm);
    position: relative;
}

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

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.02em;
    color: var(--color-text);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), #8e44ad);
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-weight: 400;
}

/* 区块分隔线 */
.section-divider-wrapper {
    padding: var(--spacing-md) 0;
}

.section-divider {
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 113, 227, 0.1) 20%,
        rgba(0, 113, 227, 0.3) 50%,
        rgba(0, 113, 227, 0.1) 80%,
        transparent 100%
    );
    margin: 0 auto;
    max-width: 300px;
    border-radius: 2px;
}

/* ========================================
   小工具区 / Tools Section
   ======================================== */
.tools-section {
    background-color: transparent;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    max-width: 900px;
    margin: 0 auto;
}

.tool-card {
    aspect-ratio: 4 / 3;
    background: white;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    padding: 0;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 113, 227, 0.08);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(0, 113, 227, 0.2);
}

.tool-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.tool-card:hover .tool-icon {
    transform: scale(1.05);
}

.tool-name {
    display: none;
}

/* AI 工具标记 */
.tool-card[data-is-ai="true"] .tool-name::after {
    content: 'AI';
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0.15rem 0.4rem;
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
    font-size: 0.65rem;
    border-radius: 4px;
    font-weight: 600;
}

/* ========================================
   文章区 / Articles Section
   ======================================== */
.articles-section {
    background-color: transparent;
    position: relative;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.article-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

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

.article-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background-color: var(--color-bg-alt);
}

.article-content {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
}

.article-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
}

.article-summary {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
    flex: 1;
}

.article-read-more {
    display: inline-flex;
    align-items: center;
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: auto;
}

.article-read-more:hover {
    text-decoration: underline;
}

.articles-footer {
    text-align: center;
    padding-top: var(--spacing-md);
    position: relative;
    z-index: 1;
}

/* ========================================
   关于我 / About Section
   ======================================== */
.about-section {
    background-color: transparent;
    position: relative;
}

.about-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    padding: var(--spacing-xl) 0;
}

.about-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-md);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 4px solid white;
}

.about-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.02em;
}

.about-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), #8e44ad);
    margin: 0 auto var(--spacing-md);
    border-radius: 2px;
}

.about-text {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.7;
}

.about-motto {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
    font-style: italic;
}

.about-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1rem;
    color: var(--color-text-secondary);
    padding: 0.75rem 1.5rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.contact-icon {
    font-size: 1.4rem;
}

/* ========================================
   页脚 / Footer
   ======================================== */
.footer {
    background-color: transparent;
    padding: var(--spacing-lg) var(--spacing-sm);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-container p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* ========================================
   密码验证弹窗 / Password Modal
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-overlay);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--spacing-sm);
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: white;
    color: var(--color-text);
    transform: rotate(90deg);
}

.modal-body {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.modal-icon {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.modal-desc {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.modal-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    outline: none;
    transition: all 0.3s ease;
    background: var(--color-bg-alt);
}

.modal-input:focus {
    border-color: var(--color-primary);
    background: white;
    box-shadow: 0 0 0 4px var(--color-primary-light);
}

.modal-error {
    min-height: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-error);
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.modal-actions .btn {
    min-width: 110px;
}

/* ========================================
   响应式设计 / Responsive Design
   ======================================== */
@media (max-width: 768px) {
    :root {
        --spacing-xl: 5rem;
    }

    /* 导航栏移动端 */
    .nav-container {
        padding: 0 var(--spacing-sm);
        height: 48px;
    }

    .nav-logo {
        font-size: 1rem;
    }

    .nav-links {
        gap: var(--spacing-xs);
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
        white-space: nowrap;
    }

    /* Hero 移动端 */
    .hero {
        padding: var(--spacing-lg) var(--spacing-sm) calc(var(--spacing-lg) + 80px);
    }

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

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

    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-xs);
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 260px;
    }

    .hero-preview {
        height: 80px;
    }

    .hero-preview-content {
        padding: var(--spacing-sm);
    }

    /* 区块标题移动端 */
    .section-title {
        font-size: 1.75rem;
        margin-bottom: var(--spacing-md);
    }

    .section-title::after {
        bottom: -12px;
        width: 40px;
        height: 3px;
    }

    /* 小工具移动端 - 九宫格 */
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-sm);
    }

    .tool-card {
        padding: 0;
        border-radius: var(--radius-md);
    }

    .tool-icon {
        width: 100%;
        height: 100%;
    }

    .tool-name {
        font-size: 0.8rem;
    }

    /* 文章移动端 - 单列 */
    .articles-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .article-content {
        padding: var(--spacing-sm);
    }

    /* 关于我移动端 */
    .about-title {
        font-size: 1.75rem;
    }

    .about-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .about-text {
        font-size: 1rem;
    }

    .contact-item {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
}

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

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

    .modal-body {
        padding: var(--spacing-md);
    }
}
