/* ===== 官网主题：紫罗兰 + 青绿 ===== */
:root {
    --c-primary: #6d28d9;
    --c-primary-dark: #4c1d95;
    --c-accent: #0d9488;
    --c-accent-soft: #ccfbf1;
    --c-bg: #f8fafc;
    --c-bg-alt: #f1f5f9;
    --c-surface: #ffffff;
    --c-text: #1e293b;
    --c-text-muted: #64748b;
    --c-border: #e2e8f0;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 2px 12px rgba(76, 29, 149, 0.07);
    --wrap: 1120px;
    --header-h: 64px;
    --gap: 1.25rem;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: var(--c-text);
    background: var(--c-bg);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--c-primary);
    text-decoration: none;
}

a:hover {
    color: var(--c-accent);
}

.site-wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== 顶栏导航 ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-h);
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    transition: box-shadow 0.25s ease;
}

.site-header.is-scrolled {
    box-shadow: var(--shadow);
}

.site-header-inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-logo a {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--c-primary-dark);
    white-space: nowrap;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 14px;
}

.site-nav a {
    font-size: 0.88rem;
    color: var(--c-text);
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover,
.site-nav a.is-active,
.site-nav a.za8142this {
    color: var(--c-primary);
    border-bottom-color: var(--c-accent);
}

.site-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    cursor: pointer;
}

.site-menu-toggle span {
    display: block;
    height: 2px;
    background: var(--c-primary-dark);
    transition: transform 0.25s, opacity 0.25s;
}

.site-menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.site-menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

body.menu-open {
    overflow: hidden;
}

/* ===== 主内容区 ===== */
.site-main {
    margin-top: var(--header-h);
}

.site-section {
    padding: 56px 0;
}

.site-section-alt {
    background: var(--c-bg-alt);
}

.site-section-head {
    text-align: center;
    margin-bottom: 32px;
}

.site-section-head h2 {
    font-size: 1.65rem;
    color: var(--c-primary-dark);
    margin-bottom: 8px;
    font-weight: 700;
}

.site-section-head p {
    color: var(--c-text-muted);
    font-size: 0.95rem;
    max-width: 640px;
    margin: 0 auto;
}

.site-section-head-light h2,
.site-section-head-light p {
    color: #fff;
}

/* ===== 首页 Hero ===== */
.site-hero {
    padding: 48px 0 56px;
    background: linear-gradient(135deg, #ede9fe 0%, #f0fdfa 55%, #f8fafc 100%);
    border-bottom: 1px solid var(--c-border);
}

.site-hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 32px;
    align-items: center;
}

.site-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--c-accent);
    background: var(--c-accent-soft);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.site-hero-copy h1 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    line-height: 1.35;
    color: var(--c-primary-dark);
    margin-bottom: 12px;
}

.site-lead {
    color: var(--c-text-muted);
    margin-bottom: 12px;
}

.site-hero-copy > p {
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.site-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.site-hero-tags span {
    font-size: 0.82rem;
    padding: 6px 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 20px;
    color: var(--c-text);
}

.site-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.site-btn-primary {
    background: var(--c-primary);
    color: #fff;
    border: none;
}

.site-btn-primary:hover {
    background: var(--c-primary-dark);
    color: #fff;
    transform: translateY(-1px);
}

.site-hero-media {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow);
}

.site-hero-media img {
    width: 100%;
    object-fit: cover;
}

/* ===== 卡片与内容块 ===== */
.site-cards {
    display: grid;
    gap: var(--gap);
}

.site-cards-3 {
    grid-template-columns: repeat(3, 1fr);
}

.site-cards-2 {
    grid-template-columns: repeat(2, 1fr);
}

.site-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.site-card h3 {
    font-size: 1.05rem;
    color: var(--c-primary-dark);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--c-accent-soft);
}

