/* ============================================
   Clash 官网 - 下载页样式表
   版本: v2.4.0-release
   ============================================ */

/* ---------- CSS 自定义属性 ---------- */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;
    --primary-soft: #dbeafe;
    --text-dark: #1e293b;
    --text-body: #334155;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --warning-text: #92400e;
    --warning-dark: #78350f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
    --shadow-primary: 0 4px 14px rgba(59, 130, 246, 0.25);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 50px;
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    --max-width: 1100px;
}

/* ---------- 全局重置 ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    line-height: 1.7;
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

code {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    background-color: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    color: #0f172a;
}

/* ---------- 头部导航 (与首页完全一致) ---------- */
header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.3px;
}

.logo-area img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

nav a {
    text-decoration: none;
    color: #475569;
    font-size: 0.93rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

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

nav a.active {
    color: var(--primary-color);
    font-weight: 600;
    background-color: var(--primary-light);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
}

.repo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #1e293b;
    color: #ffffff !important;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.repo-btn:hover {
    background-color: #0f172a;
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* ---------- 下载页 Hero ---------- */
.download-hero {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    padding: 60px 20px 30px;
}

.download-hero .badge {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 7px 18px;
    border-radius: var(--radius-xl);
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid var(--primary-border);
    margin-bottom: 22px;
    letter-spacing: 0.2px;
}

.download-hero h1 {
    font-size: 2.3rem;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 18px;
    letter-spacing: -0.5px;
    font-weight: 800;
}

.download-hero p {
    font-size: 1.05rem;
    color: #475569;
    max-width: 780px;
    margin: 0 auto;
    text-align: justify;
    text-indent: 2em;
    line-height: 1.75;
}

.download-hero p strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* ---------- 平台快捷导航 ---------- */
.quick-nav {
    max-width: 1000px;
    margin: 0 auto 30px;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.quick-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: var(--radius-xl);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.quick-nav-item:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.quick-nav-item svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ---------- 下载卡片网格 ---------- */
.download-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    padding: 0 20px 40px;
}

.dl-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    scroll-margin-top: 100px; /* 用于锚点定位时避开固定头部 */
}

.dl-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-border);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.08);
}

.platform-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.platform-header svg {
    width: 34px;
    height: 34px;
    fill: var(--primary-color);
    flex-shrink: 0;
}

.platform-header h2 {
    font-size: 1.35rem;
    color: #0f172a;
    font-weight: 700;
}

.platform-info {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 22px;
    text-align: justify;
    line-height: 1.7;
}

/* 元数据清单 */
.meta-list {
    margin-bottom: 22px;
    background-color: var(--bg-light);
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    border: 1px dashed var(--border-color);
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    line-height: 1.5;
}

.meta-item:last-child {
    margin-bottom: 0;
}

.meta-label {
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 8px;
}

.meta-value {
    color: #1e293b;
    font-family: 'SF Mono', 'Fira Code', monospace;
    word-break: break-all;
    text-align: right;
    font-size: 0.82rem;
    background-color: transparent;
}

.meta-value a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
}

/* 下载按钮 */
.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    padding: 13px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
    text-align: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-download:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.btn-download svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---------- 三步安装流程 ---------- */
.install-guide {
    max-width: 900px;
    margin: 0 auto 50px;
    padding: 0 20px;
}

.install-guide .section-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    text-align: center;
    justify-content: center;
}

.install-guide .section-title-area svg {
    width: 28px;
    height: 28px;
    fill: var(--primary-color);
    flex-shrink: 0;
}

.install-guide h2 {
    font-size: 1.75rem;
    color: #0f172a;
    font-weight: 700;
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    background-color: var(--bg-light);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: border-color var(--transition-fast);
}

.step:hover {
    border-color: var(--primary-border);
}

.step-number {
    width: 42px;
    height: 42px;
    background-color: var(--primary-color);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1.15rem;
    color: #0f172a;
    margin-bottom: 8px;
    font-weight: 600;
}

.step-content p {
    font-size: 0.96rem;
    color: #475569;
    text-indent: 0;
    margin-bottom: 10px;
    text-align: left;
}

.install-cmd {
    display: block;
    background-color: #0f172a;
    color: #e2e8f0;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    margin-top: 8px;
}

