/* =========================================================
   软盒下载站 - 前台样式
   设计原则：白底、细线、留白，只有一个强调色
   ========================================================= */

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

:root {
    --ink:        #111827;
    --ink-2:      #374151;
    --muted:      #6b7280;
    --muted-2:    #9ca3af;
    --line:       #e9e9ee;
    --bg:         #ffffff;
    --soft:       #f7f7f9;
    --soft-2:     #f1f2f4;
    --accent:     #2563eb;
    --accent-ink: #1d4ed8;
    --price:      #d92d20;
    --green:      #0f9d58;
    --radius:     10px;
    --radius-lg:  14px;
    --shadow:     0 1px 2px rgba(17,24,39,.04), 0 8px 24px rgba(17,24,39,.05);
    --maxw:       1120px;
}

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 20px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------------- 顶部 ---------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.site-header .inner {
    height: 64px;
    display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand .mark {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--ink); color: #fff;
    display: grid; place-items: center;
    font-size: 13px; font-weight: 700; letter-spacing: 0;
}
.nav { display: flex; align-items: center; gap: 22px; font-size: 14.5px; color: var(--ink-2); }
.nav a { color: var(--ink-2); }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); font-weight: 600; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.search-form { position: relative; }
.search-form input {
    width: 200px; height: 36px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    font-size: 13.5px; color: var(--ink);
    outline: none;
    transition: all .18s;
}
.search-form input:focus { background: #fff; border-color: #c7cbd6; width: 240px; }
.search-form button {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; cursor: pointer;
    color: var(--muted); font-size: 14px; padding: 4px;
}

/* ---------------- 通用按钮 ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 40px; padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    font-size: 14.5px; font-weight: 500;
    cursor: pointer;
    transition: all .18s ease;
    white-space: nowrap;
}
.btn:hover { border-color: #cbd0da; background: var(--soft); color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; border-color: #000; color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 15.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 7px; }

/* ---------------- 首页 Hero ---------------- */
.hero { padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: 34px; line-height: 1.3; letter-spacing: -.02em; }
.hero .lead { margin-top: 14px; font-size: 16px; color: var(--muted); max-width: 620px; }
.hero-stats { margin-top: 26px; display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stats .num { font-size: 22px; font-weight: 700; }
.hero-stats .lab { font-size: 13px; color: var(--muted); }

.section { padding: 48px 0; }
.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-bottom: 24px; gap: 16px;
}
.section-head h2 { font-size: 21px; }
.section-head .more { font-size: 14px; color: var(--muted); }
.section-head .more:hover { color: var(--accent); }

/* ---------------- 分类 ---------------- */
.cat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px; color: var(--ink-2);
    background: #fff;
    transition: all .18s;
}
.cat-chip:hover { border-color: var(--ink); color: var(--ink); }
.cat-chip .cnt { color: var(--muted-2); font-size: 12.5px; }
.cat-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-chip.active .cnt { color: rgba(255,255,255,.6); }

/* ---------------- 软件卡片 ---------------- */
.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s, transform .18s;
    display: flex; flex-direction: column;
}
.card:hover { border-color: #dfe2ea; box-shadow: var(--shadow); transform: translateY(-2px); }
.card .thumb {
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--soft);
    overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 16px 16px 18px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 16px; line-height: 1.5; }
