/* =========================================================
   zyfree.net (资源免费吧n) - Clean Modern Editorial Design
   Palette anchored to logo.png: Cobalt Blue + Sky Cyan + Warm Orange
   100% local CSS, zero external CDN dependencies
   ========================================================= */

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --brand: #1668c1;
    --brand-dark: #0e4f96;
    --brand-light: #e8f2fc;
    --sky: #0ea5e9;
    --accent: #ea6a0a;
    --accent-soft: #fff4eb;
    --success: #0d9488;
    --success-soft: #e6f7f5;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
    --container: 1200px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    overflow-x: hidden;
    word-wrap: break-word;
}

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

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

a:hover {
    color: var(--brand-dark);
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-32 { margin-bottom: 32px; }

/* ---------- Header ---------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 70px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: var(--text);
}

.brand-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.brand-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 0.72rem;
    color: var(--muted);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.nav-link {
    padding: 8px 11px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-2);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--brand);
    background: var(--brand-light);
}

.nav-link-tools {
    color: var(--accent);
}

.nav-link-tools:hover,
.nav-link-tools.is-active {
    color: var(--accent);
    background: var(--accent-soft);
}

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

.header-search {
    display: flex;
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 4px 3px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(22, 104, 193, 0.12);
    background: var(--surface);
}

.header-search input {
    border: 0;
    background: transparent;
    outline: none;
    width: 150px;
    font-size: 0.85rem;
    color: var(--text);
}

.header-search button {
    border: 0;
    background: var(--brand);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.header-search button:hover {
    background: var(--brand-dark);
}

.mobile-menu-btn {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-drawer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 14px 0 18px;
}

.mobile-search {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.mobile-search input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
}

.mobile-search button {
    padding: 10px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.mobile-nav-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.mobile-nav-link {
    display: block;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.mobile-nav-link.is-active {
    background: var(--brand-light);
    border-color: var(--brand);
    color: var(--brand);
}

/* ---------- Homepage Announcement Bar (Required below nav) ---------- */
.announce-bar {
    background: linear-gradient(90deg, #0f4c94 0%, #1668c1 60%, #1978d4 100%);
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.announce-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 9px;
    padding-bottom: 9px;
    font-size: 0.88rem;
    flex-wrap: wrap;
}

.announce-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    flex-shrink: 0;
}

.announce-text {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
}

.announce-extra {
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.83rem;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
}

/* ---------- Hero ---------- */
.hero-section {
    background: radial-gradient(circle at 12% 10%, rgba(14, 165, 233, 0.12), transparent 40%),
                radial-gradient(circle at 88% 15%, rgba(234, 106, 10, 0.09), transparent 36%),
                linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
    border-bottom: 1px solid var(--border);
    padding: 40px 0 44px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--brand-light);
    color: var(--brand-dark);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.kicker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.hero-title {
    margin: 0 0 14px;
    font-size: 2.05rem;
    line-height: 1.28;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.hero-title span {
    color: var(--brand);
}

.hero-lead {
    margin: 0 0 22px;
    font-size: 1rem;
    color: var(--text-2);
    max-width: 640px;
}

.hero-search {
    display: flex;
    gap: 8px;
    max-width: 600px;
    background: var(--surface);
    padding: 6px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.hero-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: var(--text);
    background: transparent;
}

.hero-search button {
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    padding: 0 20px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.hero-search button:hover {
    background: var(--brand-dark);
}

.hero-quick-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    font-size: 0.83rem;
}

.quick-label {
    color: var(--muted);
    font-weight: 600;
}

.hero-quick-tags a {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-weight: 500;
}

.hero-quick-tags a:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-light);
}

.panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-md);
}

.panel-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.panel-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-light);
    padding: 4px 10px;
    border-radius: 999px;
}

.panel-date {
    font-size: 0.8rem;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-item {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
}

.stat-num {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--brand);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--muted);
}

.panel-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    border: 1px solid #fed7aa;
    color: var(--text);
    font-size: 0.85rem;
}

