/* ============================================================
   独立开发者导航站 · 全局样式
   视觉体系：深墨蓝 + 靛蓝主色 / 琥珀 = VIP / 翠绿 = 免费
   ============================================================ */

:root {
    /* 色板 */
    --ink-950: #0B1220;
    --ink-900: #111C31;
    --ink-800: #182742;
    --ink-700: #223352;
    --bg: #F6F7FB;
    --surface: #FFFFFF;
    --brand: #4F46E5;
    --brand-deep: #4338CA;
    --brand-soft: #EEF0FF;
    --accent: #F59E0B;
    --accent-deep: #D97706;
    --accent-soft: #FFF6E5;
    --free: #10B981;
    --free-deep: #059669;
    --free-soft: #E7F8F1;
    --text: #0F172A;
    --text-2: #5B6B84;
    --text-3: #8A99B4;
    --border: #E4E9F2;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, .12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

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

img {
    max-width: 100%;
}

section[id] {
    scroll-margin-top: 84px;
}

/* ========== 导航栏 ========== */
.navbar {
    background: var(--ink-950);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
    gap: 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366F1 0%, #4338CA 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .45);
}

.nav-brand a {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
}

.nav-brand small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #7C8DB0;
    line-height: 1.2;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    padding: 8px 14px;
    color: #A9B6D4;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: color .2s, background .2s;
    white-space: nowrap;
}

.nav-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.nav-links .nav-admin {
    color: #FDE68A;
    border: 1px solid rgba(253, 230, 138, .35);
    margin-left: 6px;
}

.nav-links .nav-admin:hover {
    background: rgba(253, 230, 138, .12);
    color: #FDE68A;
}

/* ========== Hero 区域 ========== */
.hero {
    background:
        radial-gradient(ellipse 70% 90% at 20% 0%, rgba(99, 102, 241, .28) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 85% 20%, rgba(16, 185, 129, .14) 0%, transparent 55%),
        linear-gradient(180deg, var(--ink-950) 0%, var(--ink-900) 100%);
    color: #fff;
    padding: 72px 0 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero .hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(99, 102, 241, .16);
    border: 1px solid rgba(99, 102, 241, .35);
    color: #C7CBFB;
    font-size: 13px;
    margin-bottom: 18px;
}

.hero h1 {
    font-size: 44px;
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 1.25;
    margin-bottom: 14px;
}

.hero h1 .highlight {
    background: linear-gradient(90deg, #A5B4FC 0%, #6EE7B7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 16px;
    color: #A9B6D4;
    margin-bottom: 32px;
}

.search-box {
    max-width: 620px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    padding: 6px;
    border-radius: 14px;
    backdrop-filter: blur(6px);
}

.search-box input {
    flex: 1;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    outline: none;
    font-family: inherit;
}

.search-box input::placeholder {
    color: #7C8DB0;
}

.search-box button {
    padding: 12px 28px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s;
    font-family: inherit;
}

.search-box button:hover {
    background: var(--accent-deep);
}

.search-box button:active {
    transform: scale(.97);
}

/* ========== 分区通用 ========== */
.section {
    padding: 48px 0 0;
}

.section-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.section-head .sec-tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
}

.section-head .sec-tag.free-tag {
    background: var(--free-soft);
    color: var(--free-deep);
}

.section-head .sec-tag.vip-tag {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.section-head .sec-tag.tool-tag {
    background: var(--brand-soft);
    color: var(--brand-deep);
}

.section-head h2 {
    font-size: 26px;
    font-weight: 800;
}

.section-head .sec-desc {
    color: var(--text-3);
    font-size: 14px;
    margin-left: auto;
}

/* ========== 分类筛选 ========== */
.category-strip {
    padding: 20px 0 0;
}

.category-tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    padding: 8px 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 999px;
    cursor: pointer;
    transition: all .2s;
    font-size: 14px;
    color: var(--text-2);
    font-family: inherit;
}

.tag:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.tag.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    font-weight: 600;
}

/* ========== 课程卡片 ========== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.course-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s, border-color .2s;
    position: relative;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #C7CDF5;
}

.course-card::before {
    content: attr(data-badge);
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
}

.course-card.free::before {
    background: var(--free);
}

.course-card.vip::before {
    background: var(--accent);
}

.course-image {
    height: 150px;
    overflow: hidden;
    background: var(--ink-900);
    position: relative;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.default-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background:
        radial-gradient(ellipse 80% 90% at 30% 10%, rgba(99, 102, 241, .5) 0%, transparent 60%),
        linear-gradient(135deg, var(--ink-800) 0%, var(--ink-950) 100%);
}

.default-image svg {
    width: 44px;
    height: 44px;
    opacity: .9;
}

.course-info {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.course-info h3 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-info h3 a {
    transition: color .2s;
}

.course-info h3 a:hover {
    color: var(--brand);
}

.course-desc {
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.course-meta .category {
    background: var(--brand-soft);
    color: var(--brand-deep);
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.course-meta .price {
    color: var(--accent-deep);
    font-size: 18px;
    font-weight: 800;
}

.course-meta .price.free-price {
    color: var(--free-deep);
    font-size: 15px;
}

.btn-view {
    display: block;
    text-align: center;
    padding: 10px;
    margin-top: 12px;
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: background .2s;
}

.btn-view:hover {
    background: var(--brand-deep);
}

/* ========== 工具导航区 ========== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #C7CDF5;
}

.tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-icon svg {
    width: 20px;
    height: 20px;
}

.tool-body h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.tool-body p {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.55;
}

.tool-body .tool-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--brand);
    font-weight: 600;
    margin-top: 8px;
}

.tool-body .tool-link:hover {
    color: var(--brand-deep);
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.empty-state p {
    color: var(--text-2);
    font-size: 15px;
    margin-bottom: 16px;
}

.btn-primary {
    display: inline-block;
    padding: 11px 26px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: background .2s;
}

.btn-primary:hover {
    background: var(--brand-deep);
}

/* ========== 课程详情页 ========== */
.breadcrumb {
    padding: 22px 0 0;
    font-size: 13px;
    color: var(--text-3);
}

