/* 模仿今日热榜的浅色卡片流布局：顶部导航 + 三列榜单卡片 */
:root {
    --bg: #f4f5f7;
    --card: #fff;
    --line: #ebedf0;
    --text: #2f3542;
    --muted: #8b95a5;
    --brand: #d81e06;
    --link: #263238;
    --rank-1: #fe2d19;
    --rank-2: #ff8400;
    --rank-3: #fbb034;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--brand); }
code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; background: #f0f1f3; padding: 1px 5px; border-radius: 3px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---------- 头部 ---------- */
.hd { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.hd-in { display: flex; align-items: center; gap: 18px; height: 58px; flex-wrap: wrap; }
.logo { font-size: 20px; font-weight: 700; color: var(--brand); letter-spacing: .5px; white-space: nowrap; }
.logo-sub { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; flex: 1; }
.nav a { padding: 6px 10px; border-radius: 16px; white-space: nowrap; color: #4b5563; }
.nav a em { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 3px; }
.nav a:hover, .nav a.on { background: #fff1f0; color: var(--brand); }
.search { display: flex; }
.search input { border: 1px solid var(--line); border-right: 0; border-radius: 4px 0 0 4px; padding: 6px 10px; width: 170px; font-size: 13px; outline: none; }
.search input:focus { border-color: var(--brand); }
.search button { border: 1px solid var(--brand); background: var(--brand); color: #fff; border-radius: 0 4px 4px 0; padding: 6px 12px; cursor: pointer; font-size: 13px; }

/* ---------- 说明条 ---------- */
main.wrap { padding-top: 18px; }
.intro { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; box-shadow: var(--shadow); }
.intro h1 { margin: 0 0 6px; font-size: 19px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.meta b { color: var(--text); font-weight: 600; }
.meta .tip { color: #a45; }
.note { color: var(--muted); background: #fafafa; border-left: 3px solid var(--line); padding: 8px 12px; margin: 12px 0 0; }

/* ---------- 分组 + 卡片网格 ---------- */
.grp { margin-bottom: 26px; }
.grp-t { font-size: 15px; margin: 0 0 10px; padding-left: 9px; border-left: 3px solid var(--brand); line-height: 1.3; }
.grp-t span { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } .hd-in { height: auto; padding: 10px 0; } }

.cd { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.cd-bad { border-color: #ffd6d2; }
.cd-h { display: flex; align-items: center; gap: 7px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.cd-site { display: flex; align-items: center; gap: 7px; min-width: 0; }
.cd-ic { position: relative; width: 20px; height: 20px; flex: 0 0 20px; display: inline-flex; }
.cd-ic b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #eceff3; color: #6b7280; border-radius: 4px; font-size: 11px; font-weight: 600; }
.cd-ic img { position: relative; width: 20px; height: 20px; border-radius: 4px; object-fit: cover; }
.cd-nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-bd { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-tm { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }

.cd-b { list-style: none; margin: 0; padding: 4px 0; flex: 1; }
.cd-b .i { display: flex; align-items: baseline; gap: 8px; padding: 6px 13px; }
.cd-b .i:hover { background: #fafbfc; }
.i-r { flex: 0 0 18px; text-align: center; font-size: 13px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.i.top .i-r { color: #fff; background: var(--rank-3); border-radius: 3px; }
.i:nth-child(1) .i-r { background: var(--rank-1); color: #fff; border-radius: 3px; }
.i:nth-child(2) .i-r { background: var(--rank-2); color: #fff; border-radius: 3px; }
.i-t { flex: 1; min-width: 0; color: var(--link); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.i-t:hover { color: var(--brand); }
.i-l { flex: 0 0 auto; font-size: 10px; color: #fff; background: var(--brand); border-radius: 2px; padding: 0 3px; }
.i-h { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.cd-empty { padding: 22px 13px; color: var(--muted); text-align: center; list-style: none; }
.cd-f { display: flex; align-items: center; justify-content: space-between; padding: 8px 13px; border-top: 1px solid var(--line); font-size: 12px; background: #fcfcfd; }
.cd-f small { color: var(--muted); }
.cd-src { color: #b6bcc6; font-size: 11px; }

/* ---------- 详情页 ---------- */
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.nh { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.nh h1 { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 20px; }
.nh h1 small { font-size: 13px; font-weight: 400; color: var(--muted); }
.nh-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 18px; margin: 0; padding: 0; list-style: none; }
.nh-meta span { color: var(--muted); margin-right: 6px; }
.nh-err { color: var(--brand); font-size: 12px; margin: 10px 0 0; }
.nh-ops { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.btn { display: inline-block; border: 1px solid var(--line); background: #fff; color: #4b5563; border-radius: 4px; padding: 6px 13px; font-size: 13px; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-main { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-main:hover { color: #fff; opacity: .88; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chips a { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px 11px; font-size: 12px; }
.chips a em { font-style: normal; color: var(--muted); margin-left: 4px; }
.chips a:hover { border-color: var(--brand); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 16px 14px; margin-bottom: 16px; overflow-x: auto; }
.panel-t { font-size: 15px; margin: 14px 0 10px; }
.how { margin: 0; padding-left: 20px; color: #4b5563; }
.how li { margin-bottom: 6px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 9px 8px; border-bottom: 1px solid #f2f3f5; text-align: left; vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 500; background: #fafbfc; position: sticky; top: 58px; }
.tbl tr:hover td { background: #fafbfc; }
.tbl .w-r { width: 42px; text-align: center; }
.tbl .w-h { width: 96px; color: var(--muted); white-space: nowrap; }
.tbl .w-n { width: 76px; text-align: center; color: var(--muted); }
.tbl .w-d { width: 92px; color: var(--muted); white-space: nowrap; }
.tbl code { word-break: break-all; }
.err-row td { color: var(--brand); font-size: 12px; background: #fffafa; }
.rk { display: inline-block; min-width: 22px; text-align: center; color: var(--muted); font-weight: 600; }
.rk-top { color: #fff; background: var(--rank-1); border-radius: 3px; }
.ttl { display: block; max-width: 640px; }
.sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.lab { display: inline-block; font-size: 10px; color: #fff; background: var(--brand); border-radius: 2px; padding: 0 4px; margin-top: 4px; }
.ok { color: #12b76a; }
.bad { color: var(--brand); }
.srcs { margin: 0; padding-left: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; color: #4b5563; }

.blank, .install, .err { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin: 20px 0; }
.install ol { padding-left: 20px; line-height: 2; }

/* ---------- 页脚 ---------- */
.ft { margin: 30px 0 24px; color: var(--muted); font-size: 12px; text-align: center; }
.ft p { margin: 4px 0; }