.shortcut-row:hover {
    background: #ffebd6;
    color: var(--text);
}

.shortcut-title {
    font-weight: 600;
}

.shortcut-action {
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- Sections ---------- */
.section-block {
    padding: 42px 0;
}

.section-alt {
    background: #edf2f8;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.compact-head {
    margin-bottom: 18px;
}

.section-title {
    margin: 0 0 4px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.section-desc {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.more-link {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--brand);
    white-space: nowrap;
}

.filter-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-tab {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.filter-tab.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ---------- Badges ---------- */
.cat-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-ai { background: #e8f2fc; color: #1668c1; }
.badge-space { background: #e6f7f5; color: #0f766e; }
.badge-soft { background: #eef2ff; color: #4338ca; }
.badge-design { background: #fff4eb; color: #c2410c; }
.badge-news { background: #fef3c7; color: #b45309; }
.badge-default { background: #f1f5f9; color: #475569; }

.tier-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    background: var(--success-soft);
    color: var(--success);
    white-space: nowrap;
}

/* ---------- Resource Cards ---------- */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.resource-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #bfdbfe;
}

.resource-card.is-hidden {
    display: none;
}

.resource-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.resource-title {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 800;
    line-height: 1.35;
}

.resource-title a {
    color: var(--text);
}

.resource-title a:hover {
    color: var(--brand);
}

.resource-summary {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-2);
    line-height: 1.6;
    flex: 1;
}

.resource-quota {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quota-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
}

.quota-val {
    color: var(--text);
    font-weight: 600;
}

.resource-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--muted);
}

.resource-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 0.82rem;
}

.resource-license,
.resource-rating {
    color: var(--muted);
    font-weight: 600;
}

.resource-link {
    font-weight: 700;
    color: var(--brand);
    white-space: nowrap;
}

/* ---------- Main + Sidebar Layout ---------- */
.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: start;
}

.main-column,
.side-column {
    min-width: 0;
}

.lead-article {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}

.lead-article-meta,
.article-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.meta-dot {
    color: var(--accent);
    font-weight: 700;
}

.lead-article-title {
    margin: 0 0 10px;
    font-size: 1.4rem;
    line-height: 1.38;
    font-weight: 800;
}

.lead-article-title a {
    color: var(--text);
}

.lead-article-title a:hover {
    color: var(--brand);
}

.lead-article-excerpt {
    margin: 0 0 16px;
    color: var(--text-2);
    font-size: 0.95rem;
}

.lead-article-foot,
.article-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.article-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.article-card:hover {
    border-color: #bfdbfe;
    box-shadow: var(--shadow-md);
}

.article-card-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    line-height: 1.4;
    font-weight: 800;
}

.article-card-title a {
    color: var(--text);
}

.article-card-title a:hover {
    color: var(--brand);
}

.article-card-excerpt {
    margin: 0 0 14px;
    font-size: 0.91rem;
    color: var(--text-2);
    line-height: 1.65;
}

.tag-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-label {
    font-size: 0.84rem;
    color: var(--muted);
    font-weight: 600;
}

.mini-tag {
    font-size: 0.78rem;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 999px;
}

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

.read-more-link {
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn-primary-sm,
.btn-primary-lg,
.btn-reset-sm,
.btn-outline-block,
.btn-cta-white,
.btn-cta-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.18s ease;
}

.btn-primary-sm {
    padding: 8px 16px;
    font-size: 0.88rem;
    background: var(--brand);
    color: #fff;
}

.btn-primary-sm:hover {
    background: var(--brand-dark);
    color: #fff;
}

.btn-primary-lg {
    padding: 11px 22px;
    font-size: 0.95rem;
    background: var(--brand);
    color: #fff;
    width: 100%;
}

.btn-primary-lg:hover {
    background: var(--brand-dark);
    color: #fff;
}

.btn-reset-sm {
    padding: 8px 14px;
    font-size: 0.86rem;
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text-2);
}