.card .desc {
    margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.65;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .foot {
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.price { color: var(--price); font-weight: 700; font-size: 17px; }
.price .cur { font-size: 13px; margin-right: 1px; }
.price-free { color: var(--green); font-weight: 600; }
.price-old { color: var(--muted-2); font-size: 12.5px; text-decoration: line-through; margin-left: 6px; font-weight: 400; }
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: 12px; line-height: 1.6;
    background: var(--soft-2); color: var(--muted);
}
.badge-free { background: #e9f7ef; color: #0f7b45; }

/* ---------------- 列表页 ---------------- */
.page-head { padding: 34px 0 22px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 26px; }
.page-head .desc { margin-top: 8px; color: var(--muted); font-size: 14.5px; max-width: 720px; }
.filter-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 0; flex-wrap: wrap;
}
.sorts { display: flex; gap: 6px; font-size: 13.5px; }
.sorts a { padding: 5px 12px; border-radius: 7px; color: var(--muted); }
.sorts a:hover { background: var(--soft); color: var(--ink); }
.sorts a.active { background: var(--soft-2); color: var(--ink); font-weight: 500; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 36px; height: 36px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 8px;
    font-size: 13.5px; color: var(--ink-2);
}
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination .active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination .disabled { color: var(--muted-2); background: var(--soft); }

/* ---------------- 详情页 ---------------- */
.breadcrumb { padding: 20px 0 0; font-size: 13px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 7px; color: var(--muted-2); }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; padding: 24px 0 60px; }
.detail-main { min-width: 0; }
.detail-head { display: flex; gap: 22px; align-items: flex-start; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.detail-head .cover {
    width: 168px; flex: 0 0 168px; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--line); background: var(--soft);
}
.detail-head h1 { font-size: 26px; line-height: 1.35; }
.detail-head .ver { margin-left: 8px; font-size: 13px; color: var(--muted); font-weight: 400; }
.detail-head .summary { margin-top: 10px; color: var(--muted); font-size: 14.5px; line-height: 1.75; }
.detail-head .tags { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

.meta-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px 24px; padding: 24px 0; border-bottom: 1px solid var(--line);
}
.meta-grid .k { font-size: 12.5px; color: var(--muted); }
.meta-grid .v { font-size: 14px; margin-top: 2px; }

