/* ====================================================
   SafeW 加密聊天软件 - 原创主样式表
   版本: 1.0
   设计理念: 简洁、安全、科技感
   ==================================================== */

/* ---------- CSS 变量 (全局主题) ---------- */
:root {
    --primary: #2a7de1;
    --primary-dark: #1a5fb4;
    --primary-light: #e8f0fe;
    --secondary: #0d1117;
    --bg-body: #ffffff;
    --bg-dark: #0d1117;
    --bg-light: #f6f8fa;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-light: #9ca3af;
    --text-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 重置 & 基础 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color var(--transition);
}
a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- 按钮 ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--primary);
    color: var(--text-white);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 12px rgba(42, 125, 225, 0.35);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 125, 225, 0.40);
    color: var(--text-white);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* ---------- Header / 导航 ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: box-shadow var(--transition);
}
header.scrolled {
    box-shadow: var(--shadow-sm);
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}
.logo img {
    height: 36px;
    width: auto;
    border-radius: 0;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
}
nav ul li a {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.05rem;
    border-radius: 8px;
    transition: all var(--transition);
}
nav ul li a:hover,
nav ul li a.active {
    color: var(--primary);
    background: var(--primary-light);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-actions .btn-primary {
    padding: 8px 20px;
    font-size: 0.9rem;
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 8px;
}

/* ---------- Hero 区域 ---------- */
.hero {
    padding: 80px 0 60px;
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
}
.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.hero-content h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--secondary);
}
.hero-content .hero-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 520px;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.hero-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* ---------- Features Highlight (首页四特点) ---------- */
.features-highlight {
    padding: 60px 0;
    background: var(--bg-light);
}
.features-highlight .container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}
.feature-item {
    text-align: center;
    padding: 24px 16px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.feature-item i {
    font-size: 2.4rem;
    color: var(--primary);
    margin-bottom: 12px;
}
.feature-item h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}
.feature-item p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ---------- Content Block (图文混合) ---------- */
.content-block {
    padding: 70px 0;
}
.content-block .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}
.content-block.reverse .container {
    direction: rtl;
}
.content-block.reverse .container > * {
    direction: ltr;
}
.block-text h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--secondary);
}
.block-text p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.05rem;
}
.block-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ---------- 页面标题 (内页) ---------- */
.page-header {
    padding: 50px 0 30px;
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
    text-align: center;
}
.page-header h1 {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--secondary);
}
.page-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 10px auto 0;
}

/* ---------- 下载页 ---------- */
.download-options {
    padding: 40px 0 60px;
}
.download-options .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 28px;
}
.download-card {
    text-align: center;
    padding: 30px 20px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}
.download-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}
.download-card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 12px;
}
.download-card h3 {
    font-size: 1.15rem;
    margin-bottom: 4px;
}
.download-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 16px;
}
.download-card .btn-primary {
    padding: 8px 24px;
    font-size: 0.9rem;
}

.download-notice {
    padding: 30px 0 60px;
    text-align: center;
}
.download-notice .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--primary-light);
    padding: 20px 30px;
    border-radius: var(--radius);
    max-width: 700px;
}
.download-notice i {
    font-size: 1.8rem;
    color: var(--primary);
}
.download-notice p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* ---------- 文章详情页 (News) ---------- */
.article-detail {
    padding: 40px 0 80px;
}
.article-detail .article-meta {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.article-detail .article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.article-detail h1 {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 20px;
}
.article-detail .featured-image {
    margin: 20px 0 30px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.article-detail .featured-image img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}
.article-detail .article-content {
    font-size: 1.08rem;
    line-height: 1.9;
    color: var(--text-primary);
}
.article-detail .article-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 36px 0 16px;
    color: var(--secondary);
}
.article-detail .article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 28px 0 12px;
}
.article-detail .article-content p {
    margin-bottom: 18px;
}
.article-detail .article-content ul,
.article-detail .article-content ol {
    margin: 12px 0 20px 24px;
}
.article-detail .article-content li {
    margin-bottom: 8px;
}
.article-detail .article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--bg-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-secondary);
}
.article-detail .article-content code {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "SF Mono", "Fira Code", monospace;
}

/* ---------- Footer ---------- */
footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 50px 0 20px;
    margin-top: 20px;
}
footer .footer-columns {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
footer .footer-col .footer-logo {
    height: 32px;
    width: auto;
    margin-bottom: 12px;
}
footer .footer-col h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}
footer .footer-col a {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 4px 0;
    transition: color var(--transition);
}
footer .footer-col a:hover {
    color: #fff;
}
footer .social-icons {
    display: flex;
    gap: 16px;
}
footer .social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    color: var(--text-light);
    font-size: 1.1rem;
    transition: all var(--transition);
}
footer .social-icons a:hover {
    background: var(--primary);
    color: #fff;
}
footer .footer-bottom {
    text-align: center;
    padding-top: 24px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
}

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
    .hero .container,
    .content-block .container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .content-block.reverse .container {
        direction: ltr;
    }
    .hero-content h1 {
        font-size: 2.6rem;
    }
    .features-highlight .container {
        grid-template-columns: repeat(2, 1fr);
    }
    footer .footer-columns {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #fff;
        padding: 20px 24px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        gap: 0;
    }
    nav ul.open {
        display: flex;
    }
    nav ul li a {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
    }
    .menu-toggle {
        display: block;
    }
    .header-actions .btn-primary {
        display: none;
    }
    .hero {
        padding: 50px 0 40px;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .features-highlight .container {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .feature-item {
        padding: 16px;
    }
    .feature-item i {
        font-size: 1.8rem;
    }
    .download-options .container {
        grid-template-columns: 1fr 1fr;
    }
    footer .footer-columns {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .article-detail h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .download-options .container {
        grid-template-columns: 1fr;
    }
    .features-highlight .container {
        grid-template-columns: 1fr;
    }
}