:root {
    --ink: #10182b;
    --muted: #667085;
    --line: #e6e9f0;
    --bg: #f6f8fc;
    --card: #ffffff;
    --brand: #3d5afe;
    --brand-deep: #1e2a78;
    --violet: #7c4dff;
    --green: #0f9d76;
    --amber: #d97706;
    --shadow: 0 18px 48px rgba(20, 32, 70, .10);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; }
.container { width: min(1200px, calc(100% - 40px)); margin: 0 auto; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(12, 20, 46, .94);
    backdrop-filter: blur(14px);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner { display: flex; align-items: center; gap: 26px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
    display: inline-grid; place-items: center;
    width: 38px; height: 38px; border-radius: 12px;
    background: linear-gradient(135deg, #5b7cff, #8d5cff);
    font-weight: 800; font-size: 20px; box-shadow: 0 8px 20px rgba(92,112,255,.45);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 20px; letter-spacing: 2px; }
.brand-text small { font-size: 10px; letter-spacing: 1.6px; color: #9fb0e8; }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.main-nav a { padding: 8px 10px; border-radius: 8px; font-size: 14px; color: #dbe3ff; white-space: nowrap; }
.main-nav a:hover { background: rgba(255,255,255,.10); color: #fff; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-search { display: flex; background: rgba(255,255,255,.10); border-radius: 10px; overflow: hidden; }
.header-search input { width: 170px; border: 0; background: transparent; color: #fff; padding: 8px 10px; outline: none; font-size: 13px; }
.header-search input::placeholder { color: #a9b6e6; }
.header-search button { border: 0; background: transparent; color: #fff; padding: 0 12px; font-size: 20px; cursor: pointer; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.btn-ghost, .btn-small { border: 1px solid rgba(255,255,255,.28); background: transparent; color: #fff; padding: 7px 12px; border-radius: 9px; font-size: 13px; cursor: pointer; }
.btn-ghost:hover, .btn-small:hover { background: rgba(255,255,255,.12); }
.btn-small { background: linear-gradient(135deg, #4f6dff, #7c4dff); border-color: transparent; }
.member-pill { font-size: 13px; color: #cfd8ff; }
.quick-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 8px 0 12px; font-size: 12px; color: #9fb0e8; }
.quick-filter a { color: #dce4ff; padding: 3px 8px; border-radius: 20px; background: rgba(255,255,255,.07); }
.quick-filter a:hover { background: rgba(255,255,255,.18); color: #fff; }
.notice { margin: 16px 0 0; padding: 12px 16px; border-left: 4px solid var(--brand); background: #eef1ff; border-radius: 8px; }

/* Buttons */
.btn-primary, .btn-outline {
    display: inline-flex; justify-content: center; align-items: center;
    padding: 12px 22px; border-radius: 12px; font-size: 15px; font-weight: 600;
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--violet)); color: #fff; box-shadow: 0 10px 24px rgba(80,80,220,.28); border: 0; }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(80,80,220,.36); }
.btn-outline { border: 1px solid #c9d2e8; background: #fff; color: var(--brand-deep); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary.block, .btn-outline.block { display: flex; width: 100%; margin-bottom: 10px; }

/* Hero */
.hero {
    position: relative; overflow: hidden; color: #fff;
    background: radial-gradient(circle at 78% 20%, rgba(124,77,255,.6), transparent 42%),
                radial-gradient(circle at 12% 80%, rgba(61,90,254,.5), transparent 45%),
                linear-gradient(115deg, #0c1430, #182762 55%, #241a58);
    padding: 64px 0 0;
}
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 90px; background: linear-gradient(transparent, var(--bg)); }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; min-height: 380px; }
.eyebrow, .section-kicker { display: inline-block; font-size: 12px; letter-spacing: 2.4px; text-transform: uppercase; color: #9fb5ff; font-weight: 700; }
.hero-copy h1 { font-size: clamp(34px, 4.6vw, 62px); line-height: 1.15; margin: 14px 0 18px; letter-spacing: 1px; }
.hero-copy h1 span { background: linear-gradient(90deg, #8fd0ff, #c6a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy p { max-width: 640px; color: #d3ddff; font-size: 16px; }
.hero-search { display: flex; max-width: 560px; background: #fff; border-radius: 14px; padding: 6px; margin-top: 26px; box-shadow: var(--shadow); }
.hero-search input { flex: 1; border: 0; outline: none; padding: 10px 14px; font-size: 15px; color: var(--ink); }
.hero-search button { border: 0; border-radius: 10px; padding: 10px 24px; background: linear-gradient(135deg, var(--brand), var(--violet)); color: #fff; font-weight: 600; cursor: pointer; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-tags a { padding: 5px 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 20px; font-size: 13px; color: #e5ebff; }
.hero-tags a:hover { background: rgba(255,255,255,.14); color: #fff; }
.hero-art { position: relative; height: 320px; display: grid; place-items: center; }
.orbit { position: absolute; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.orbit-one { width: 280px; height: 280px; animation: spin 22s linear infinite; }
.orbit-two { width: 190px; height: 190px; border-style: dashed; animation: spin 14s linear infinite reverse; }
.orbit-core { width: 108px; height: 108px; border-radius: 28px; display: grid; place-items: center; font-size: 44px; font-weight: 800; background: linear-gradient(135deg, #6d8bff, #a06bff); box-shadow: 0 20px 60px rgba(120,110,255,.6); }
.float-chip { position: absolute; padding: 8px 14px; border-radius: 12px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); font-size: 13px; backdrop-filter: blur(8px); }
.chip-a { top: 30px; right: 30px; }
.chip-b { bottom: 46px; left: 10px; }
.chip-c { bottom: 18px; right: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-stats { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 26px 0 46px; text-align: center; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 30px; }
.hero-stats span { font-size: 13px; color: #b7c6ff; }

/* Sections and cards */
.section { padding: 46px 0 6px; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 20px; }
.section-head h2 { margin: 4px 0 0; font-size: 28px; }
.section-link { font-size: 14px; color: var(--brand); }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.category-card { display: flex; flex-direction: column; gap: 4px; padding: 22px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .18s ease; }
.category-card:hover { transform: translateY(-5px); border-color: #c6d0ff; color: var(--ink); }
.category-icon { font-size: 28px; }
.category-card strong { font-size: 17px; }
.category-count { font-size: 12px; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.software-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-height: 220px; box-shadow: 0 8px 24px rgba(20,32,70,.05); transition: transform .18s ease, box-shadow .18s ease; }
.software-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); color: var(--ink); border-color: #c6d0ff; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-icon { width: 54px; height: 54px; border-radius: 15px; overflow: hidden; background: linear-gradient(135deg, #e8edff, #f3eaff); display: grid; place-items: center; font-size: 24px; font-weight: 700; color: var(--brand-deep); flex-shrink: 0; }
.card-icon img { width: 100%; height: 100%; object-fit: contain; }
.card-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; white-space: nowrap; }
.badge-commercial { background: #fff3e0; color: #a15c00; }
.badge-free { background: #e7f8f1; color: #0b7a5b; }
.badge-form { background: #edf0ff; color: #3a49a8; }
.software-card h3 { margin: 14px 0 6px; font-size: 17px; }
.card-summary { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 14px; font-size: 12px; color: #8a93a8; }
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 30px; margin: 46px 0; padding: 36px 40px; border-radius: 24px; color: #fff; background: linear-gradient(120deg, #1c2a6b, #5a3ab0); }
.cta-band h2 { margin: 8px 0; font-size: 30px; }
.cta-band p { margin: 0; color: #d5d9ff; }
.cta-actions { display: flex; gap: 12px; flex-shrink: 0; }
.cta-actions .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }

/* Generic page */
.page-banner { padding: 40px 0 18px; }
.page-banner h1 { margin: 6px 0 6px; font-size: 36px; }
.page-banner p { margin: 0; color: var(--muted); }
.prose { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 36px; margin-bottom: 40px; }
.prose h2 { margin-top: 26px; font-size: 21px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: #44506a; }

/* Catalog */
.catalog-layout { display: grid; grid-template-columns: 250px 1fr; gap: 24px; padding-bottom: 40px; }
.filter-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; height: fit-content; box-shadow: 0 8px 24px rgba(20,32,70,.04); }
.filter-form { display: flex; flex-direction: column; gap: 14px; }
.filter-form label, .auth-form label, .form-grid label, .full-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #46516b; }
.input { width: 100%; border: 1px solid #d5dcec; border-radius: 10px; padding: 10px 12px; font-size: 14px; background: #fff; color: var(--ink); outline: none; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(61,90,254,.12); }
.results-bar { display: flex; justify-content: space-between; padding: 0 2px 14px; color: var(--muted); font-size: 14px; }
.results-bar strong { color: var(--brand); }
.empty-state { padding: 60px 20px; text-align: center; background: #fff; border-radius: var(--radius); border: 1px dashed #c9d2e8; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; padding: 26px 0; }
.pagination a { color: var(--brand); }

/* Detail */
.detail-head { padding-top: 28px; }
.breadcrumb { font-size: 13px; color: var(--muted); }
.detail-hero { display: flex; gap: 24px; align-items: center; margin: 18px 0 24px; padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.detail-icon { width: 110px; height: 110px; flex-shrink: 0; border-radius: 24px; overflow: hidden; background: linear-gradient(135deg, #e8edff, #f2eaff); display: grid; place-items: center; font-size: 48px; font-weight: 800; color: var(--brand-deep); }
.detail-icon img { width: 100%; height: 100%; object-fit: contain; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-title h1 { margin: 10px 0 6px; font-size: 32px; }
.detail-title p { margin: 0; color: var(--muted); }
.detail-facts { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: 13px; color: #7b859c; }
.detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; padding-bottom: 10px; }
.detail-content { margin: 0; }
.detail-side { display: flex; flex-direction: column; gap: 16px; }
.action-panel, .side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.action-panel h3 { margin-top: 0; }
.hint, .gate-text, .safe-note { font-size: 12px; color: var(--muted); }
.gate-text { background: #f3f5fb; padding: 12px; border-radius: 10px; }
.safe-note { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 8px; }
.side-card h4 { margin-top: 0; }
.side-card p { font-size: 13px; color: #59647c; margin: 6px 0; }

/* 分平台安装包 */
.platform-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; }
.platform-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px; border-radius: 999px; font-size: 12px;
    background: #eef1ff; color: var(--brand-deep); border: 1px solid #dbe3ff;
}
.pkg-list { display: flex; flex-direction: column; gap: 8px; }
.pkg-list .btn-primary { margin-bottom: 0; }
.pkg-list .hint { margin: -4px 0 4px; }
.pkg-disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag { padding: 4px 10px; border-radius: 16px; background: #eef1ff; color: var(--brand); font-size: 12px; }
.shot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.shot-grid img { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #f4f6fb; min-height: 120px; object-fit: contain; }
.changelog { white-space: pre-line; padding: 14px 18px; border-radius: 10px; background: #f5f7fc; color: #4a5670; font-size: 14px; }

/* Auth */
.auth-wrap { min-height: calc(100vh - 220px); display: grid; place-items: center; padding: 50px 20px; }
.auth-card { display: grid; grid-template-columns: 1fr 1fr; width: min(880px, 100%); background: #fff; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.auth-aside { padding: 46px; color: #fff; background: linear-gradient(140deg, #182762, #5a3ab0); }
.auth-aside .brand-mark { margin-bottom: 26px; }
.auth-aside h2 { font-size: 28px; }
.auth-aside p { color: #d3d9ff; }
.auth-aside ul { padding-left: 18px; color: #dfe4ff; font-size: 14px; }
.auth-form { padding: 46px; }
.auth-form h1 { margin-top: 0; }
.auth-form form { display: flex; flex-direction: column; gap: 16px; }
.auth-foot { margin-top: 18px; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--brand); }
.error-box { padding: 10px 12px; border-radius: 8px; background: #fff1f0; color: #b42318; font-size: 13px; }
.error-box:empty { display: none; }

/* Admin */
.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-bottom: 20px; }
.admin-tile { display: flex; flex-direction: column; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-tile strong { font-size: 30px; color: var(--brand); }
.admin-tile span { font-size: 13px; color: var(--muted); }
.admin-actions { display: flex; gap: 12px; padding-bottom: 40px; }
.admin-table-wrap { padding-bottom: 40px; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 13px; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { background: #f0f3fb; font-weight: 600; }
.admin-row-actions { display: flex; align-items: center; gap: 10px; }
.link-button { border: 0; background: transparent; color: var(--brand); cursor: pointer; padding: 0; font-size: 13px; }
.link-button.danger { color: #c4342b; }
.muted { color: var(--muted); }
.admin-form-wrap { padding-bottom: 40px; }
.admin-form-wrap form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.full-label { margin-bottom: 16px; }
.check-label { flex-direction: row !important; align-items: center; gap: 8px !important; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.admin-card h3 { margin-top: 0; }
.edit-row .input { width: 110px; }
.error-page { margin-top: 60px; text-align: center; }

/* Footer */
.site-footer { background: #0c1430; color: #c6d0f2; padding: 46px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding-bottom: 30px; }
.footer-grid h4 { color: #fff; margin: 0 0 12px; }
.footer-grid a { display: block; font-size: 13px; margin-bottom: 7px; color: #aebae8; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: #fff; }
.footer-grid p { font-size: 13px; color: #aebae8; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; font-size: 12px; color: #8b99c8; }
.footer-bottom a { color: #8b99c8; }
.footer-bottom a:hover { color: #fff; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 14px; }

@media (max-width: 1000px) {
    .main-nav { display: none; }
    .category-grid, .card-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-inner { grid-template-columns: 1fr; }
    .hero-art { display: none; }
    .catalog-layout, .detail-layout { grid-template-columns: 1fr; }
    .auth-card { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .container { width: min(100% - 24px, 1200px); }
    .header-search input { width: 110px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .category-grid, .card-grid, .admin-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .detail-hero { flex-direction: column; align-items: flex-start; }
    .form-grid { grid-template-columns: 1fr; }
    .prose { padding: 20px; }
}