.article { padding: 28px 0 0; }
.article h2 { font-size: 18px; margin: 26px 0 12px; }
.article h3 { font-size: 16px; margin: 22px 0 10px; }
.article h4 { font-size: 15px; margin: 20px 0 9px; }
.article p { color: var(--ink-2); }
.article li { color: var(--ink-2); margin-bottom: 6px; }
.article ul, .article ol { padding-left: 22px; margin: 0 0 14px; }
.article img {
    border-radius: 10px; margin: 14px 0;
    max-width: 100%; height: auto; vertical-align: top;
}
.article a { color: var(--accent, #2563eb); text-decoration: underline; text-underline-offset: 2px; }
.article blockquote {
    margin: 16px 0; padding: 12px 18px;
    border-left: 3px solid var(--line); background: #f8f9fb;
    border-radius: 0 8px 8px 0; color: var(--muted);
}
.article blockquote p:last-child { margin-bottom: 0; }
.article hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.article table {
    width: 100%; border-collapse: collapse; margin: 16px 0;
    font-size: 13.5px; color: var(--ink-2);
}
.article th, .article td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.article th { background: #f7f8fa; font-weight: 600; color: var(--ink); }
.article code {
    background: #f1f3f6; border-radius: 4px; padding: 1px 5px;
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
}
.article pre {
    background: #f6f7f9; border: 1px solid var(--line); border-radius: 8px;
    padding: 14px 16px; overflow-x: auto; line-height: 1.7;
}
.article pre code { background: none; padding: 0; }

/* 购买卡 */
.buy-card {
    position: sticky; top: 88px;
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 22px; background: #fff;
}
.buy-card .price-line { display: flex; align-items: baseline; gap: 8px; }
.buy-card .price { font-size: 30px; }
.buy-card .price .cur { font-size: 16px; }
.buy-card .price-old { font-size: 13px; }
.buy-card .note { margin-top: 6px; font-size: 13px; color: var(--muted); }
.buy-card hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.buy-list { list-style: none; padding: 0; margin: 0 0 18px; font-size: 13.5px; color: var(--ink-2); }
.buy-list li { display: flex; gap: 8px; margin-bottom: 9px; }
.buy-list li::before { content: "✓"; color: var(--green); font-weight: 700; }
.pay-types { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pay-type {
    flex: 1; min-width: 84px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    height: 40px;
    border: 1px solid var(--line); border-radius: 9px;
    font-size: 13.5px; cursor: pointer;
    background: #fff; color: var(--ink-2);
    transition: all .15s;
}
.pay-type input { display: none; }
.pay-type.checked { border-color: var(--ink); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--ink); }
.field-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: block; }
.input {
    width: 100%; height: 40px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 9px;
    font-size: 14px; color: var(--ink); background: #fff; outline: none;
    font-family: inherit;
}
.input:focus { border-color: #c3c8d4; }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.6; }
select.input { appearance: none; background-image: none; cursor: pointer; }

.related { border-top: 1px solid var(--line); padding-top: 40px; margin-top: 40px; }

/* ---------------- 订单 / 支付 ---------------- */
.tip-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; background: var(--soft); }
.tip-card {
    background: #fff; border: 1px solid var(--line); border-radius: 16px;
    padding: 40px 36px; max-width: 460px; width: 100%; text-align: center;
    box-shadow: var(--shadow);
}
.tip-icon {
    width: 54px; height: 54px; margin: 0 auto 18px;
    border-radius: 50%; background: var(--soft-2); color: var(--muted);
    display: grid; place-items: center; font-size: 16px; font-weight: 700;
}
.tip-card h1 { font-size: 20px; margin-bottom: 12px; }
.tip-card p { color: var(--muted); font-size: 14px; }
.tip-actions { margin-top: 24px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tip-card .pay-qr { display: block; margin: 18px auto 8px; width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

.pay-wrap { padding: 40px 0 70px; background: var(--soft); min-height: calc(100vh - 65px); }
.pay-card {
    max-width: 640px; margin: 0 auto; background: #fff;
    border: 1px solid var(--line); border-radius: 16px; padding: 34px;
    box-shadow: var(--shadow);
}
.pay-card h1 { font-size: 21px; margin-bottom: 4px; }
.pay-card .sub { color: var(--muted); font-size: 13.5px; }
.order-lines { margin: 24px 0; border-top: 1px solid var(--line); }
.order-line {
    display: flex; justify-content: space-between; gap: 20px;
    padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.order-line .k { color: var(--muted); }
.order-line .v { text-align: right; word-break: break-all; }
.order-total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 4px; }
.order-total .amt { font-size: 26px; font-weight: 700; color: var(--price); }
.status-pill {
    display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px;
    background: var(--soft-2); color: var(--muted);
}
.status-paid { background: #e9f7ef; color: #0f7b45; }
.status-unpaid { background: #fff4e8; color: #b45309; }

.download-box {
    margin-top: 22px; padding: 20px; border-radius: 12px;
    background: #f4f9f5; border: 1px solid #d6ecd9;
}
.download-box .title { font-weight: 600; margin-bottom: 4px; color: #0f7b45; }
.download-box .hint { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* ---------------- 表格（我的订单） ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { font-weight: 500; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.table tr:last-child td { border-bottom: 0; }

/* ---------------- 空状态 ---------------- */
.empty { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }

/* ---------------- 单页 ---------------- */
.doc { max-width: 760px; margin: 0 auto; padding: 44px 0 70px; }
.doc h1 { font-size: 28px; margin-bottom: 20px; }
.doc h3 { font-size: 17px; margin: 28px 0 10px; }
.doc p, .doc li { color: var(--ink-2); }

/* ---------------- 页脚 ---------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 20px; padding: 44px 0 34px; background: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 12px; letter-spacing: .03em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 13.5px; }
.footer-grid li a { color: var(--ink-2); }
.footer-grid li a:hover { color: var(--accent); }
.footer-about { font-size: 13.5px; color: var(--muted); max-width: 300px; line-height: 1.75; }
.copyright {
    margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line);
    font-size: 12.5px; color: var(--muted-2);
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1000px) {
    .grid-4 { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .detail { grid-template-columns: minmax(0,1fr); }
    .buy-card { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
    .container { padding: 0 18px; }
    .site-header .inner { height: 58px; gap: 14px; }
    .nav { display: none; }
    .search-form input { width: 140px; }
    .search-form input:focus { width: 160px; }
    .hero { padding: 40px 0 30px; }
    .hero h1 { font-size: 26px; }
    .grid, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
    .detail-head { flex-direction: column; gap: 16px; }
    .detail-head .cover { width: 100%; flex: none; }
    .meta-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .pay-card { padding: 24px 20px; }
    .page-head h1 { font-size: 22px; }
}
@media (max-width: 520px) {
    .grid, .grid-4 { grid-template-columns: minmax(0,1fr); }
    .section { padding: 34px 0; }
    .footer-grid { grid-template-columns: 1fr; gap: 22px; }
}

/* ---------------- 授权 KEY ---------------- */
.key-box { margin-top: 18px; padding: 20px; border: 1px dashed #d7dbe3; border-radius: 12px; background: #fafbfc; text-align: center; }
.key-label { font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.key-value { font-family: Consolas, Menlo, monospace; font-size: 26px; font-weight: 700; letter-spacing: 2px; margin: 10px 0 12px; word-break: break-all; }
.key-box .btn { margin-top: 2px; }
