/* =============================================================
   1688运营轻量内容站 — 基础样式
   轻量优先，移动端友好，无外部依赖
   ============================================================= */

/* ── reset & base ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont,
                 "PingFang SC", "Microsoft YaHei",
                 "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 600;
}

/* ── layout ── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* ── site header ── */
.site-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.header-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
}

.nav-list {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    display: block;
    padding: 0.4rem 0.65rem;
    font-size: 0.9rem;
    color: #555;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    background: #f5f5f5;
    color: #222;
}

.nav-link-community {
    background: #e8f4e8;
    color: #2a7a2a;
    font-weight: 600;
}

/* mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

/* ── hero ── */
.hero {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    padding: 3rem 0;
    text-align: center;
}

.hero-title {
    font-size: 1.8rem;
    color: #1b5e20;
    margin-bottom: 0.5rem;
}

.hero-desc {
    font-size: 1rem;
    color: #388e3c;
    margin-bottom: 1.5rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── sections ── */
.section {
    padding: 2.5rem 0;
    border-bottom: 1px solid #eee;
}

.section-entry { background: #fff; }

/* ── section header ── */
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.section-title {
    font-size: 1.2rem;
    color: #222;
}

.section-subtitle {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.2rem;
}

.section-more {
    font-size: 0.85rem;
    color: #388e3c;
    white-space: nowrap;
}

/* ── entry grid ── */
.entry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.entry-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: #f8fffe;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s;
}

.entry-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.entry-card h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.entry-card p { font-size: 0.82rem; color: #777; }

/* ── card grid ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* ── card ── */
.card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.15s;
}

.card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.75rem;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    align-self: flex-start;
}

.card-title {
    font-size: 0.95rem;
    color: #222;
    margin-bottom: 0.5rem;
}

.card-summary {
    font-size: 0.82rem;
    color: #777;
    flex: 1;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 0.75rem;
}

/* ── beginner list ── */
.beginner-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.beginner-item {
    display: block;
    padding: 0.6rem 0.75rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #388e3c;
    transition: background 0.15s;
}

.beginner-item:hover {
    background: #f1f8e9;
}

/* ── community box ── */
.community-box {
    text-align: center;
    padding: 2rem;
    background: #f1f8e9;
    border-radius: 8px;
}

.community-desc {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1rem;
}

/* ── buttons ── */
.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.1s;
}

.btn-primary {
    background: #388e3c;
    color: #fff;
}

.btn-primary:hover { background: #2e7d32; }
.btn-secondary {
    background: #fff;
    color: #388e3c;
    border: 1px solid #388e3c;
}
.btn-secondary:hover { background: #f1f8e9; }

.btn-empty {
    display: inline-block;
    padding: 0.45rem 1rem;
    border: 1px solid #bbb;
    border-radius: 5px;
    font-size: 0.85rem;
    color: #666;
}

/* ── page headers ── */
.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.page-title {
    font-size: 1.4rem;
    color: #222;
}

.page-desc {
    font-size: 0.9rem;
    color: #777;
    margin-top: 0.4rem;
}

/* ── list filter ── */
.list-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.85rem;
    color: #888;
}

.filter-tag {
    padding: 0.2rem 0.65rem;
    font-size: 0.82rem;
    background: #f5f5f5;
    border-radius: 3px;
    color: #555;
    transition: background 0.15s;
}

.filter-tag:hover, .filter-tag.active {
    background: #e8f5e9;
    color: #2e7d32;
}

/* ── pagination ── */
.pagination { margin-top: 2rem; }

.pagination-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.page-link, .page-current {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #555;
}

.page-link:hover { background: #f5f5f5; }
.page-link.disabled, .page-current {
    color: #bbb;
    border-color: #eee;
    background: #fafafa;
    cursor: default;
}

/* ── empty state ── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-message {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 1rem;
}

/* ── breadcrumb ── */
.breadcrumb {
    margin-bottom: 1.5rem;
}

.breadcrumb-list {
    display: flex;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #aaa;
    flex-wrap: wrap;
}

.breadcrumb-list li:not(:last-child)::after {
    content: "›";
    margin-left: 0.4rem;
}

.breadcrumb-list a {
    color: #888;
}
.breadcrumb-list a:hover { color: #388e3c; }
.breadcrumb-list .active { color: #555; }

/* ── detail ── */
.detail-article {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.detail-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.detail-title {
    font-size: 1.5rem;
    color: #222;
    margin-bottom: 0.75rem;
}

.detail-summary {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.detail-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: #aaa;
}

.detail-content {
    padding: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #444;
}

.detail-content h2 {
    font-size: 1.15rem;
    color: #222;
    margin: 1.5rem 0 0.6rem;
}

.detail-content p { margin-bottom: 1rem; }
.detail-content ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.detail-content li { list-style: disc; margin-bottom: 0.3rem; }

.content-placeholder {
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
}

.detail-related {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.related-title {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.6rem;
}

.related-list li { margin-bottom: 0.3rem; }
.related-list a { font-size: 0.85rem; color: #388e3c; }
.related-list a:hover { text-decoration: underline; }

.detail-cta {
    padding: 1.25rem 1.5rem;
    background: #f1f8e9;
    text-align: center;
}

.cta-text {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.75rem;
}

.detail-back {
    margin-top: 1rem;
    text-align: center;
}

.detail-back a {
    font-size: 0.85rem;
    color: #888;
}
.detail-back a:hover { color: #388e3c; }

/* ── site footer ── */
.site-footer {
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

.footer-title {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.6rem;
}

.footer-desc {
    font-size: 0.82rem;
    color: #777;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.footer-links a {
    font-size: 0.82rem;
    color: #666;
}
.footer-links a:hover { color: #388e3c; }

.footer-community-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: #388e3c;
}

.footer-bottom {
    border-top: 1px solid #e0e0e0;
    padding: 1rem 0;
    margin-top: 1rem;
}

.footer-disclaimer,
.footer-icp {
    font-size: 0.75rem;
    color: #aaa;
}

.footer-icp-placeholder {
    color: #ccc;
}

/* ── responsive ── */
@media (max-width: 768px) {
    .entry-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }

    .nav-toggle { display: flex; }

    .nav-primary {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #eee;
        padding: 0.5rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    .nav-primary.is-open { display: block; }

    .nav-list {
        flex-direction: column;
        gap: 0;
    }

    .nav-link { padding: 0.6rem 0.75rem; }
}

@media (max-width: 480px) {
    .entry-grid { grid-template-columns: 1fr 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
    .section-header { flex-direction: column; align-items: flex-start; }
}