.btn-reset-sm:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.btn-outline-block {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.88rem;
    background: var(--surface);
    border-color: var(--brand);
    color: var(--brand);
    margin-top: 12px;
}

.btn-outline-block:hover {
    background: var(--brand);
    color: #fff;
}

/* ---------- Sidebar Widgets ---------- */
.side-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.side-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.widget-highlight {
    border-top: 3px solid var(--brand);
}

.widget-title {
    margin: 0 0 8px;
    font-size: 1.04rem;
    font-weight: 800;
    color: var(--text);
}

.widget-sub {
    margin: 0 0 12px;
    font-size: 0.84rem;
    color: var(--muted);
}

.compare-mini-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compare-mini-list li {
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.cm-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.88rem;
    margin-bottom: 3px;
}

.cm-name span {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--success);
}

.cm-note {
    font-size: 0.78rem;
    color: var(--muted);
}

.rank-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.rank-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.rank-num.is-top {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.rank-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rank-title {
    font-size: 0.89rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.rank-title:hover {
    color: var(--brand);
}

.rank-meta {
    font-size: 0.76rem;
    color: var(--muted);
}

.topic-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.topic-chip {
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-2);
    font-weight: 500;
}

.topic-chip:hover {
    background: var(--brand-light);
    border-color: var(--brand);
    color: var(--brand);
}

/* ---------- Pillars ---------- */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.pillar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.pillar-card:hover {
    transform: translateY(-2px);
    border-color: var(--brand);
    color: var(--text);
}

.pillar-icon,
.banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pillar-icon svg,
.banner-icon svg {
    width: 22px;
    height: 22px;
}

.pillar-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.pillar-desc {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.55;
    flex: 1;
}

.pillar-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--brand);
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

/* ---------- Tools CTA Banner ---------- */
.section-tools-cta {
    padding-top: 12px;
    padding-bottom: 52px;
}

.tools-banner {
    background: linear-gradient(120deg, #0e4a8c 0%, #1668c1 55%, #0ea5e9 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-md);
}

.tools-banner-copy {
    max-width: 660px;
}

.tools-banner-badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.tools-banner-title {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 800;
}

.tools-banner-desc {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.94rem;
}

.tools-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-cta-white {
    padding: 11px 22px;
    background: #fff;
    color: var(--brand-dark);
    font-size: 0.94rem;
}

.btn-cta-white:hover {
    background: #f0f7ff;
    color: var(--brand-dark);
}

.btn-cta-ghost {
    padding: 11px 18px;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    font-size: 0.92rem;
}

.btn-cta-ghost:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* ---------- Inner Page Banner ---------- */
.page-banner {
    background: linear-gradient(180deg, #ffffff 0%, #f1f6fc 100%);
    border-bottom: 1px solid var(--border);
    padding: 26px 0 30px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.83rem;
    color: var(--muted);
    margin-bottom: 12px;
}

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

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

.page-banner-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-title {
    margin: 0 0 6px;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text);
}

.page-subtitle {
    margin: 0;
    color: var(--text-2);
    font-size: 0.96rem;
    max-width: 780px;
}

/* ---------- Article Detail Prose ---------- */
.article-header-wrap {
    max-width: 860px;
}

.article-h1 {
    margin: 0 0 12px;
    font-size: 1.85rem;
    line-height: 1.35;
    font-weight: 800;
    color: var(--text);
}

.article-lead {
    margin: 0;
    font-size: 1rem;
    color: var(--text-2);
}

.prose-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.mobile-toc {
    display: none;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 22px;
}

.toc-title {
    font-weight: 800;
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.mobile-toc ul,
.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.mobile-toc a,
.toc-list a {
    font-size: 0.86rem;
    color: var(--text-2);
    display: block;
    padding-left: 10px;
    border-left: 2px solid var(--border);
}

.mobile-toc a:hover,
.toc-list a:hover {
    color: var(--brand);
    border-left-color: var(--brand);
}

.sticky-toc {
    position: sticky;
    top: 86px;
}

.article-prose {
    font-size: 1rem;
    line-height: 1.85;
    color: #1e293b;
}

.article-prose h2 {
    margin: 28px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    scroll-margin-top: 88px;
}

.article-prose h2:first-child {
    margin-top: 0;
}

.article-prose h3 {
    margin: 20px 0 8px;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text);
}

.article-prose p {
    margin: 0 0 14px;
}

.article-prose ul,
.article-prose ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.article-prose li {
    margin-bottom: 8px;
}

.article-prose blockquote {
    margin: 18px 0;
    padding: 14px 18px;
    background: var(--brand-light);
    border-left: 4px solid var(--brand);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-2);
}