.site-card p {
    color: var(--c-text-muted);
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.site-card ul,
.site-card ol {
    padding-left: 1.2rem;
    font-size: 0.9rem;
    color: var(--c-text);
}

.site-card li {
    margin-bottom: 6px;
}

.site-steps-inline {
    padding-left: 1.2rem;
    font-size: 0.9rem;
}

.site-split {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: start;
}

.site-prose p {
    margin-bottom: 12px;
    color: var(--c-text);
    font-size: 0.95rem;
}

.site-checklist {
    list-style: none;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.site-checklist li {
    padding: 10px 0;
    border-bottom: 1px solid var(--c-border);
    font-size: 0.9rem;
}

.site-checklist li:last-child {
    border-bottom: none;
}

.site-band {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.site-band > p {
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.site-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.site-metric {
    text-align: center;
    padding: 16px 12px;
    background: var(--c-bg-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border);
}

.site-metric em {
    display: block;
    font-size: 1.5rem;
    font-style: normal;
    font-weight: 700;
    color: var(--c-primary);
}

.site-metric span {
    font-size: 0.82rem;
    color: var(--c-text-muted);
}

.site-knowledge {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
}

.site-knowledge-item {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.site-knowledge-item h3 {
    font-size: 1rem;
    color: var(--c-primary-dark);
    margin-bottom: 8px;
}

.site-knowledge-item p {
    font-size: 0.9rem;
    color: var(--c-text-muted);
}

/* FAQ */
.site-faq {
    max-width: 800px;
    margin: 0 auto;
}

.site-faq-item {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    overflow: hidden;
}

.site-faq-item summary {
    padding: 14px 18px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    font-size: 0.95rem;
}

.site-faq-item summary::-webkit-details-marker {
    display: none;
}

.site-faq-item[open] summary {
    color: var(--c-primary);
    border-bottom: 1px solid var(--c-border);
}

.site-faq-item p {
    padding: 14px 18px;
    font-size: 0.9rem;
    color: var(--c-text-muted);
}

/* 联系区 */
.site-section-contact {
    background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary));
    color: #fff;
}

.site-contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

.site-contact-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    padding: 20px;
}

.site-contact-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.site-contact-card p {
    font-size: 0.88rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* 首页文章网格 */
.article-grid-home {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.article-card-home {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.article-card-home:hover {
    box-shadow: var(--shadow);
}

.article-thumb-home {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--c-bg-alt);
}

.article-thumb-home img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-info-home {
    padding: 10px 12px;
}

.article-info-home h3 {
    font-size: 0.82rem;
    line-height: 1.4;
    margin-bottom: 4px;
}

.article-info-home h3 a {
    color: var(--c-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-info-home h3 a:hover {
    color: var(--c-primary);
}

.article-date-home {
    font-size: 0.75rem;
    color: var(--c-text-muted);
}

/* ===== 页脚 ===== */
.site-footer {
    background: var(--c-primary-dark);
    color: rgba(255, 255, 255, 0.85);
    padding: 40px 0 0;
}

.site-footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding-bottom: 28px;
}

.site-footer-col h3 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: #fff;
}

.site-footer-col ul {
    list-style: none;
}

.site-footer-col li {
    font-size: 0.85rem;
    margin-bottom: 6px;
    line-height: 1.5;
}

.site-footer-col a {
    color: rgba(255, 255, 255, 0.8);
}

.site-footer-col a:hover {
    color: var(--c-accent-light);
}

.site-footer-bottom {
    text-align: center;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
}

.site-footer-bottom a {
    color: #fff;
}

/* ===== 列表页 / 内页 ===== */
.site-page-head {
    padding: 32px 0;
    background: linear-gradient(135deg, #ede9fe, #f0fdfa);
    border-bottom: 1px solid var(--c-border);
}

.site-page-head h1 {
    font-size: 1.5rem;
    color: var(--c-primary-dark);
    margin-bottom: 8px;
    text-align: left;
}

.site-page-head > .site-wrap > p,
.site-page-head p {
    color: var(--c-text-muted);
    font-size: 0.92rem;
}

.site-page-head-article h1 {
    font-size: 1.35rem;
    line-height: 1.45;
}

.article-breadcrumb {
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: var(--c-text-muted);
}

.article-breadcrumb a {
    color: var(--c-primary);
}

.article-breadcrumb span {
    margin: 0 6px;
}

.article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 0.85rem;
    color: var(--c-text-muted);
}

.site-inner {
    padding: 32px 0 48px;
}

.page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    align-items: start;
}

.main-column {
    min-width: 0;
}

/* 列表项 */
.list-article-grid {
    list-style: none;
}

.list-article-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    margin-bottom: 14px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.list-thumb {
    flex: 0 0 200px;
    max-width: 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--c-bg-alt);
}

.list-thumb img {
    width: 100%;
    height: 100%;
    min-height: 120px;
    object-fit: cover;
}

.list-article-body {
    flex: 1;
    min-width: 0;
}

.list-article-body h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.list-article-body h3 a {
    color: var(--c-text);
}

.list-article-body h3 a:hover {
    color: var(--c-primary);
}

.list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 0.85rem;
    color: var(--c-text-muted);
    margin-bottom: 8px;
}

.list-intro {
    font-size: 0.9rem;
    color: var(--c-text-muted);
    line-height: 1.6;
    word-break: break-word;
}

/* 分页 */
.pagebar {
    margin-top: 20px;
    padding: 14px 16px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
}

.pagelist-lr {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    list-style: none;
}

.pagelist-lr li {
    list-style: none;
}

.pagelist-lr a {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.88rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    color: var(--c-primary);
}

.pagelist-lr a:hover {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}

/* 内容页 */
.article-detail,
.related-articles {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 18px;
}

.article-litpic {
    margin-bottom: 16px;
    text-align: center;
}

.article-litpic img {
    max-width: 100%;
    border-radius: var(--radius-sm);
}

.za8142article-body {
    font-size: 0.95rem;
    line-height: 1.75;
    word-break: break-word;
    overflow-wrap: break-word;
}

.za8142article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.za8142article-body table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

.za8142diyfield {
    margin: 16px 0;
    padding: 14px;
    background: var(--c-bg-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border);
    font-size: 0.9rem;
}

.article-gallery img {
    max-width: 100%;
    border-radius: var(--radius-sm);
}

.za8142meta-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.za8142tagitem a {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.82rem;
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border);
    border-radius: 20px;
    color: var(--c-text);
}

