/* 首页样式 v2 — 依赖 tokens.css / front-theme.css */
.home-body {
    margin: 0;
    background: var(--sa-bg);
    color: var(--sa-text);
    font-family: var(--sa-font);
    -webkit-font-smoothing: antialiased;
}
.home-wrap {
    width: min(var(--sa-wrap, 1160px), calc(100% - 32px));
    margin: 0 auto;
}

/* ---------- Hero ---------- */
.home-hero {
    position: relative;
    overflow: hidden;
    /* 为绝对定位导航预留高度，让 Hero 背景延伸到导航下方 */
    padding: calc(var(--sa-header, 112px) + 36px) 0 56px;
    border-bottom: 1px solid var(--sa-line);
}
.home-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 420px at 10% -15%, rgba(var(--sa-brand-rgb), .1), transparent 62%),
        radial-gradient(720px 380px at 92% 0%, rgba(99, 102, 241, .07), transparent 58%),
        linear-gradient(180deg, rgba(var(--sa-brand-rgb), .04) 0%, #f8fafc 48%, var(--sa-bg) 100%);
    pointer-events: none;
}
.home-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.12fr .88fr;
    gap: 44px;
    align-items: center;
}
.home-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: var(--sa-radius-pill);
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(var(--sa-brand-rgb), .18);
    color: var(--sa-brand);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
    backdrop-filter: blur(8px);
}
.home-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sa-brand);
    box-shadow: 0 0 0 4px rgba(var(--sa-brand-rgb), .18);
}
.home-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(30px, 4.4vw, 44px);
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--sa-text-title);
}
.home-hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--sa-brand), #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.home-hero .lead {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--sa-text-secondary);
    font-weight: 600;
}
.home-hero .desc {
    margin: 0 0 24px;
    color: var(--sa-muted);
    font-size: 15px;
    line-height: 1.75;
    max-width: 540px;
}
.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}
.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 22px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    border: 1px solid transparent;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
    cursor: pointer;
}
.home-btn:hover { transform: translateY(-1px); }
.home-btn-primary {
    background: linear-gradient(135deg, var(--sa-brand), var(--sa-brand-hover));
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(var(--sa-brand-rgb), .28);
}
.home-btn-primary:hover {
    color: #fff !important;
    box-shadow: 0 14px 28px rgba(var(--sa-brand-rgb), .36);
}
.home-btn-ghost {
    background: rgba(255, 255, 255, .92);
    color: var(--sa-brand) !important;
    border-color: #c7ddff;
}
.home-btn-ghost:hover {
    color: var(--sa-brand-dark) !important;
    border-color: var(--sa-brand);
    background: #fff;
}
.home-btn-sm {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
    border-radius: 8px;
}
.home-btn-block {
    width: 100%;
}
.home-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.home-hero-tags span {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .78);
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 12px;
}
.home-hero-visual {
    position: relative;
    text-align: center;
}
.home-hero-glow {
    position: absolute;
    left: 50%;
    top: 48%;
    width: 72%;
    height: 62%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(var(--sa-brand-rgb), .1), transparent 72%);
    filter: blur(10px);
    pointer-events: none;
}
.home-hero-visual img {
    position: relative;
    z-index: 1;
    width: min(100%, 480px);
    height: auto;
    filter: drop-shadow(0 18px 32px rgba(15, 23, 42, .06));
}
.home-hero-card {
    position: absolute;
    z-index: 2;
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--sa-line);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: var(--sa-shadow-md);
    text-align: left;
    backdrop-filter: blur(10px);
    animation: home-float 4.5s ease-in-out infinite;
}
.home-hero-card.c1 { left: 4%; bottom: 12%; }
.home-hero-card.c2 {
    right: 2%;
    top: 14%;
    animation-delay: 1.2s;
}
.home-hero-card strong {
    display: block;
    font-size: 13px;
    color: var(--sa-text-title);
    margin-bottom: 2px;
}
.home-hero-card span {
    font-size: 12px;
    color: var(--sa-muted);
}
@keyframes home-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ---------- 特性条 ---------- */
.home-features {
    margin-top: -32px;
    position: relative;
    z-index: 2;
    padding-bottom: 8px;
}
.home-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.home-feature {
    background: var(--sa-card);
    border: 1px solid var(--sa-line);
    border-radius: var(--sa-radius-lg);
    padding: 22px 18px;
    box-shadow: var(--sa-shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.home-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--sa-shadow-md);
    border-color: rgba(var(--sa-brand-rgb), .25);
}
.home-feature .ico {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, var(--sa-brand-soft), #fff);
    color: var(--sa-brand);
    border: 1px solid rgba(var(--sa-brand-rgb), .12);
}
.home-feature h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--sa-text-title);
}
.home-feature p {
    margin: 0;
    font-size: 13px;
    line-height: 1.65;
    color: var(--sa-muted);
}

