/* ============================================================
   独立软件社 - 前端样式（2026-11-08 重制）
   现代下载站风格：置顶导航 / 专区大卡 / 板块胶囊 / 卡片网格 / 详情页
   主色：绿（本站）  夸克蓝（网盘按钮）
   ============================================================ */
:root {
    --bg: #f4f7f5;
    --card: #ffffff;
    --ink: #17251f;
    --muted: #6b7f78;
    --line: #e2eae6;
    --brand: #0f9d6a;
    --brand-deep: #0b7d54;
    --brand-soft: #e6f5ee;
    --quark: #3b7cff;
    --quark-deep: #2f66d8;
    --amber: #b45309;
    --amber-soft: #fef3c7;
    --radius: 14px;
    --shadow: 0 2px 10px rgba(23, 60, 45, 0.07);
    --shadow-lift: 0 10px 24px rgba(23, 60, 45, 0.13);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
    margin: 0;
    background:
        radial-gradient(1100px 480px at 88% -120px, rgba(15, 157, 106, 0.12), transparent 60%),
        radial-gradient(900px 420px at -120px 32%, rgba(59, 124, 255, 0.09), transparent 60%),
        radial-gradient(700px 400px at 60% 110%, rgba(245, 158, 11, 0.06), transparent 60%),
        var(--bg);
    color: var(--ink); min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ===== 置顶导航 ===== */
.topnav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.nav-inner {
    max-width: 1080px; margin: 0 auto; padding: 10px 16px;
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 1.12rem; font-weight: 700; color: var(--ink); }
.brand-dot {
    width: 14px; height: 14px; border-radius: 4px; flex: none;
    background: linear-gradient(135deg, #34d399, var(--brand) 60%, var(--brand-deep));
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 7px 12px; border-radius: 9px; font-size: 0.95rem; color: var(--muted); transition: background 0.15s, color 0.15s; }
.nav-links a:hover { background: var(--brand-soft); color: var(--brand-deep); }
.nav-links a.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.nav-search { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-search-input {
    padding: 8px 14px; border: 1px solid var(--line); border-radius: 20px;
    font-size: 0.92rem; min-width: 170px; background: #fff; color: var(--ink);
    transition: border 0.15s, box-shadow 0.15s;
}
.nav-search-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 157, 106, 0.14); }
.nav-search-btn {
    padding: 8px 16px; border: none; border-radius: 20px; background: var(--brand);
    color: #fff; font-size: 0.9rem; cursor: pointer; transition: background 0.15s;
}
.nav-search-btn:hover { background: var(--brand-deep); }

/* ===== 公告滚动条 ===== */
.notice-bar { background: var(--amber-soft); border-top: 1px solid #fde68a; overflow: hidden; }
.notice-inner { display: inline-block; white-space: nowrap; padding: 6px 0; width: max-content; animation: notice-run 26s linear infinite; }
.notice-text { color: var(--amber); font-size: 0.88rem; padding-left: 100%; }
@keyframes notice-run { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ===== 页面容器 ===== */
.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px 40px; }
.hero-strip {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 18px; margin-top: 14px;
    background: linear-gradient(135deg, #ecfdf5 0%, #eaf2ff 100%);
    border: 1px solid #d8ecdf; border-radius: 14px; box-shadow: var(--shadow);
    color: var(--brand-deep); font-size: 0.98rem; font-weight: 600; text-align: center;
}
.hero-spark { color: var(--brand); }

/* ===== 自制软件专区 ===== */
.self-zone {
    margin: 16px 0 26px; padding: 20px;
    background: linear-gradient(150deg, #ecfdf5 0%, #f0fdf9 55%, #ffffff 100%);
    border: 1px solid #d5f0e3; border-radius: 18px;
    box-shadow: var(--shadow);
}
.zone-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.zone-title { margin: 0; font-size: 1.25rem; display: inline-flex; align-items: center; gap: 8px; }
.zone-flag { font-size: 1.1rem; }
.zone-chip {
    font-size: 0.78rem; padding: 3px 10px; border-radius: 20px;
    background: var(--brand); color: #fff; letter-spacing: 1px;
}
.self-empty { padding: 26px; text-align: center; color: var(--muted); background: rgba(255,255,255,0.65); border: 1px dashed #bfe4d3; border-radius: 12px; }
.self-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.self-card {
    display: flex; align-items: center; gap: 12px; padding: 14px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}
.self-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: #bfe4d3; }
.self-icon {
    width: 52px; height: 52px; flex: none; display: flex; align-items: center; justify-content: center;
    border-radius: 12px; background: var(--brand-soft); font-size: 1.5rem; overflow: hidden;
}
.self-icon img { width: 100%; height: 100%; object-fit: cover; }
.self-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.self-name { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.self-desc { color: var(--muted); font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.self-go { margin-left: auto; flex: none; color: var(--brand-deep); font-size: 0.9rem; font-weight: 600; }

/* ===== 工具栏：分类胶囊 + 排序 ===== */
.toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pills-more { width: 100%; }
.pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
    border-radius: 20px; background: #fff; border: 1px solid var(--line);
    font-size: 0.92rem; color: var(--ink); transition: all 0.15s;
}
.pill:hover { border-color: var(--brand); color: var(--brand-deep); }
.pill.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pill-count { font-size: 0.78rem; opacity: 0.75; }
.pill-more { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 0.88rem; padding: 7px 6px; }
.pill-more:hover { color: var(--brand-deep); }
.sortswitch { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 3px; flex: none; }
.sort-btn { padding: 5px 16px; border-radius: 16px; font-size: 0.88rem; color: var(--muted); transition: all 0.15s; }
.sort-btn.active { background: var(--brand); color: #fff; font-weight: 600; }

/* ===== 软件卡片网格 ===== */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px;
    transition: transform 0.16s, box-shadow 0.16s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card-link { display: flex; flex-direction: column; gap: 10px; }
.card-top { display: flex; align-items: center; gap: 12px; }
.card-icon {
    width: 52px; height: 52px; flex: none; display: flex; align-items: center; justify-content: center;
    border-radius: 12px; background: var(--brand-soft); overflow: hidden;
}
.card-icon img { width: 100%; height: 100%; object-fit: cover; }
.icon-ph { font-size: 1.5rem; }
.card-titlebox { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.card-name { font-weight: 700; font-size: 1.02rem; word-break: break-all; }
.ver-chip {
    font-style: normal; font-size: 0.72rem; padding: 1px 7px; border-radius: 10px;
    background: #eef2ff; color: #4f6bdf; border: 1px solid #dbe3ff; flex: none;
}
.self-chip {
    font-style: normal; font-size: 0.72rem; padding: 1px 7px; border-radius: 10px;
    background: #fff4e5; color: #c2660b; border: 1px solid #ffe0b8; flex: none;
}
.card-desc { color: var(--muted); font-size: 0.88rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 0.82rem; }
.meta-badge { font-style: normal; font-size: 0.75rem; padding: 2px 9px; border-radius: 12px; }
.meta-badge.quark { background: #eaf1ff; color: var(--quark-deep); }
.meta-badge.local { background: #f0f3f1; color: var(--muted); }
.card-actions { display: flex; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 15px; border-radius: 10px; font-size: 0.9rem; font-weight: 600;
    border: 1px solid transparent; cursor: pointer; transition: all 0.15s; text-align: center;
}
.btn-quark { background: var(--quark); color: #fff; }
.btn-quark:hover { background: var(--quark-deep); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }
.btn-disabled { background: #f0f3f1; color: #9aaba4; cursor: not-allowed; }

/* ===== 空状态 / 分页 ===== */
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.pagebar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.page-info { color: var(--muted); font-size: 0.88rem; }
.page-ctrl { display: flex; gap: 8px; }
.page-btn { padding: 8px 16px; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 0.9rem; color: var(--ink); transition: all 0.15s; }
.page-btn:hover { border-color: var(--brand); color: var(--brand-deep); }

/* ===== 详情页 ===== */
.crumbs { color: var(--muted); font-size: 0.88rem; margin: 4px 0 14px; }
.crumbs a { color: var(--brand-deep); }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { margin: 0 7px; color: #c3d0cb; }
.detail-hero {
    display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px;
    box-shadow: var(--shadow); padding: 26px; margin-bottom: 16px;
}
.d-icon {
    width: 92px; height: 92px; flex: none; display: flex; align-items: center; justify-content: center;
    border-radius: 20px; background: var(--brand-soft); font-size: 2.6rem; overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(15,157,106,0.12);
}
.d-icon img { width: 100%; height: 100%; object-fit: cover; }
.d-main { min-width: 0; flex: 1; }
.d-title { margin: 0 0 10px; font-size: 1.5rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.d-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 0.8rem; padding: 3px 11px; border-radius: 14px; background: #f0f3f1; color: var(--muted); }
.chip.brand { background: var(--brand-soft); color: var(--brand-deep); }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.btn-big { padding: 12px 26px; font-size: 1rem; border-radius: 12px; }
.copy-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px;
    border: 1px dashed #b9c8f5; border-radius: 12px; background: #f5f8ff;
    color: var(--quark-deep); font-size: 0.92rem; cursor: pointer; transition: all 0.15s;
}
.copy-chip:hover { background: #eaf1ff; }
.d-section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 14px; }
.d-section h2 { margin: 0 0 12px; font-size: 1.1rem; color: var(--brand-deep); }
.d-desc { color: var(--ink); line-height: 1.9; font-size: 0.96rem; word-break: break-word; }
.d-desc .placeholder { color: var(--muted); }
.tip-card { background: #f5f8ff; border: 1px solid #dbe6ff; border-radius: var(--radius); padding: 16px 20px; color: #3b5ab4; font-size: 0.88rem; line-height: 1.8; }
.tip-card b { color: var(--quark-deep); }

/* ===== 页脚 ===== */
.site-foot {
    border-top: 3px solid;
    border-image: linear-gradient(90deg, #34d399, #3b7cff, #f59e0b) 1;
    background: #fff; margin-top: 30px;
}
.site-foot p { max-width: 1080px; margin: 0 auto; padding: 18px 16px; text-align: center; color: var(--muted); font-size: 0.86rem; }

/* ===== 回到顶部 ===== */
.to-top {
    position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px;
    border-radius: 50%; background: var(--brand); color: #fff;
    display: none; align-items: center; justify-content: center;
    font-size: 1.15rem; font-weight: 700; box-shadow: var(--shadow-lift);
    z-index: 60; transition: background 0.15s, transform 0.15s;
}
.to-top:hover { background: var(--brand-deep); transform: translateY(-2px); }

/* ===== 响应式 ===== */
@media (max-width: 760px) {
    .nav-inner { gap: 10px; }
    .nav-search { margin-left: 0; width: 100%; }
    .nav-search-input { flex: 1; min-width: 0; }
    .wrap { padding: 14px 12px 30px; }
    .self-zone { padding: 16px 14px; }
    .self-cards { grid-template-columns: 1fr; }
    .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .toolbar { flex-direction: column; }
    .detail-hero { padding: 18px; }
}
@media (max-width: 460px) {
    .grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}

/* ============================================================
   磁贴墙（Win8 Metro 风格主页）
   块多 → 列多块小（自动缩块）；列封顶 6；再多的行自然下滚
   ============================================================ */
.tilewall {
    display: grid;
    grid-template-columns: repeat(var(--cols, 4), 1fr);
    grid-auto-rows: calc((min(1080px, 100vw) - 32px - (var(--cols, 4) - 1) * 10px) / var(--cols, 4));
    grid-auto-flow: dense;
    gap: 10px;
    margin-top: 14px;
}
.tile {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; border-radius: 16px; padding: 12px; color: #fff; overflow: hidden;
    box-shadow: 0 4px 14px rgba(23, 60, 45, 0.14);
    transition: transform 0.18s, box-shadow 0.18s;
}
.tile:hover { transform: scale(1.035); box-shadow: 0 14px 30px rgba(15, 157, 106, 0.32); z-index: 2; }
.tile:active { transform: scale(0.99); }
.tile { animation: tile-in 0.5s ease both; }
.tile:nth-child(2n) { animation-delay: 0.06s; }
.tile:nth-child(3n) { animation-delay: 0.12s; }
.tile:nth-child(5n) { animation-delay: 0.18s; }
@keyframes tile-in { from { opacity: 0; transform: scale(0.9); } }
.t11 { }
.t21 { grid-column: span 2; }
.t12 { grid-row: span 2; }
.t22 { grid-column: span 2; grid-row: span 2; }
/* 六色轮换色板 */
.c1 { background: linear-gradient(135deg, #10b981, #0b7d54); }
.c2 { background: linear-gradient(135deg, #4f8cff, #2f66d8); }
.c3 { background: linear-gradient(135deg, #fbbf24, #d97706); }
.c4 { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.c5 { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.c6 { background: linear-gradient(135deg, #fb7185, #e11d48); }
.tile-icon {
    width: 34%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    border-radius: 18px; background: rgba(255, 255, 255, 0.2); font-size: 2rem; overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.t22 .tile-icon { width: 30%; font-size: 2.8rem; }
.tile-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.tile-name { font-weight: 700; font-size: clamp(0.9rem, 1.4vw, 1.15rem); text-align: center; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-ver { display: block; font-size: 0.78rem; opacity: 0.85; text-align: center; font-weight: 400; }
.ghost { background: rgba(255, 255, 255, 0.45); border: 2px dashed #c8d6d0; box-shadow: none; cursor: default; }
.ghost:hover { transform: none; box-shadow: none; }
.ghost-txt { color: #9aaba4; font-size: 0.88rem; }
.entry {
    background: linear-gradient(135deg, #17251f, #0b3d2e);
    border: 2px solid #2e5c4a;
}
.entry:hover { border-color: #34d399; }
.entry-big { font-size: 1.4rem; line-height: 1; }
.entry-txt { font-weight: 800; font-size: 1.05rem; letter-spacing: 1px; }
.entry-sub { font-size: 0.78rem; opacity: 0.75; text-align: center; }
.wall-hint { color: var(--muted); font-size: 0.78rem; text-align: right; margin-top: 10px; }

/* ===== 公共软件区横幅 ===== */
.softs-banner {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    background: linear-gradient(135deg, #17251f 0%, #0b3d2e 70%, #0f9d6a 130%);
    color: #fff; border-radius: 18px; padding: 22px 26px; margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.softs-title { margin: 0; font-size: 1.4rem; }
.softs-sub { margin: 4px 0 0; opacity: 0.8; font-size: 0.92rem; }
.softs-badge { background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.35); padding: 5px 14px; border-radius: 20px; font-size: 0.82rem; letter-spacing: 1px; }
@media (max-width: 760px) {
    .tilewall { --cols: 2 !important; gap: 8px; grid-auto-rows: calc((100vw - 40px) / 2); }
}