.breadcrumb a {
    color: var(--brand);
}

.breadcrumb a:hover {
    color: var(--brand-deep);
}

.course-detail {
    padding: 26px 0 20px;
}

.detail-header {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 32px;
    margin-bottom: 28px;
}

.detail-image {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--ink-900);
    aspect-ratio: 4 / 3;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-image .default-image.large svg {
    width: 72px;
    height: 72px;
}

.detail-info h1 {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 14px;
}

.detail-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.detail-meta .category {
    background: var(--brand-soft);
    color: var(--brand-deep);
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.detail-meta .date {
    color: var(--text-3);
    font-size: 13px;
    align-self: center;
}

.price-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.price-tag .price {
    font-size: 32px;
    font-weight: 900;
    color: var(--accent-deep);
}

.price-tag .price.free-price {
    font-size: 22px;
    color: var(--free-deep);
}

.price-tag .price-label {
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.price-tag .price-label.vip-label {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.price-tag .price-label.free-label {
    background: var(--free-soft);
    color: var(--free-deep);
}

.pan-section {
    margin: 22px 0;
    padding: 18px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.pan-section h3 {
    font-size: 14px;
    color: var(--text-2);
    font-weight: 600;
    margin-bottom: 12px;
}

.btn-download {
    display: inline-block;
    padding: 13px 34px;
    background: var(--free);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    transition: background .2s, transform .15s;
}

.btn-download:hover {
    background: var(--free-deep);
}

.btn-download.vip-btn {
    background: var(--accent);
}

.btn-download.vip-btn:hover {
    background: var(--accent-deep);
}

.btn-back {
    display: inline-block;
    margin-top: 18px;
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
}

.btn-back:hover {
    color: var(--brand-deep);
}

.detail-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 30px;
    margin-bottom: 20px;
}

.detail-content h2 {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--brand-soft);
}

.content-body {
    line-height: 1.85;
    color: var(--text-2);
    font-size: 15px;
    word-break: break-word;
}
.content-body h1, .content-body h2, .content-body h3, .content-body h4 {
    color: var(--text);
    font-weight: 700;
    margin: 22px 0 10px;
    line-height: 1.4;
}
.content-body h1 { font-size: 22px; }
.content-body h2 { font-size: 19px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.content-body h3 { font-size: 16px; }
.content-body p { margin: 8px 0; }
.content-body ul, .content-body ol { margin: 8px 0 8px 4px; padding-left: 22px; }
.content-body li { margin: 5px 0; }
.content-body a {
    color: #2563EB;
    text-decoration: none;
    font-weight: 600;
    word-break: break-all;
}
.content-body a:hover { color: #1D4ED8; text-decoration: underline; }
.content-body strong { font-weight: 700; color: var(--text); }
.content-body blockquote {
    margin: 10px 0;
    padding: 8px 14px;
    border-left: 3px solid var(--brand);
    background: var(--brand-soft);
    border-radius: 0 8px 8px 0;
    color: var(--text-2);
}
.content-body code {
    background: #EEF1F7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    word-break: break-all;
}
.content-body pre {
    background: #F4F6FA;
    padding: 12px 14px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
}
.content-body pre code { background: none; padding: 0; }
.content-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.content-body img { max-width: 100%; border-radius: 8px; }
.content-body table { border-collapse: collapse; margin: 10px 0; width: 100%; font-size: 14px; }
.content-body th, .content-body td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.content-body th { background: var(--brand-soft); font-weight: 600; color: var(--text); }

.source-info {
    color: var(--text-3);
    font-size: 13px;
}

.source-info a {
    color: var(--brand);
    word-break: break-all;
}

/* ========== 页脚 ========== */
footer {
    background: var(--ink-950);
    color: #7C8DB0;
    padding: 34px 0;
    margin-top: 56px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

footer p {
    font-size: 13px;
}

footer .footer-links a {
    color: #A9B6D4;
    font-size: 13px;
    margin-left: 18px;
}

footer .footer-links a:hover {
    color: #fff;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 8px;
    }

    .nav-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .nav-links a {
        font-size: 13px;
        padding: 6px 10px;
    }

    .hero {
        padding: 48px 0 40px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero p {
        font-size: 14px;
    }

    .search-box {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
    }

    .search-box input {
        background: rgba(255, 255, 255, .08);
    }

    .courses-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }

    .section-head .sec-desc {
        margin-left: 0;
        width: 100%;
    }

    .detail-header {
        grid-template-columns: 1fr;
    }

    .detail-info h1 {
        font-size: 24px;
    }

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

    footer .footer-links a {
        margin: 0 9px;
    }
}