/* ---------- 通用区块 ---------- */
.home-section { padding: 56px 0; }
.home-section-tight { padding: 40px 0 28px; }
.home-section.alt {
    background: #fff;
    border-top: 1px solid var(--sa-line-soft);
    border-bottom: 1px solid var(--sa-line-soft);
}
.home-section-head {
    text-align: center;
    margin-bottom: 32px;
}
.home-section-head-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    text-align: left;
}
.home-section-head-row .home-section-head,
.home-section-head-row > div:first-child {
    text-align: left;
    margin-bottom: 0;
}
.home-kicker {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    color: var(--sa-brand);
}
.home-section-head h2 {
    margin: 0 0 8px;
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 800;
    color: var(--sa-text-title);
    letter-spacing: .01em;
}
.home-section-head p {
    margin: 0;
    color: var(--sa-muted);
    font-size: 14px;
}
.home-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

/* ---------- 能力标签 ---------- */
.home-caps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 960px;
    margin: 0 auto;
}
.home-caps span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--sa-radius-pill);
    background: #fff;
    border: 1px solid var(--sa-line);
    color: var(--sa-text-secondary);
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .03);
    transition: border-color .15s ease, color .15s ease;
}
.home-caps span:hover {
    border-color: rgba(var(--sa-brand-rgb), .35);
    color: var(--sa-brand);
}
.home-caps .layui-icon {
    color: var(--sa-brand);
    font-size: 14px;
}

/* ---------- 问答中心 ---------- */
.home-ask-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.home-stat {
    background: linear-gradient(180deg, #fff, #f8fafc);
    border: 1px solid var(--sa-line);
    border-radius: 14px;
    padding: 18px 16px;
    text-align: center;
}
.home-stat strong {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: var(--sa-text-title);
    line-height: 1.1;
    margin-bottom: 4px;
}
.home-stat span {
    font-size: 13px;
    color: var(--sa-muted);
}
.home-stat.tip {
    background: linear-gradient(135deg, rgba(var(--sa-brand-rgb), .1), rgba(99, 102, 241, .08));
    border-color: rgba(var(--sa-brand-rgb), .18);
}
.home-stat.tip strong { color: var(--sa-brand); }

.home-ask-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.home-ask-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--sa-line);
    border-radius: 14px;
    text-decoration: none !important;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.home-ask-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--sa-shadow-md);
    border-color: rgba(var(--sa-brand-rgb), .28);
}
.home-ask-item .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--sa-brand-soft);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--sa-line);
}
.home-ask-item .body { min-width: 0; }
.home-ask-item .title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.home-ask-item h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--sa-text-title);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.home-ask-item:hover h3 { color: var(--sa-brand); }
.home-ask-item .tag {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: 4px;
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
    line-height: 1;
}
.home-ask-item .tag.top { background: #fff1f0; color: #cf1322; }
.home-ask-item .tag.fine { background: #fff7e6; color: #d46b08; }
.home-ask-item .tag.ok { background: #f6ffed; color: #389e0d; }
.home-ask-item .tag.pending { background: #fff7e6; color: #d46b08; }
.home-ask-item .tag.coin { background: var(--sa-brand-soft); color: var(--sa-brand); }
.home-ask-item.is-unsolved {
    border-color: rgba(250, 140, 22, .35);
    background: linear-gradient(90deg, rgba(250, 140, 22, .06) 0%, #fff 48px);
}
.home-ask-item.is-unsolved:hover {
    border-color: rgba(250, 140, 22, .55);
    box-shadow: 0 8px 20px rgba(250, 140, 22, .12);
}
.home-ask-item .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: var(--sa-text-hint);
}
.home-ask-item .counts {
    display: flex;
    gap: 14px;
    text-align: center;
    flex-shrink: 0;
}
.home-ask-item .counts div {
    min-width: 44px;
}
.home-ask-item .counts b {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--sa-text-title);
    line-height: 1.2;
}
.home-ask-item .counts small {
    font-size: 11px;
    color: var(--sa-text-hint);
}

/* ---------- 服务 ---------- */
.home-service-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.home-service {
    background: #fff;
    border: 1px solid var(--sa-line);
    border-radius: var(--sa-radius-lg);
    padding: 24px 18px;
    transition: transform .18s ease, box-shadow .18s ease;
}
.home-service:hover {
    transform: translateY(-3px);
    box-shadow: var(--sa-shadow-md);
}
.home-service .num {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--sa-brand-soft), #fff);
    color: var(--sa-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 14px;
    border: 1px solid rgba(var(--sa-brand-rgb), .12);
}
.home-service h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--sa-text-title);
}
.home-service p {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--sa-muted);
    line-height: 1.65;
    min-height: 44px;
}
.home-service a {
    color: var(--sa-brand) !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
}
.home-service a:hover { opacity: .85; }