/* ---------- 更新日志 ---------- */
.changelog {
    max-width: 900px;
    margin: 0 auto 50px;
    padding: 0 20px;
}

.changelog .section-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    text-align: center;
    justify-content: center;
}

.changelog .section-title-area svg {
    width: 28px;
    height: 28px;
    fill: var(--primary-color);
    flex-shrink: 0;
}

.changelog h2 {
    font-size: 1.75rem;
    color: #0f172a;
    font-weight: 700;
}

.changelog-item {
    border-left: 3px solid var(--primary-border);
    padding: 14px 20px;
    margin-bottom: 18px;
    background-color: var(--bg-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: border-color var(--transition-fast);
}

.changelog-item:hover {
    border-left-color: var(--primary-color);
}

.version-tag {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 3px 12px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-right: 10px;
}

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

.changelog-item ul {
    margin-top: 10px;
    list-style: none;
}

.changelog-item ul li {
    font-size: 0.95rem;
    color: var(--text-body);
    padding: 4px 0;
    position: relative;
    padding-left: 18px;
}

.changelog-item ul li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* ---------- 安全须知 ---------- */
.security-notice {
    max-width: 1000px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.notice-box {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-left: 4px solid #f59e0b;
    padding: 24px 28px;
    border-radius: var(--radius-sm);
    line-height: 1.7;
}

.notice-box h3 {
    color: var(--warning-text);
    font-size: 1.1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.notice-box h3 svg {
    width: 20px;
    height: 20px;
    fill: #d97706;
    flex-shrink: 0;
}

.notice-box p {
    color: var(--warning-dark);
    font-size: 0.96rem;
    margin-bottom: 10px;
    text-align: justify;
    text-indent: 0;
}

.notice-box p code {
    background-color: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    font-size: 0.9em;
}

.notice-box a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
}

/* ---------- 页脚 (与首页一致) ---------- */
footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 55px 20px 30px;
    margin-top: 50px;
    font-size: 0.9rem;
}

.footer-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 36px;
    border-bottom: 1px solid #334155;
    padding-bottom: 40px;
}

.footer-col h5 {
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 18px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.footer-col ul li {
    margin-bottom: 11px;
}

.footer-col ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color var(--transition-fast);
    font-size: 0.9rem;
}

.footer-col ul li a:hover {
    color: #ffffff;
}

.footer-bottom {
    max-width: 1000px;
    margin: 28px auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.84rem;
}

.footer-bottom p {
    margin-bottom: 0;
    text-indent: 0;
    color: #64748b;
}

/* ---------- 响应式设计 ---------- */
@media (max-width: 1024px) {
    .download-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 14px;
        padding: 12px 16px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    nav a {
        font-size: 0.88rem;
    }

    .repo-btn {
        padding: 7px 14px;
        font-size: 0.84rem;
    }

    .download-hero h1 {
        font-size: 1.8rem;
    }

    .download-hero p {
        font-size: 0.96rem;
        text-indent: 1.5em;
    }

    .quick-nav {
        gap: 8px;
    }

    .quick-nav-item {
        padding: 6px 14px;
        font-size: 0.84rem;
    }

    .download-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dl-card {
        padding: 24px 20px;
    }

    .platform-header h2 {
        font-size: 1.2rem;
    }

    .meta-list {
        font-size: 0.8rem;
    }

    .btn-download {
        font-size: 0.95rem;
        padding: 12px 20px;
    }

    .steps-container {
        gap: 16px;
    }

    .step {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .install-guide h2,
    .changelog h2 {
        font-size: 1.45rem;
    }

    .notice-box {
        padding: 18px 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

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

@media (max-width: 480px) {
    .download-hero h1 {
        font-size: 1.55rem;
    }

    .download-hero .badge {
        font-size: 0.8rem;
    }

    .quick-nav {
        justify-content: flex-start;
    }

    .meta-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .meta-value {
        text-align: left;
        word-break: break-all;
    }

    .changelog-item {
        padding: 12px 14px;
    }

    .version-tag {
        margin-bottom: 5px;
    }
}

/* ---------- 打印样式 ---------- */
@media print {
    header,
    footer,
    .quick-nav,
    .btn-download,
    .install-guide,
    .security-notice {
        display: none;
    }

    body {
        color: #000;
        background: #fff;
    }

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

    .dl-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}