.article-prose code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.88em;
    color: #0f4f99;
}

.article-prose pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.86rem;
    line-height: 1.6;
}

.article-prose pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.article-prose .table-wrap,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 16px 0;
    -webkit-overflow-scrolling: touch;
}

.article-prose table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 520px;
}

.article-prose th,
.article-prose td,
.data-table th,
.data-table td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.article-prose th,
.data-table th {
    background: var(--surface-soft);
    font-weight: 700;
    color: var(--text);
}

.article-footer-box {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.article-notice {
    margin: 14px 0 0;
    padding: 12px 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    color: var(--muted);
}

.related-section {
    margin-top: 28px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.related-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text);
}

.related-card:hover {
    border-color: var(--brand);
    color: var(--text);
}

.related-card h3 {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.4;
}

.related-card p {
    margin: 0;
    font-size: 0.83rem;
    color: var(--muted);
}

.mini-res-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.mini-res-item {
    display: block;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
}

.mini-res-item:hover {
    border-color: var(--brand);
    background: var(--brand-light);
}

.mini-res-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 0.88rem;
}

.mini-res-head span {
    font-size: 0.72rem;
    color: var(--success);
    font-weight: 700;
}

.mini-res-item p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.cat-switch-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.cat-switch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 0.88rem;
    font-weight: 600;
}

.cat-switch-item:hover,
.cat-switch-item.is-active {
    background: var(--brand-light);
    border-color: var(--brand);
    color: var(--brand);
}

.simple-link-list {
    margin: 10px 0 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.88rem;
}

/* ---------- Resource Directory & Detail ---------- */
.filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 170px;
}

.filter-group-grow {
    flex: 1;
    min-width: 220px;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
}

.filter-group select,
.filter-group input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text);
}

.filter-submit {
    display: flex;
    gap: 8px;
}

.result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    color: var(--text-2);
    flex-wrap: wrap;
}

.res-hero-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.res-hero-main {
    flex: 1;
    min-width: 260px;
}

.res-hero-cta {
    width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.score-val {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
}

.score-label {
    font-size: 0.78rem;
    color: var(--muted);
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.spec-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-label {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
}

.spec-value {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 700;
}

.official-ref-bar {
    margin-top: 22px;
    padding: 16px;
    background: var(--brand-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.official-ref-label {
    display: block;
    font-size: 0.78rem;
    color: var(--brand-dark);
    font-weight: 700;
}

.official-ref-url {
    font-size: 0.88rem;
    word-break: break-all;
    color: var(--text);
}

/* ---------- Tools Page ---------- */
.tool-anchor-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.tool-anchor-nav a {
    padding: 6px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-2);
}

.tool-anchor-nav a:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-light);
}

.tools-stack {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.tool-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 86px;
}

.tool-panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tool-panel-title {
    margin: 8px 0 4px;
    font-size: 1.32rem;
    font-weight: 800;
}

.tool-panel-desc {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.tool-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.tool-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sub-tool-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
}

.field-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-row label {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-2);
}

.count-hint {
    font-weight: 500;
    color: var(--muted);
    font-size: 0.78rem;
}

.field-row input,
.field-row select,
.field-row textarea,
.license-search-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
}