/* ---------- 文档中心 ---------- */
.home-docs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
    gap: 20px;
    align-items: start;
}
.home-docs-main {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}
.home-docs-block,
.home-side-card {
    background: #fff;
    border: 1px solid var(--sa-line);
    border-radius: 16px;
    padding: 18px;
}
.block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sa-line-soft);
}
.block-head h3 {
    margin: 0;
    font-size: 16px;
    color: var(--sa-text-title);
    display: flex;
    align-items: center;
    gap: 6px;
}
.block-head h3 .layui-icon {
    color: var(--sa-brand);
    font-size: 18px;
}
.block-head a {
    font-size: 12px;
    color: var(--sa-text-hint) !important;
    text-decoration: none !important;
}
.block-head a:hover { color: var(--sa-brand) !important; }

.home-docs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.home-doc-card {
    display: block;
    border: 1px solid var(--sa-line);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    background: #fafbfc;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.home-doc-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sa-shadow);
    border-color: rgba(var(--sa-brand-rgb), .3);
}
.home-doc-card .cover {
    height: 110px;
    background: linear-gradient(135deg, var(--sa-brand-soft), #f8fafc);
    overflow: hidden;
}
.home-doc-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.home-doc-card .info { padding: 12px 12px 14px; }
.home-doc-card h4 {
    margin: 0 0 6px;
    font-size: 14px;
    color: var(--sa-text-title);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-doc-card p {
    margin: 0;
    font-size: 12px;
    color: var(--sa-muted);
    line-height: 1.5;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.home-docs-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 80px;
    min-width: 0;
    max-width: 100%;
}
.home-latest-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.home-latest-list li {
    border-bottom: 1px dashed var(--sa-line-soft);
}
.home-latest-list li:last-child { border-bottom: 0; }
.home-latest-list a {
    display: block;
    padding: 10px 0;
    text-decoration: none !important;
    color: inherit;
}
.home-latest-list .t {
    display: block;
    font-size: 13px;
    color: var(--sa-text-secondary);
    line-height: 1.45;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.home-latest-list a:hover .t { color: var(--sa-brand); }
.home-latest-list .m {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: var(--sa-text-hint);
}
.home-latest-list .m em {
    font-style: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.home-latest-list .empty {
    color: var(--sa-text-hint);
    font-size: 13px;
    padding: 20px 0;
    text-align: center;
}

.home-side-cta {
    border-radius: 16px;
    padding: 20px 16px;
    background: linear-gradient(145deg, var(--sa-brand) 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 12px 24px rgba(var(--sa-brand-rgb), .2);
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}
.home-side-cta h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.35;
    word-break: break-word;
}
.home-side-cta p {
    margin: 0 0 16px;
    font-size: 13px;
    opacity: .9;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.home-side-cta .home-btn,
.home-side-cta .home-btn-primary {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #fff;
    color: var(--sa-brand) !important;
    box-shadow: none;
    white-space: nowrap;
}

/* ---------- empty ---------- */
.home-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--sa-text-hint);
    padding: 36px 12px;
    font-size: 14px;
    background: #fff;
    border: 1px dashed var(--sa-line);
    border-radius: 14px;
}
.home-empty.slim {
    padding: 24px 12px;
    background: transparent;
    border-style: dashed;
}
.home-empty a {
    color: var(--sa-brand) !important;
    text-decoration: none !important;
    font-weight: 600;
}

/* ---------- 友情链接（仅 Logo） ---------- */
.home-links {
    padding: 28px 0 40px;
    border-top: 1px solid var(--sa-line);
    background: #fff;
}
.home-links-head {
    font-size: 13px;
    color: var(--sa-muted);
    margin-bottom: 14px;
    letter-spacing: .02em;
}
.home-links-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}
.home-link-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 6px 12px;
    border: 1px solid var(--sa-line);
    border-radius: 10px;
    background: #fafafa;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.home-link-logo:hover {
    border-color: rgba(var(--sa-brand-rgb), .35);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
}
.home-link-logo img {
    display: block;
    max-height: 28px;
    max-width: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ---------- CTA ---------- */
.home-cta { padding: 8px 0 56px; }
.home-cta-box {
    background: linear-gradient(135deg, var(--sa-brand) 0%, #4f46e5 100%);
    border-radius: 18px;
    padding: 36px 28px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 18px 40px rgba(var(--sa-brand-rgb), .28);
}
.home-cta-box h2 {
    margin: 0 0 8px;
    font-size: 24px;
}
.home-cta-box p {
    margin: 0;
    opacity: .92;
    font-size: 14px;
}
.home-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.home-cta-actions .home-btn-primary {
    background: #fff;
    color: var(--sa-brand) !important;
    box-shadow: none;
}
.home-cta-actions .home-btn-ghost {
    background: transparent;
    color: #fff !important;
    border-color: rgba(255, 255, 255, .45);
}
.home-cta-actions .home-btn-ghost:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff !important;
}

.home-trust {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.home-trust-item {
    background: #fff;
    border: 1px solid var(--sa-line);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
}
.home-trust-item strong {
    display: block;
    font-size: 14px;
    color: var(--sa-text-title);
    margin-bottom: 4px;
}
.home-trust-item span {
    font-size: 12px;
    color: var(--sa-muted);
}

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
    .home-hero-grid { grid-template-columns: 1fr; gap: 28px; }
    .home-hero-visual { order: -1; }
    .home-hero-card.c2 { display: none; }
    .home-feature-grid,
    .home-service-grid,
    .home-ask-stats,
    .home-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-docs-layout { grid-template-columns: 1fr; }
    .home-docs-side { position: static; }
    .home-docs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-section-head-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
@media (max-width: 640px) {
    .home-hero { padding: 40px 0 36px; }
    .home-hero-card { display: none; }
    .home-feature-grid,
    .home-service-grid,
    .home-ask-stats,
    .home-docs-grid,
    .home-trust { grid-template-columns: 1fr; }
    .home-ask-item {
        grid-template-columns: 40px 1fr;
        gap: 12px;
    }
    .home-ask-item .avatar {
        width: 40px;
        height: 40px;
    }
    .home-ask-item .counts {
        grid-column: 2;
        justify-content: flex-start;
        padding-top: 2px;
    }
    .home-cta-box { padding: 24px 18px; }
    .home-section { padding: 40px 0; }
}