.za8142tagitem a:hover {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}

.article-prenext {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--c-border);
    font-size: 0.9rem;
}

.prenext-item {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.prenext-next {
    text-align: right;
}

.related-articles h3 {
    font-size: 1.1rem;
    margin-bottom: 14px;
    color: var(--c-primary-dark);
}

.related-list {
    list-style: none;
}

.related-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--c-border);
}

.related-item:last-child {
    border-bottom: none;
}

.related-thumb {
    flex: 0 0 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.related-thumb img {
    width: 100%;
    height: 72px;
    object-fit: cover;
}

.related-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--c-text);
    display: block;
    margin-bottom: 4px;
}

.related-info p {
    font-size: 0.85rem;
    color: var(--c-text-muted);
}

/* 侧栏 */
.sidebar {
    position: sticky;
    top: calc(var(--header-h) + 12px);
}

.sidebar-widget {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 16px;
    overflow: hidden;
}

.sidebar-title {
    font-size: 0.95rem;
    color: var(--c-primary-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--c-accent-soft);
}

.sidebar-article-list {
    list-style: none;
    max-height: 520px;
    overflow-y: auto;
}

.sidebar-article-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--c-border);
}

.sidebar-article-item:last-child {
    border-bottom: none;
}

.sidebar-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--c-bg-alt);
}

.sidebar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-article-info {
    flex: 1;
    min-width: 0;
}

.sidebar-article-title {
    font-size: 0.82rem;
    color: var(--c-text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-date {
    font-size: 0.72rem;
    color: var(--c-text-muted);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .site-hero-grid {
        grid-template-columns: 1fr;
    }

    .site-hero-media {
        max-width: 420px;
        margin: 0 auto;
    }

    .site-cards-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-grid-home {
        grid-template-columns: repeat(4, 1fr);
    }

    .page-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .sidebar-article-list {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .site-menu-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        background: var(--c-surface);
        overflow-y: auto;
        border-top: 1px solid var(--c-border);
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        padding: 12px 8px;
        border-bottom: 1px solid var(--c-border);
        font-size: 0.95rem;
    }

    .site-section {
        padding: 40px 0;
    }

    .site-cards-3,
    .site-cards-2,
    .site-split,
    .site-knowledge,
    .site-contact-grid,
    .site-metrics,
    .site-footer-grid {
        grid-template-columns: 1fr;
    }

    .article-grid-home {
        grid-template-columns: repeat(2, 1fr);
    }

    .list-article-item {
        flex-direction: column;
    }

    .list-thumb {
        flex: none;
        max-width: 100%;
        width: 100%;
    }

    .article-prenext {
        flex-direction: column;
    }

    .prenext-next {
        text-align: left;
    }

    .pagelist-lr {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .site-hero {
        padding: 32px 0 40px;
    }

    .site-card,
    .site-band,
    .article-detail,
    .related-articles,
    .list-article-item,
    .sidebar-widget,
    .pagebar {
        padding: 14px;
    }

    .article-grid-home {
        grid-template-columns: 1fr;
    }

    .related-item {
        flex-direction: column;
    }

    .related-thumb {
        flex: none;
        width: 100%;
    }

    .related-thumb img {
        height: auto;
        max-height: 160px;
    }
}