.license-search-box {
    min-width: 240px;
}

.preset-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-chip,
.btn-mini {
    border: 1px solid var(--border-strong);
    background: var(--surface-soft);
    color: var(--text-2);
    padding: 6px 11px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.preset-chip:hover,
.btn-mini:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-light);
}

.btn-mini-ghost {
    background: transparent;
}

.codec-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-result {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.result-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--brand-light);
    color: var(--brand-dark);
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.result-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
}

.result-desc {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--text-2);
}

.result-bullets {
    margin: 0 0 14px;
    padding-left: 18px;
    font-size: 0.87rem;
    color: var(--text-2);
}

.result-bullets li {
    margin-bottom: 6px;
}

.calc-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.calc-metric {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.calc-metric strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--brand);
}

.calc-metric span {
    font-size: 0.78rem;
    color: var(--muted);
}

.result-tip {
    margin: 0;
    font-size: 0.83rem;
    color: var(--muted);
}

.ok-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--success-soft);
    color: var(--success);
    font-size: 0.76rem;
    font-weight: 700;
}

.serp-preview {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.serp-url {
    font-size: 0.78rem;
    color: #0d7a5f;
    margin-bottom: 3px;
}

.serp-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: #1a0dab;
    margin-bottom: 4px;
    line-height: 1.35;
}

.serp-desc {
    font-size: 0.84rem;
    color: #475569;
    line-height: 1.5;
}

/* ---------- Pagination & Empty / 404 ---------- */
.pagination {
    display: flex;
    gap: 8px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.page-num {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-num.is-current,
.page-num:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.empty-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 24px;
    text-align: center;
}

.not-found-box {
    max-width: 680px;
    margin: 20px auto;
}

.nf-code {
    font-size: 3.4rem;
    font-weight: 900;
    color: var(--brand);
    line-height: 1;
    margin-bottom: 10px;
}

.nf-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
}

.nf-desc {
    margin: 0;
    color: var(--muted);
}

.empty-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* ---------- Footer ---------- */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 46px 0 26px;
    margin-top: 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo-wrap {
    display: inline-block;
    background: #ffffff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.footer-logo {
    height: 36px;
    width: auto;
}

.footer-desc {
    margin: 0;
    font-size: 0.86rem;
    color: #94a3b8;
    line-height: 1.7;
}

.footer-title {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.86rem;
}

.footer-links a {
    color: #94a3b8;
}

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

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 20px;
    font-size: 0.83rem;
    color: #94a3b8;
}

.footer-bottom p {
    margin: 0;
}

.beian-wrap a {
    color: #cbd5e1;
    font-weight: 600;
}

.beian-wrap a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 1100px) {
    .main-nav {
        display: none;
    }
    .header-search {
        display: none;
    }
    .mobile-menu-btn {
        display: inline-flex;
    }
    .pillars-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .hero-grid,
    .content-layout,
    .tool-grid-2 {
        grid-template-columns: 1fr;
    }
    .resource-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sticky-toc {
        display: none;
    }
    .mobile-toc {
        display: block;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 14px;
    }
    .brand-logo {
        height: 36px;
    }
    .brand-sub {
        display: none;
    }
    .announce-extra {
        border-left: 0;
        padding-left: 0;
        width: 100%;
    }
    .hero-section {
        padding: 26px 0 30px;
    }
    .hero-title {
        font-size: 1.5rem;
    }
    .hero-search {
        flex-direction: column;
    }
    .hero-search button {
        padding: 10px 16px;
    }
    .resource-grid,
    .pillars-grid,
    .related-grid,
    .spec-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .prose-card,
    .tool-panel,
    .tools-banner {
        padding: 18px 16px;
    }
    .article-h1,
    .page-title {
        font-size: 1.42rem;
    }
    .res-hero-cta {
        width: 100%;
    }
    .license-search-box {
        width: 100%;
        min-width: 0;
    }
    .calc-metrics {
        grid-template-columns: 1fr;
    }
}
