/* ==========================================================
   个人导航 · 前台样式（4 套布局模板）
   模板：清爽列表 blog / 缤纷磁贴 tiles / 极简留白 minimal / 卡片瀑布 cards
   每套模板 = 独立布局 + 独立配色，切换后整页结构随之变化
   ========================================================== */

:root {
    --radius: 12px;
    --max-w: 720px;
    --max-w-wide: 900px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC",
                 "Microsoft YaHei", sans-serif;
    --font-serif: Georgia, "Times New Roman", "Songti SC", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    line-height: 1.6;
    transition: background .3s, color .3s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
a { color: inherit; text-decoration: none; }

/* 搜索关键词高亮（浅色/深色通用） */
mark {
    background: linear-gradient(transparent 55%, rgba(251,191,36,.45) 55%);
    color: inherit; border-radius: 2px; padding: 0 1px;
}
body.dark mark { background: linear-gradient(transparent 55%, rgba(251,191,36,.35) 55%); }

/* ==========================================================
   模板一：清爽列表（blog）—— 默认，米白 + 琥珀
   ========================================================== */
body[data-template="blog"] {
    --bg: #fafaf9;
    --bg-soft: #ffffff;
    --ink: #292524;
    --ink-soft: #78716c;
    --ink-faint: #a8a29e;
    --line: #e7e5e4;
    --accent: #b45309;
    --accent-soft: #fdeee0;
    --card: #ffffff;
    --header-bg: linear-gradient(180deg, #fff7ed, transparent);
}
body[data-template="blog"] { background: var(--bg); color: var(--ink); }
body[data-template="blog"] .site-header { background: var(--header-bg); padding: 48px 0 12px; }
body[data-template="blog"] .site-title { font-family: var(--font-sans); font-size: 32px; font-weight: 800; letter-spacing: .5px; }
body[data-template="blog"] .site-sub { font-family: var(--font-sans); font-size: 14px; margin-top: 5px; color: var(--ink-soft); }
body[data-template="blog"] .search-box input { padding: 12px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); font-size: 15px; outline: none; transition: all .2s; }
body[data-template="blog"] .search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body[data-template="blog"] .cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 22px 0 4px; scrollbar-width: none; }
body[data-template="blog"] .cat-tabs::-webkit-scrollbar { display: none; }
body[data-template="blog"] .cat-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
body[data-template="blog"] .cat-tab .ic { width: 15px; height: 15px; border-radius: 4px; font-size: 9px; }
body[data-template="blog"] .cat-tab.active { border-color: var(--accent); background: var(--accent); color: #fff; }
body[data-template="blog"] .section-title { font-family: var(--font-sans); font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 10px; padding: 28px 0 14px; color: var(--ink); }
body[data-template="blog"] .section-title .ic { width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }
body[data-template="blog"] .section-title .count { font-size: 13px; font-weight: 400; color: var(--ink-faint); font-family: var(--font-sans); }
body[data-template="blog"] .link-list { list-style: none; }
body[data-template="blog"] .link-item { border-bottom: 1px dashed var(--line); }
body[data-template="blog"] .link-item:last-child { border-bottom: none; }
body[data-template="blog"] .link-row { display: flex; align-items: center; gap: 14px; padding: 13px 6px; transition: all .18s; }
body[data-template="blog"] a.link-row:hover { background: var(--accent-soft); padding-left: 14px; border-radius: var(--radius); }
body[data-template="blog"] .link-main { flex: 1; min-width: 0; }
body[data-template="blog"] .link-name { font-size: 15px; font-weight: 500; color: var(--ink); line-height: 1.4; }
body[data-template="blog"] .link-desc { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
body[data-template="blog"] .link-meta { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
body[data-template="blog"] .link-arrow { color: var(--ink-faint); font-size: 14px; transition: all .2s; flex: 0 0 auto; }
body[data-template="blog"] a.link-row:hover .link-arrow { color: var(--accent); transform: translateX(3px); }
body[data-template="blog"] .link-row.off { opacity: .45; cursor: not-allowed; }
body[data-template="blog"] .link-row.off:hover { background: transparent; padding-left: 6px; }
body[data-template="blog"] .link-row .ic { width: 38px; height: 38px; border-radius: 10px; font-size: 12px; flex: 0 0 auto; }

/* ==========================================================
   模板二：缤纷磁贴（tiles）—— 浅蓝底，彩色大图标网格
   ========================================================== */
body[data-template="tiles"] {
    --bg: #f0f9ff;
    --bg-soft: #ffffff;
    --ink: #0f172a;
    --ink-soft: #64748b;
    --ink-faint: #94a3b8;
    --line: #e0f2fe;
    --accent: #0284c7;
    --accent-soft: #e0f2fe;
    --card: #ffffff;
    --header-bg: linear-gradient(180deg, #e0f2fe, transparent);
}
body[data-template="tiles"] { background: var(--bg); color: var(--ink); }
body[data-template="tiles"] .container { max-width: var(--max-w-wide); }
body[data-template="tiles"] .site-header { background: var(--header-bg); padding: 48px 0 12px; }
body[data-template="tiles"] .site-title { font-size: 30px; font-weight: 800; letter-spacing: .5px; }
body[data-template="tiles"] .site-sub { font-size: 14px; margin-top: 3px; color: var(--ink-soft); }
body[data-template="tiles"] .search-box input { padding: 13px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); font-size: 15px; outline: none; box-shadow: 0 2px 10px rgba(2,132,199,.06); }
body[data-template="tiles"] .search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body[data-template="tiles"] .cat-tabs { display: flex; gap: 10px; overflow-x: auto; padding: 22px 0 4px; scrollbar-width: none; }
body[data-template="tiles"] .cat-tabs::-webkit-scrollbar { display: none; }
body[data-template="tiles"] .cat-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 12px; background: var(--bg-soft); color: var(--ink-soft); font-size: 13.5px; font-weight: 500; box-shadow: 0 1px 4px rgba(2,132,199,.08); white-space: nowrap; }
body[data-template="tiles"] .cat-tab .ic { width: 18px; height: 18px; border-radius: 6px; font-size: 10px; }
body[data-template="tiles"] .cat-tab.active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(2,132,199,.35); }
body[data-template="tiles"] .section-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 9px; padding: 26px 0 14px; color: var(--ink); }
body[data-template="tiles"] .section-title .ic { width: 24px; height: 24px; border-radius: 8px; font-size: 13px; }
body[data-template="tiles"] .section-title .count { font-size: 12.5px; font-weight: 500; color: var(--ink-faint); background: var(--bg-soft); padding: 1px 9px; border-radius: 10px; }
body[data-template="tiles"] .link-list { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
body[data-template="tiles"] .link-item { position: relative; }
body[data-template="tiles"] .link-row {
    display: grid; position: relative;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "name name"
        "ic desc";
    align-items: center; column-gap: 10px; row-gap: 8px;
    text-align: left;
    background: var(--card); border-radius: 18px; padding: 16px 12px 14px;
    box-shadow: 0 2px 10px rgba(2,132,199,.07);
    transition: all .2s; height: 100%;
}
body[data-template="tiles"] a.link-row:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(2,132,199,.16); }
body[data-template="tiles"] .link-row .ic { grid-area: ic; justify-self: center; width: 48px; height: 48px; border-radius: 50%; font-size: 16px; }
body[data-template="tiles"] .link-main { display: contents; }
body[data-template="tiles"] .link-name {
    grid-area: name; font-size: 13.5px; font-weight: 600; color: var(--ink);
    line-height: 1.35; text-align: center; width: 100%; padding: 0 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; word-break: break-all;
}
body[data-template="tiles"] .link-desc {
    grid-area: desc; font-size: 11px; color: var(--ink-faint);
    line-height: 1.45; min-width: 0; padding-right: 18px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; word-break: break-all;
}
body[data-template="tiles"] .link-meta { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
/* 进入箭头：右下角 */
body[data-template="tiles"] .link-arrow {
    position: absolute; right: 10px; top: 50%;
    transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-faint); font-size: 13px; transition: all .15s;
}
body[data-template="tiles"] a.link-row:hover .link-arrow { color: var(--accent); }
body[data-template="tiles"] .link-row.off { opacity: .4; }
body[data-template="tiles"] a.link-row.off:hover { transform: none; box-shadow: 0 2px 10px rgba(2,132,199,.07); }

/* ==========================================================
   模板三：极简留白（minimal）—— 纯白，黑白灰，超简洁
   ========================================================== */
body[data-template="minimal"] {
    --bg: #ffffff;
    --bg-soft: #ffffff;
    --ink: #18181b;
    --ink-soft: #71717a;
    --ink-faint: #a1a1aa;
    --line: #f0f0f1;
    --accent: #111111;
    --accent-soft: #f4f4f5;
    --card: #ffffff;
    --header-bg: none;
}
body[data-template="minimal"] { background: var(--bg); color: var(--ink); }
body[data-template="minimal"] .site-header { background: var(--header-bg); padding: 48px 0 12px; }
body[data-template="minimal"] .site-title { font-weight: 700; font-size: 30px; letter-spacing: -1px; }
body[data-template="minimal"] .site-sub { font-size: 14px; margin-top: 6px; color: var(--ink-faint); }
body[data-template="minimal"] .search-box { margin-top: 40px; }
body[data-template="minimal"] .search-box input { border: none; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: 16px; padding: 8px 2px; outline: none; color: var(--ink); }
body[data-template="minimal"] .search-box input:focus { border-bottom-color: var(--ink); }
body[data-template="minimal"] .cat-tabs { display: flex; gap: 24px; overflow-x: auto; padding: 30px 0 6px; scrollbar-width: none; }
body[data-template="minimal"] .cat-tabs::-webkit-scrollbar { display: none; }
body[data-template="minimal"] .cat-tab { flex: 0 0 auto; font-size: 14px; color: var(--ink-faint); padding: 4px 0; border-bottom: 2px solid transparent; white-space: nowrap; transition: all .15s; }
body[data-template="minimal"] .cat-tab .ic { display: none; }
body[data-template="minimal"] .cat-tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
body[data-template="minimal"] .cat-tab .count { background: none; padding: 0; min-width: 0; margin-left: 4px; }
body[data-template="minimal"] .section-title { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--ink-faint); display: flex; align-items: center; gap: 12px; padding: 34px 0 6px; }
body[data-template="minimal"] .section-title .ic { display: none; }
body[data-template="minimal"] .section-title .count { font-size: 11px; color: var(--ink-faint); font-weight: 400; letter-spacing: 0; }
body[data-template="minimal"] .link-list { list-style: none; }
body[data-template="minimal"] .link-item { border-bottom: none; }
body[data-template="minimal"] .link-row { display: flex; align-items: center; gap: 14px; padding: 13px 2px; transition: background .15s; }
body[data-template="minimal"] a.link-row:hover { background: var(--accent-soft); border-radius: 8px; padding-left: 12px; }
body[data-template="minimal"] .link-row .ic { width: 28px; height: 28px; border-radius: 8px; font-size: 10px; flex: 0 0 auto; }
body[data-template="minimal"] .link-main { flex: 1; min-width: 0; }
body[data-template="minimal"] .link-name { font-size: 15px; font-weight: 500; color: var(--ink); }
body[data-template="minimal"] .link-desc { display: none; }
body[data-template="minimal"] .link-meta { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
body[data-template="minimal"] .link-arrow { color: var(--ink-faint); font-size: 14px; flex: 0 0 auto; }
body[data-template="minimal"] a.link-row:hover .link-arrow { color: var(--ink); }
body[data-template="minimal"] .link-row.off { opacity: .35; }
body[data-template="minimal"] .link-row.off:hover { background: transparent; padding-left: 2px; }

/* ==========================================================
   模板四：卡片瀑布（cards）—— 暖灰底，双列卡片
   ========================================================== */
body[data-template="cards"] {
    --bg: #ffffff;
    --bg-soft: #ffffff;
    --ink: #1c1917;
    --ink-soft: #78716c;
    --ink-faint: #a8a29e;
    --line: #e7e5e4;
    --accent: #ea580c;
    --accent-soft: #ffedd5;
    --card: #ffffff;
    --header-bg: linear-gradient(180deg, #fff7ed, transparent);
}
body[data-template="cards"] { background: var(--bg); color: var(--ink); }
body[data-template="cards"] .container { max-width: var(--max-w-wide); }
body[data-template="cards"] .site-header { background: var(--header-bg); padding: 48px 0 12px; }
body[data-template="cards"] .site-title { font-family: var(--font-serif); font-size: 30px; font-weight: 700; }
body[data-template="cards"] .site-sub { font-family: var(--font-serif); font-style: italic; font-size: 14px; margin-top: 3px; color: var(--ink-soft); }
body[data-template="cards"] .search-box input { padding: 13px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); font-size: 15px; outline: none; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
body[data-template="cards"] .search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body[data-template="cards"] .cat-tabs { display: flex; gap: 9px; overflow-x: auto; padding: 22px 0 4px; scrollbar-width: none; }
body[data-template="cards"] .cat-tabs::-webkit-scrollbar { display: none; }
body[data-template="cards"] .cat-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
body[data-template="cards"] .cat-tab .ic { width: 16px; height: 16px; border-radius: 5px; font-size: 9px; }
body[data-template="cards"] .cat-tab.active { border-color: var(--accent); background: var(--accent); color: #fff; }
body[data-template="cards"] .section-title { font-family: var(--font-sans); font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 10px; padding: 28px 0 14px; color: var(--ink); }
body[data-template="cards"] .section-title .ic { width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }
body[data-template="cards"] .section-title .count { font-size: 12.5px; font-weight: 400; color: var(--ink-faint); font-family: var(--font-sans); }
body[data-template="cards"] .link-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; align-items: stretch; }
body[data-template="cards"] .link-item { height: 100%; }
body[data-template="cards"] .link-row {
    display: flex; align-items: center; gap: 12px;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    padding: 14px 16px; height: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    transition: all .18s;
}
body[data-template="cards"] a.link-row:hover { border-color: var(--accent); box-shadow: 0 6px 16px rgba(234,88,12,.1); transform: translateY(-2px); }
body[data-template="cards"] .link-row .ic { width: 42px; height: 42px; border-radius: 12px; font-size: 13px; flex: 0 0 auto; }
body[data-template="cards"] .link-main { flex: 1; min-width: 0; }
body[data-template="cards"] .link-name { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; }
body[data-template="cards"] .link-desc {
    font-size: 12px; color: var(--ink-faint); margin-top: 3px; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
body[data-template="cards"] .link-meta { flex: 0 0 auto; display: flex; gap: 5px; align-items: center; }
body[data-template="cards"] .link-arrow { color: var(--ink-faint); font-size: 14px; flex: 0 0 auto; }
body[data-template="cards"] a.link-row:hover .link-arrow { color: var(--accent); }
body[data-template="cards"] .link-row.off { opacity: .45; }
body[data-template="cards"] a.link-row.off:hover { transform: none; box-shadow: none; border-color: var(--line); }

/* ==========================================================
   模板五：黑客终端（hacker）—— 黑色优雅，香槟金点缀
   ========================================================== */
body[data-template="hacker"] {
    --bg: #0b0b0f;
    --bg-soft: #131318;
    --ink: #f2f2f2;
    --ink-soft: rgba(242,242,242,.62);
    --ink-faint: rgba(242,242,242,.38);
    --line: rgba(242,242,242,.12);
    --accent: #d4b483;
    --accent-soft: rgba(212,180,131,.10);
    --card: #131318;
    --header-bg: none;
}
body[data-template="hacker"] { background: var(--bg); color: var(--ink); }
/* 顶部柔光晕（香槟金，优雅氛围） */
body[data-template="hacker"]::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(560px 300px at 50% -40px, rgba(212,180,131,.09), transparent 70%),
        radial-gradient(420px 260px at 88% 94%, rgba(212,180,131,.05), transparent 70%);
}
body[data-template="hacker"] .site-header, body[data-template="hacker"] main, body[data-template="hacker"] .site-footer { position: relative; z-index: 1; }

/* 顶部：居中大标题 + 右上角功能按钮，简单大气 */
body[data-template="hacker"] .site-header { padding: 48px 0 12px; }
body[data-template="hacker"] .site-header .container { position: relative; background: none; border: none; box-shadow: none; padding: 0; }
body[data-template="hacker"] .header-inner { text-align: center; padding-bottom: 8px; }
body[data-template="hacker"] .header-nav {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 6px; margin-top: 0; padding: 0;
    background: none; border: none;
}
body[data-template="hacker"] .site-title {
    font-size: 30px; font-weight: 700; color: var(--ink);
    letter-spacing: 1px; text-shadow: none; line-height: 1.3;
}
body[data-template="hacker"] .site-title::before { content: none; }
body[data-template="hacker"] .site-sub { font-size: 14px; margin-top: 10px; color: var(--ink-soft); letter-spacing: .5px; }
/* 标题下方细渐变分隔线 */
body[data-template="hacker"] .brand::after {
    content: ""; display: block; width: 56px; height: 2px; margin: 10px auto 0;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 2px; opacity: .55;
}
/* 搜索框 */
body[data-template="hacker"] .search-box { margin-top: 26px; }
body[data-template="hacker"] .search-box input {
    background: var(--bg-soft); border: 1px solid var(--line);
    border-radius: 12px; font-size: 14.5px;
    color: var(--ink); padding: 12px 16px;
}
body[data-template="hacker"] .search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body[data-template="hacker"] .search-box input::placeholder { color: var(--ink-faint); }

/* 分类导航：清爽圆角标签 */
body[data-template="hacker"] .cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 24px 0 4px; scrollbar-width: none; }
body[data-template="hacker"] .cat-tabs::-webkit-scrollbar { display: none; }
body[data-template="hacker"] .cat-tab {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; padding: 8px 15px;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--bg-soft); color: var(--ink-soft); white-space: nowrap;
}
body[data-template="hacker"] .cat-tab::before { content: none; }
body[data-template="hacker"] .cat-tab .ic { width: 16px; height: 16px; border-radius: 5px; font-size: 9px; }
body[data-template="hacker"] .cat-tab.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
/* 区块标题：左侧绿色短竖条 */
body[data-template="hacker"] .section-title {
    font-size: 15px; font-weight: 700; letter-spacing: .5px;
    color: var(--ink); text-transform: none;
    display: flex; align-items: center; gap: 10px; padding: 28px 0 12px;
}
.recent-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0;
}
.recent-head .section-title { padding: 0; margin: 0; }
.recent-head .header-nav { flex: 0 0 auto; }
body[data-template="hacker"] .section-title::before {
    content: ""; width: 4px; height: 16px; border-radius: 3px;
    background: var(--accent); opacity: .8;
}
body[data-template="hacker"] .section-title .ic { width: 22px; height: 22px; border-radius: 7px; font-size: 11px; }
body[data-template="hacker"] .section-title .count { font-size: 11.5px; color: var(--ink-faint); font-weight: 400; }

/* 链接列表：清爽分隔线 + 柔和 hover */
body[data-template="hacker"] .link-list { list-style: none; }
body[data-template="hacker"] .link-item { border-bottom: 1px solid var(--line); }
body[data-template="hacker"] .link-item:last-child { border-bottom: none; }
body[data-template="hacker"] .link-row {
    display: flex; align-items: center; gap: 13px;
    padding: 12px 6px; border-radius: 10px; transition: all .18s;
}
body[data-template="hacker"] a.link-row:hover { background: var(--accent-soft); padding-left: 14px; }
body[data-template="hacker"] a.link-row:hover .link-name { color: var(--accent); }
body[data-template="hacker"] .link-row .ic { width: 34px; height: 34px; border-radius: 9px; font-size: 11px; flex: 0 0 auto; }
body[data-template="hacker"] .link-main { flex: 1; min-width: 0; }
body[data-template="hacker"] .link-name { font-size: 14.5px; font-weight: 600; color: var(--ink); transition: color .15s; }
body[data-template="hacker"] .link-desc { font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
body[data-template="hacker"] .link-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
body[data-template="hacker"] .link-arrow { color: var(--ink-faint); font-size: 14px; flex: 0 0 auto; transition: all .15s; }
body[data-template="hacker"] a.link-row:hover .link-arrow { color: var(--accent); transform: translateX(3px); }
body[data-template="hacker"] .link-row.off { opacity: .32; }
body[data-template="hacker"] .link-row.off:hover { background: transparent; padding-left: 6px; }
body[data-template="hacker"] .state-badge.maint { background: rgba(251,191,36,.14); color: #fbbf24; }
body[data-template="hacker"] .state-badge.full { background: rgba(248,113,113,.14); color: #f87171; }
body[data-template="hacker"] .state-badge.off { background: rgba(255,255,255,.08); color: #6b7280; }
body[data-template="hacker"] .site-footer { border-top: 1px solid var(--line); color: var(--ink-faint); }
body[data-template="hacker"] .site-footer a:hover { color: var(--accent); }

/* ==========================================================
   模板六：玻璃星云（glass）—— 磨砂玻璃，渐变紫蓝
   ========================================================== */
body[data-template="glass"] {
    --bg: #17162e;
    --bg-soft: rgba(255,255,255,.07);
    --ink: #f5f3ff;
    --ink-soft: #cdc6ff;
    --ink-faint: #8d87b8;
    --line: rgba(255,255,255,.18);
    --accent: #a78bfa;
    --accent-soft: rgba(167,139,250,.14);
    --card: rgba(255,255,255,.08);
    --header-bg: none;
}
body[data-template="glass"] {
    background: linear-gradient(135deg, #17162e 0%, #231d4e 45%, #3b2f7a 100%) fixed;
    color: var(--ink);
}
/* 装饰光斑 */
body[data-template="glass"]::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(420px 280px at 12% 8%, rgba(167,139,250,.22), transparent 70%),
        radial-gradient(520px 340px at 88% 78%, rgba(96,165,250,.16), transparent 70%),
        radial-gradient(360px 240px at 70% 18%, rgba(232,121,249,.12), transparent 70%);
}
body[data-template="glass"] .site-header, body[data-template="glass"] main, body[data-template="glass"] .site-footer { position: relative; z-index: 1; }
body[data-template="glass"] .container { max-width: var(--max-w-wide); }
body[data-template="glass"] .site-header { padding: 48px 0 12px; }
body[data-template="glass"] .site-title { font-size: 28px; font-weight: 700; letter-spacing: .5px; background: linear-gradient(90deg, #f5f3ff, #a78bfa); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
body[data-template="glass"] .site-sub { font-size: 13.5px; margin-top: 4px; color: var(--ink-soft); }
body[data-template="glass"] .search-box input {
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px;
    color: var(--ink); font-size: 14.5px; padding: 13px 18px;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
body[data-template="glass"] .search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body[data-template="glass"] .search-box input::placeholder { color: var(--ink-faint); }
body[data-template="glass"] .cat-tabs { display: flex; gap: 9px; overflow-x: auto; padding: 22px 0 4px; scrollbar-width: none; }
body[data-template="glass"] .cat-tabs::-webkit-scrollbar { display: none; }
body[data-template="glass"] .cat-tab {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: 10px;
    background: var(--bg-soft); border: 1px solid var(--line);
    color: var(--ink-soft); font-size: 13px; white-space: nowrap;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
body[data-template="glass"] .cat-tab .ic { width: 17px; height: 17px; border-radius: 6px; font-size: 10px; }
body[data-template="glass"] .cat-tab.active { background: rgba(167,139,250,.28); border-color: rgba(167,139,250,.5); color: #fff; box-shadow: 0 4px 18px rgba(167,139,250,.3); }
body[data-template="glass"] .section-title {
    font-size: 17px; font-weight: 700; letter-spacing: .5px;
    display: flex; align-items: center; gap: 10px; padding: 28px 0 12px;
}
body[data-template="glass"] .section-title .ic { width: 24px; height: 24px; border-radius: 8px; font-size: 13px; }
body[data-template="glass"] .section-title .count { font-size: 12px; color: var(--ink-faint); font-weight: 400; background: var(--bg-soft); padding: 2px 10px; border-radius: 10px; }
body[data-template="glass"] .link-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
body[data-template="glass"] .link-item { }
body[data-template="glass"] .link-row {
    display: flex; align-items: center; gap: 13px; height: 100%;
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: 16px;
    padding: 15px 16px;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    transition: all .2s;
}
body[data-template="glass"] a.link-row:hover { border-color: rgba(167,139,250,.6); box-shadow: 0 8px 26px rgba(167,139,250,.22); transform: translateY(-3px); background: rgba(255,255,255,.12); }
body[data-template="glass"] .link-row .ic { width: 44px; height: 44px; border-radius: 14px; font-size: 14px; flex: 0 0 auto; }
body[data-template="glass"] .link-main { flex: 1; min-width: 0; }
body[data-template="glass"] .link-name { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
body[data-template="glass"] .link-desc {
    font-size: 12px; color: var(--ink-faint); margin-top: 3px; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
body[data-template="glass"] .link-meta { flex: 0 0 auto; display: flex; gap: 5px; align-items: center; }
body[data-template="glass"] .link-arrow { color: var(--ink-faint); font-size: 14px; flex: 0 0 auto; }
body[data-template="glass"] a.link-row:hover .link-arrow { color: var(--accent); }
body[data-template="glass"] .link-row.off { opacity: .4; }
body[data-template="glass"] a.link-row.off:hover { transform: none; box-shadow: none; background: var(--bg-soft); }
body[data-template="glass"] .state-badge.maint { background: rgba(251,191,36,.2); color: #fcd34d; }
body[data-template="glass"] .state-badge.full { background: rgba(248,113,113,.2); color: #fca5a5; }
body[data-template="glass"] .state-badge.off { background: rgba(255,255,255,.1); color: #a1a1aa; }
body[data-template="glass"] .site-footer { border-top: 1px solid var(--line); color: var(--ink-faint); }
body[data-template="glass"] .site-footer a:hover { color: var(--accent); }

/* ==========================================================
   模板通用组件（各模板共用）
   ========================================================== */
.header-inner {
    position: relative; display: block; text-align: center;
    padding-bottom: 8px;
}
.brand { text-align: center; min-width: 0; }
/* 三个功能按钮统一放在标题文字右下角（所有模板顶部统一） */
.header-nav {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 8px; margin-top: 0;
    font-size: 14px; color: var(--ink-soft);
    background: none; border: none; padding: 0;
}
/* 顶栏三个图标按钮（风格 / 黑白 / 搜索） */
.icon-btn {
    width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 9px;
    background: var(--bg-soft); color: var(--ink); font-size: 14px;
    cursor: pointer; line-height: 1; transition: all .15s; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover {
    border-color: var(--accent); color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 2px 8px var(--accent-soft);
}
.search-box { margin-top: 18px; }
.search-box input { width: 100%; color: var(--ink); }
.search-box input::placeholder { color: var(--ink-faint); }

/* 模板风格弹窗 */
.modal-mask {
    position: fixed; inset: 0; z-index: 100; display: flex;
    align-items: center; justify-content: center;
    background: rgba(0,0,0,.5); padding: 20px;
}
.modal-mask[hidden] { display: none; }
.modal {
    width: 100%; max-width: 380px;
    background: var(--card, #fff); border: 1px solid var(--line);
    border-radius: 14px; padding: 16px;
    box-shadow: 0 18px 50px rgba(0,0,0,.28);
    animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-title { font-size: 15px; font-weight: 700; color: var(--ink, #1c1917); }
.modal-close {
    width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px;
    background: transparent; color: var(--ink-soft); font-size: 13px;
    cursor: pointer; line-height: 1; display: inline-flex;
    align-items: center; justify-content: center; transition: all .15s;
}
.modal-close:hover { border-color: var(--accent); color: var(--accent); }
.modal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl-follow {
    width: 100%; margin-top: 14px; padding: 10px 0;
    border: 1px dashed var(--line); border-radius: 10px;
    background: transparent; color: var(--ink-faint); font-size: 12.5px;
    cursor: pointer; font-family: inherit; transition: all .15s;
}
.tpl-follow:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tpl-opt {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 13px 6px 10px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--bg-soft); color: var(--ink); font-size: 12.5px; font-weight: 500;
    cursor: pointer; font-family: inherit; transition: all .15s;
}
.tpl-opt:hover { border-color: var(--accent); color: var(--accent); }
.tpl-opt.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.tpl-ico {
    width: 40px; height: 40px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; border: 1px solid rgba(255,255,255,.22);
}
.ico-hacker  { background: #0b0b10; color: #00ff9c; }
.ico-blog    { background: #faf7f2; color: #b45309; border-color: rgba(0,0,0,.1); }
.ico-tiles   { background: #e8f4fd; color: #0284c7; border-color: rgba(0,0,0,.08); }
.ico-minimal { background: #ffffff; color: #111; border-color: rgba(0,0,0,.1); }
.ico-cards   { background: #f5f5f4; color: #ea580c; border-color: rgba(0,0,0,.1); }
.ico-glass   { background: linear-gradient(135deg, #17162e, #3b2f7a); color: #a78bfa; }
.tpl-name { line-height: 1.2; }

/* 分类导航分页（分类多时翻页） */
.cat-tabs-wrap { display: flex; align-items: center; gap: 8px; }
.cat-page-btn {
    flex: 0 0 auto; width: 32px; height: 32px; border: 1px solid var(--line);
    border-radius: 10px; background: var(--bg-soft); color: var(--ink-soft);
    font-size: 16px; cursor: pointer; line-height: 1; display: inline-flex;
    align-items: center; justify-content: center; transition: all .15s;
    font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.cat-page-btn:hover { border-color: var(--accent); color: var(--accent); }
.cat-page-btn[hidden] { display: none; }
@media (max-width: 340px) {
    .cat-page-btn { width: 34px; height: 34px; }
}

/* 分类 tab 通用过渡 + 数量角标徽章（各模板在此基础上自定义配色/形状） */
.cat-tab { transition: all .15s ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.cat-tab .count {
    font-size: 11px; line-height: 1; margin-left: 3px; opacity: .6;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 17px; padding: 2px 6px; border-radius: 10px;
    font-family: var(--font-sans);
}
.cat-tabs-wrap { margin: 18px 0 14px; }
.cat-section { margin-top: 4px; }

/* 移动端触摸友好：去掉点按高亮灰块，避免双击缩放 */
body { -webkit-tap-highlight-color: transparent; }
.icon-btn, .cat-tab, .cat-page-btn, .tpl-opt, .recent-list a,
.back-top, .modal-close, .lock-card button { touch-action: manipulation; }
/* 空分类占位 */
.empty-cat {
    font-size: 12.5px; color: var(--ink-faint); padding: 26px 0 20px; text-align: center;
}

/* 顶部公告卡片 */
.notice-bar {
    display: flex; align-items: center; gap: 10px;
    margin: 12px 0 6px; padding: 9px 14px;
    border: 1px solid var(--line); border-left: 3px solid var(--accent);
    border-radius: 13px;
    background: var(--bg-soft);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, var(--bg-soft)), var(--bg-soft) 60%);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 9%, transparent);
    overflow: hidden;
}
.notice-ico {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; background: var(--accent); color: #fff;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 40%, transparent);
}
.notice-track { flex: 1; overflow: hidden; white-space: nowrap; }
.notice-text { display: block; white-space: nowrap; font-size: 13px; font-weight: 500; color: var(--ink); text-align: center; width: 100%; }
.notice-bar.scroll .notice-track { display: flex; width: max-content; }
.notice-bar.scroll .notice-text { display: inline-block; width: auto; animation: notice-move 18s linear infinite; padding-right: 48px; }
@keyframes notice-move { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
    .notice-bar.scroll .notice-text { animation: none; }
}

/* 最近访问 */
.recent { margin-top: 10px; }
.recent-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.recent-list a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border: 1px solid var(--line); border-radius: 10px;
    font-size: 12.5px; color: var(--ink-soft); background: var(--bg-soft);
}
.recent-list a:hover { border-color: var(--accent); color: var(--accent); }

/* 状态角标 / 加密徽章（模板通用） */
.state-badge {
    font-size: 10.5px; padding: 2px 8px; border-radius: 10px;
    font-weight: 500; font-family: var(--font-sans); white-space: nowrap;
}
.state-badge.maint { background: #fef3c7; color: #b45309; }
.state-badge.off   { background: #f3f4f6; color: #6b7280; }
.state-badge.full  { background: #fee2e2; color: #dc2626; }
.lock-badge { font-size: 12px; opacity: .85; }

/* 空状态 / 底部 */
.empty { text-align: center; padding: 60px 0; color: var(--ink-soft); }
.empty-sub { color: var(--ink-faint); font-size: 13px; margin-top: 6px; }
.site-footer {
    text-align: center; padding: 48px 0 36px;
    color: var(--ink-faint); font-size: 12.5px;
    border-top: 1px dashed var(--line); margin-top: 44px;
}
.site-footer a:hover { color: var(--accent); }

/* 回到顶部 */
.back-top {
    position: fixed; right: 18px; bottom: 24px;
    width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--bg-soft);
    color: var(--ink-soft); font-size: 18px; cursor: pointer;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: all .25s; box-shadow: 0 4px 14px rgba(0,0,0,.08); z-index: 9;
}
.back-top.show { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { color: var(--accent); border-color: var(--accent); box-shadow: 0 6px 18px rgba(0,0,0,.12); }

/* ==========================================================
   按钮交互统一优化（所有模板通用）
   统一过渡曲线 + 按压反馈 + 桌面 hover 微浮起
   ========================================================== */
.icon-btn, .cat-page-btn, .modal-close, .back-top, .tpl-opt {
    transition: transform .12s ease, border-color .15s ease, color .15s ease,
                background .15s ease, box-shadow .15s ease;
}
.icon-btn:active, .cat-page-btn:active, .modal-close:active, .back-top:active,
.tpl-opt:active, .cat-tab:active { transform: scale(.95); }
@media (hover: hover) {
    .icon-btn:hover, .cat-page-btn:hover, .back-top:hover, .modal-close:hover { transform: translateY(-1px); }
}
/* 加密页主按钮按压反馈 */
.lock-card button { transition: transform .12s ease, background .15s ease, box-shadow .15s ease; }
.lock-card button:active { transform: scale(.97); }

/* ---------------- 加密访问页 ---------------- */
.lock-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; background: var(--bg, #fafaf9);
}
.lock-card {
    width: 100%; max-width: 340px;
    background: var(--bg-soft, #fff); border: 1px solid var(--line, #e7e5e4); border-radius: 14px;
    padding: 36px 30px; text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,.05);
}
.lock-icon { font-size: 34px; margin-bottom: 10px; }
.lock-card h1 { font-family: var(--font-serif); font-size: 21px; color: var(--ink, #292524); margin-bottom: 2px; }
.lock-sub { color: var(--ink-faint, #a8a29e); font-size: 13px; margin-bottom: 20px; }
.lock-err { color: #dc2626; font-size: 13px; margin-bottom: 10px; }
.lock-card input {
    width: 100%; padding: 11px 14px; margin-bottom: 12px;
    border: 1px solid var(--line, #e7e5e4); border-radius: 8px; font-size: 14px; outline: none;
    background: var(--bg-soft, #fff); color: var(--ink, #292524);
}
.lock-card input:focus { border-color: var(--accent, #b45309); box-shadow: 0 0 0 3px var(--accent-soft, #fdeee0); }
.lock-card button {
    width: 100%; padding: 11px; margin-top: 4px;
    background: var(--accent, #b45309); color: #fff; border: none; border-radius: 8px;
    font-size: 15px; cursor: pointer;
}
.lock-back { display: inline-block; margin-top: 16px; color: var(--ink-faint, #a8a29e); font-size: 13px; }
.lock-back:hover { color: var(--accent, #b45309); }

/* ---------------- 中转确认页 ---------------- */
.jump-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: var(--bg, #fafaf9);
}
.jump-card {
    width: 100%; max-width: 560px; padding: 22px;
    background: var(--card, var(--bg-soft, #fff));
    border: 1px solid var(--line, #e7e5e4); border-radius: 16px;
    color: var(--ink, #292524);
    box-shadow: 0 12px 32px rgba(0,0,0,.07);
    animation: jumpFade .35s ease;
}
@keyframes jumpFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.jump-head {
    font-size: 12px; color: var(--ink-faint, #a8a29e); letter-spacing: .5px;
    border-bottom: 1px dashed var(--line, #e7e5e4);
    padding-bottom: 10px; margin-bottom: 16px; word-break: break-all;
}
.jump-head b { color: var(--accent, #b45309); font-weight: 700; }
.jump-shot {
    height: 200px; border-radius: 12px; overflow: hidden;
    background: var(--bg-soft, #f5f5f4); border: 1px solid var(--line, #e7e5e4);
    display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.jump-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jump-shot .fallback {
    display: none; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; width: 100%; height: 100%; color: var(--ink-faint, #a8a29e);
    font-size: 13px; text-align: center; padding: 20px;
}
.jump-shot .fallback .big-ic {
    width: 64px; height: 64px; border-radius: 18px;
    background: var(--accent-soft, #fdeee0); border: 1px solid var(--line, #e7e5e4);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: var(--accent, #b45309);
}
.jump-info { margin-bottom: 18px; }
.jump-name { font-size: 21px; font-weight: 700; color: var(--ink, #292524); margin-bottom: 6px; }
.jump-url {
    font-size: 13px; color: var(--ink-soft, #57534e); word-break: break-all;
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-soft, #f5f5f4); border: 1px solid var(--line, #e7e5e4); border-radius: 8px;
    padding: 7px 12px; cursor: pointer; user-select: all; max-width: 100%;
}
.jump-meta { font-size: 12px; color: var(--ink-faint, #a8a29e); margin-top: 10px; line-height: 1.6; }
.jump-speed {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
    font-size: 12.5px; color: var(--ink-soft, #57534e);
    background: var(--bg-soft, #f5f5f4); border: 1px solid var(--line, #e7e5e4);
    border-radius: 8px; padding: 6px 12px;
}
.jump-speed .dot { width: 8px; height: 8px; border-radius: 50%; background: #ffd166; animation: jumpBlink 1s infinite; }
.jump-speed.ok .dot { background: var(--accent, #22c55e); animation: none; }
.jump-speed.slow .dot { background: #ffd166; animation: none; }
.jump-speed.bad .dot { background: #ff4d4d; animation: none; }
@keyframes jumpBlink { 50% { opacity: .2; } }
.jump-actions { display: flex; gap: 10px; }
.jump-actions .btn {
    flex: 1; text-align: center; padding: 13px 0; border-radius: 12px;
    font-family: var(--font-sans, system-ui); font-size: 14px; text-decoration: none;
    transition: all .15s;
}
.btn-go { background: var(--accent, #b45309); color: #fff; font-weight: 700; box-shadow: 0 4px 14px var(--accent-soft, #fdeee0); }
.btn-go:hover { filter: brightness(1.06); }
.btn-back { background: var(--bg-soft, #f5f5f4); color: var(--ink-soft, #57534e); border: 1px solid var(--line, #e7e5e4); }
.btn-back:hover { border-color: var(--accent, #b45309); color: var(--accent, #b45309); }
.jump-note { text-align: center; font-size: 11.5px; color: var(--ink-faint, #a8a29e); margin-top: 14px; letter-spacing: .5px; }

/* ==========================================================
   class 图标系统（零图片依赖 · 内嵌 SVG）
   用法：<span class="ic icon-xxx"></span>
   ========================================================== */
.ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-style: normal;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 55%;
    background-color: #a8a29e;
}
.ic::after { content: ""; }

.icon-tool   { background-color: #64748b; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E"); }
.icon-design { background-color: #ec4899; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19l7-7 3 3-7 7-3-3z'/%3E%3Cpath d='M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z'/%3E%3Cpath d='M2 2l7.586 7.586'/%3E%3Ccircle cx='11' cy='11' r='2'/%3E%3C/svg%3E"); }
.icon-dev    { background-color: #0ea5e9; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='16 18 22 12 16 6'/%3E%3Cpolyline points='8 6 2 12 8 18'/%3E%3C/svg%3E"); }
.icon-video  { background-color: #f43f5e; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='23 7 16 12 23 17 23 7'/%3E%3Crect x='1' y='5' width='15' height='14' rx='2' ry='2'/%3E%3C/svg%3E"); }
.icon-learn  { background-color: #10b981; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E"); }
.icon-shop   { background-color: #f59e0b; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'/%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E"); }
.icon-news   { background-color: #8b5cf6; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0V4'/%3E%3Cline x1='22' y1='4' x2='22' y2='16'/%3E%3C/svg%3E"); }
.icon-music  { background-color: #06b6d4; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E"); }
.icon-social { background-color: #3b82f6; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z'/%3E%3C/svg%3E"); }
.icon-game   { background-color: #ef4444; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='6' y1='11' x2='10' y2='11'/%3E%3Cline x1='8' y1='9' x2='8' y2='13'/%3E%3Cline x1='15' y1='12' x2='15.01' y2='12'/%3E%3Cline x1='18' y1='10' x2='18.01' y2='10'/%3E%3Cpath d='M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z'/%3E%3C/svg%3E"); }
.icon-mail   { background-color: #eab308; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E"); }
.icon-map    { background-color: #14b8a6; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6'/%3E%3Cline x1='8' y1='2' x2='8' y2='18'/%3E%3Cline x1='16' y1='6' x2='16' y2='22'/%3E%3C/svg%3E"); }
.icon-more   { background-color: #78716c; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E"); }

/* 社交/平台类 */
.icon-qq     { background-color: #12b7f5; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='12' cy='13.9' rx='5.4' ry='6.3' fill='%23111'/%3E%3Cellipse cx='12' cy='15.1' rx='3.1' ry='4.5' fill='%23fff'/%3E%3Ccircle cx='12' cy='6.4' r='4.7' fill='%23111'/%3E%3Cellipse cx='12' cy='7.5' rx='3.1' ry='2.6' fill='%23fff'/%3E%3Ccircle cx='10.1' cy='6.4' r='0.9' fill='%23111'/%3E%3Ccircle cx='13.9' cy='6.4' r='0.9' fill='%23111'/%3E%3Cpath d='M10.4 9.3l1.6 1.7 1.6-1.7z' fill='%23f97316'/%3E%3Cpath d='M9.4 11.4h5.2c.5 0 .9.4.9.9v.3c0 .5-.4.9-.9.9H9.4c-.5 0-.9-.4-.9-.9v-.3c0-.5.4-.9.9-.9z' fill='%23ef4444'/%3E%3Cpath d='M13.8 12.4c0 .4-.1.8-.4 1.1l-1.1 1.7c-.2.3-.6.4-.9.2l-.2-.2c-.2-.3-.1-.7.2-.9l1.2-1.6c.2-.2.5-.3.7-.3h.5z' fill='%23ef4444'/%3E%3C/svg%3E"); }
.icon-magnet{ background-color: #ef4444; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 3.5V12a8 8 0 0 0 16 0V3.5'/%3E%3Cpath d='M2.5 3.5h3M18.5 3.5h3'/%3E%3C/svg%3E"); }

/* 透明底（无背景色）：彩色企鹅 / 磁力 */
.icon-qq-c   { background-color: transparent; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg stroke='%23fff' stroke-width='1' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='13.9' rx='5.4' ry='6.3' fill='%231c1c1c'/%3E%3Ccircle cx='12' cy='6.4' r='4.7' fill='%231c1c1c'/%3E%3C/g%3E%3Cellipse cx='12' cy='15.1' rx='3.1' ry='4.5' fill='%23fff'/%3E%3Cellipse cx='12' cy='7.5' rx='3.1' ry='2.6' fill='%23fff'/%3E%3Ccircle cx='10.1' cy='6.4' r='0.9' fill='%231c1c1c'/%3E%3Ccircle cx='13.9' cy='6.4' r='0.9' fill='%231c1c1c'/%3E%3Cpath d='M10.4 9.3l1.6 1.7 1.6-1.7z' fill='%23f97316'/%3E%3Cpath d='M9.4 11.4h5.2c.5 0 .9.4.9.9v.3c0 .5-.4.9-.9.9H9.4c-.5 0-.9-.4-.9-.9v-.3c0-.5.4-.9.9-.9z' fill='%23ef4444'/%3E%3Cpath d='M13.8 12.4c0 .4-.1.8-.4 1.1l-1.1 1.7c-.2.3-.6.4-.9.2l-.2-.2c-.2-.3-.1-.7.2-.9l1.2-1.6c.2-.2.5-.3.7-.3h.5z' fill='%23ef4444'/%3E%3C/svg%3E"); }
.icon-magnet-o{ background-color: transparent; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 4.5v7.5a8 8 0 0 0 16 0V4.5' stroke='%23ef4444' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath d='M2.5 4h3M18.5 4h3' stroke='%23ef4444' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath d='M3.6 4.4h1.8M18.6 4.4h1.8' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.icon-wx     { background-color: #07c160; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 6.2c-3 0-5.5 2-5.5 4.6 0 1.5.8 2.8 2.1 3.7L4.3 16l2.3-1.2c.6.2 1.2.3 1.9.3'/%3E%3Cpath d='M14.5 20.8c3.3 0 5.5-2 5.5-4.6 0-1.5-.8-2.8-2.1-3.7l1.8-1.5-2.3 1.2c-.6-.2-1.3-.3-2-.3'/%3E%3Ccircle cx='6.5' cy='10' r='0.6' fill='%23fff'/%3E%3Ccircle cx='9.8' cy='10' r='0.6' fill='%23fff'/%3E%3Ccircle cx='13' cy='15.6' r='0.6' fill='%23fff'/%3E%3Ccircle cx='16.3' cy='15.6' r='0.6' fill='%23fff'/%3E%3C/svg%3E"); }
.icon-weibo  { background-color: #e6162d; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11.5' r='4.5'/%3E%3Cpath d='M17.8 7.2c.9-.3 1.8.4 1.8 1.4'/%3E%3Cpath d='M8.5 17.5c1.7 1.4 4.3 1.6 6.2.6'/%3E%3C/svg%3E"); }
.icon-zhihu  { background-color: #0084ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z'/%3E%3C/svg%3E"); }
.icon-bili   { background-color: #fb7299; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='13' rx='2' ry='2'/%3E%3Cpolyline points='17 2 12 7 7 2'/%3E%3C/svg%3E"); }
.icon-github { background-color: #586069; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22'/%3E%3C/svg%3E"); }

/* 生活/兴趣类 */
.icon-camera { background-color: #7c3aed; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E"); }
.icon-phone  { background-color: #10b981; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E"); }
.icon-wallet { background-color: #f59e0b; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12V7H5a2 2 0 0 1 0-4h14v4'/%3E%3Cpath d='M3 5v14a2 2 0 0 0 2 2h16v-5'/%3E%3Cpath d='M18 12a2 2 0 0 0 0 4h4v-4z'/%3E%3C/svg%3E"); }
.icon-food   { background-color: #d97706; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8h1a4 4 0 0 1 0 8h-1'/%3E%3Cpath d='M2 8h16v9a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8z'/%3E%3Cline x1='6' y1='1' x2='6' y2='4'/%3E%3Cline x1='10' y1='1' x2='10' y2='4'/%3E%3Cline x1='14' y1='1' x2='14' y2='4'/%3E%3C/svg%3E"); }
.icon-movie  { background-color: #e11d48; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='20' height='20' rx='2.18' ry='2.18'/%3E%3Cline x1='7' y1='2' x2='7' y2='22'/%3E%3Cline x1='17' y1='2' x2='17' y2='22'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cline x1='2' y1='7' x2='7' y2='7'/%3E%3Cline x1='2' y1='17' x2='7' y2='17'/%3E%3Cline x1='17' y1='17' x2='22' y2='17'/%3E%3Cline x1='17' y1='7' x2='22' y2='7'/%3E%3C/svg%3E"); }
.icon-travel { background-color: #0ea5e9; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z'/%3E%3C/svg%3E"); }
.icon-read   { background-color: #8b5cf6; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E"); }
.icon-sport  { background-color: #22c55e; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 18 12 15 21 9 3 6 12 2 12'/%3E%3C/svg%3E"); }
.icon-health { background-color: #ef4444; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E"); }
.icon-finance{ background-color: #84cc16; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='1' x2='12' y2='23'/%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/%3E%3C/svg%3E"); }
.icon-job    { background-color: #64748b; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='14' rx='2' ry='2'/%3E%3Cpath d='M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16'/%3E%3C/svg%3E"); }
.icon-home   { background-color: #f97316; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E"); }
.icon-car    { background-color: #3b82f6; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13l2.5-6.5A2 2 0 0 1 7.4 5h9.2a2 2 0 0 1 1.9 1.5L21 13'/%3E%3Crect x='3' y='13' width='18' height='6' rx='2'/%3E%3Ccircle cx='7' cy='18' r='1.5'/%3E%3Ccircle cx='17' cy='18' r='1.5'/%3E%3C/svg%3E"); }

/* ==========================================================
   响应式
   ========================================================== */
/* ==========================================================
   响应式（移动端为主，移动/PC 一套样式；仅超窄屏微调）
   ========================================================== */
/* ---- 通用（保证 6 套模板都不溢出、可点区域舒适、触控友好） ---- */
.container { padding: 0 16px; }
.site-title { line-height: 1.2; }
.site-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; font-size: 12.5px; }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; font-size: 15px; }
.search-box { margin-top: 14px; }
.search-box input { font-size: 15px; padding: 12px 14px; }

/* 分类导航条：触控目标加大、更精致 */
.cat-tabs-wrap { margin: 14px 0 12px; gap: 6px; }
.cat-tab { padding: 10px 15px; font-size: 13.5px; border-radius: 12px; gap: 7px; }
.cat-tab .count { font-size: 11px; line-height: 1.2; }
.cat-page-btn { width: 38px; height: 38px; border-radius: 11px; }

/* 区块标题 */
.section-title { font-size: 16px; padding: 24px 0 10px; gap: 8px; }
.section-title .ic { width: 22px; height: 22px; }

/* 单列模板链接行：触控高度更舒适 */
.link-row { padding: 15px 6px; gap: 12px; }
.link-row .ic { width: 38px; height: 38px; border-radius: 11px; font-size: 12px; }
.link-name { font-size: 15px; font-weight: 600; line-height: 1.45; }
.link-desc { font-size: 12px; font-weight: 400; line-height: 1.5; }
.state-badge, .lock-badge { font-size: 10px; padding: 3px 7px; }
.recent-list a { font-size: 12.5px; padding: 7px 13px; }
.site-footer { font-size: 12px; padding: 30px 0 34px; }

/* ---- 各模板细节（移动/PC 一致） ---- */
body[data-template="tiles"] .link-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
body[data-template="tiles"] .link-row { padding: 14px 10px 12px; border-radius: 16px; gap: 8px; }
body[data-template="tiles"] .link-row .ic { width: 42px; height: 42px; font-size: 14px; }
body[data-template="tiles"] .link-name { font-size: 13.5px; }
body[data-template="tiles"] .link-desc { font-size: 11px; line-height: 1.45; }

body[data-template="cards"] .link-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
body[data-template="cards"] .link-row { padding: 13px 12px; border-radius: 13px; gap: 10px; }
body[data-template="cards"] .link-row .ic { width: 36px; height: 36px; border-radius: 11px; }
body[data-template="cards"] .link-name { font-size: 14px; }
body[data-template="cards"] .link-desc { font-size: 11px; line-height: 1.45; }

body[data-template="glass"] .link-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
body[data-template="glass"] .link-row { padding: 14px 12px; border-radius: 14px; gap: 10px; }
body[data-template="glass"] .link-row .ic { width: 36px; height: 36px; border-radius: 12px; }
body[data-template="glass"] .link-name { font-size: 13.5px; }
body[data-template="glass"] .link-desc { font-size: 11px; line-height: 1.45; }
body[data-template="glass"] .section-title { font-size: 16px; }

body[data-template="minimal"] .search-box { margin-top: 26px; }
body[data-template="minimal"] .cat-tabs { gap: 20px; padding: 26px 0 6px; }
body[data-template="minimal"] .cat-tab { font-size: 14px; padding: 5px 0; }

body[data-template="hacker"] .site-title { font-size: 27px; }
body[data-template="hacker"] .brand::after { margin-top: 10px; }
body[data-template="hacker"] .cat-tab { border-radius: 10px; padding: 9px 14px; }
body[data-template="hacker"] .link-row { padding: 13px 4px; gap: 11px; }
body[data-template="hacker"] .link-row .ic { width: 32px; height: 32px; }

/* 各模板站点标题统一缩放、更协调 */
body[data-template="blog"] .site-title { font-size: 27px; }
body[data-template="tiles"] .site-title { font-size: 25px; }
body[data-template="cards"] .site-title { font-size: 25px; }
body[data-template="glass"] .site-title { font-size: 24px; }
body[data-template="minimal"] .site-title { font-size: 27px; }
@media (max-width: 340px) {
    /* 超窄屏才降为单列，主流手机(360-428px)保持双列更紧凑好看 */
    body[data-template="tiles"] .link-list,
    body[data-template="cards"] .link-list,
    body[data-template="glass"] .link-list { grid-template-columns: 1fr; }
    .container { padding: 0 13px; }
    .header-nav { gap: 5px; }
    .icon-btn { width: 32px; height: 32px; }
    .site-title { font-size: 20px; }
    body[data-template="blog"] .site-title { font-size: 23px; }
    body[data-template="minimal"] .site-title { font-size: 23px; }
}
@media (max-width: 340px) {
    /* 超窄屏才降为单列，主流手机(360-428px)保持双列更紧凑好看 */
    body[data-template="tiles"] .link-list,
    body[data-template="cards"] .link-list,
    body[data-template="glass"] .link-list { grid-template-columns: 1fr; }
    .container { padding: 0 13px; }
    .header-nav { gap: 5px; }
    .icon-btn { width: 32px; height: 32px; }
    .site-title { font-size: 20px; }
    body[data-template="blog"] .site-title { font-size: 23px; }
    body[data-template="minimal"] .site-title { font-size: 23px; }
}

/* ==========================================================
   深色模式（全局开关，浅色模板一键变黑；黑客/玻璃本身深色不变）
   ========================================================== */
body.dark {
    --bg: #0d0d12;
    --bg-soft: #17171e;
    --ink: #e9e9f1;
    --ink-soft: #a3a3b2;
    --ink-faint: #62626f;
    --line: rgba(255,255,255,.18);
    --card: #17171e;
    --header-bg: #17171e;
}
body.dark[data-template="blog"] {
    --bg: #101014;
    --bg-soft: #17171c;
    --ink: #ece7dc;
    --ink-soft: #a8a092;
    --ink-faint: #5f5a50;
    --line: #2a2722;
    --card: #17171c;
    --accent: #d6a354;
    --accent-soft: rgba(214,163,84,.13);
}
body.dark[data-template="tiles"] {
    --bg: #0d1620;
    --bg-soft: #13202e;
    --ink: #e2f2ff;
    --ink-soft: #8fb8d8;
    --ink-faint: #4d6b84;
    --line: #1d3448;
    --card: #13202e;
    --accent: #38bdf8;
    --accent-soft: rgba(56,189,248,.13);
}
body.dark[data-template="minimal"] {
    --bg: #101014;
    --bg-soft: #1a1a20;
    --ink: #f0f0f5;
    --ink-soft: #9d9dab;
    --ink-faint: #565660;
    --line: #26262e;
    --card: #1a1a20;
    --accent: #f5f5f5;
    --accent-soft: rgba(255,255,255,.08);
}
body.dark[data-template="cards"] {
    --bg: #101014;
    --bg-soft: #1a1a20;
    --ink: #ece7dc;
    --ink-soft: #a8a092;
    --ink-faint: #5f5a50;
    --line: #2a2722;
    --card: #1a1a20;
    --accent: #f97316;
    --accent-soft: rgba(249,115,22,.14);
}
/* 各模板里写死的浅色背景块，深色下统一压暗 */
body.dark[data-template="blog"] .site-header .container,
body.dark[data-template="tiles"] .site-header,
body.dark[data-template="minimal"] .site-header,
body.dark[data-template="cards"] .site-header { background: var(--bg-soft); }
body.dark[data-template="tiles"] .link-row .ic,
body.dark[data-template="cards"] .link-row .ic { box-shadow: none; }
body.dark .lock-card { background: #17171e; border-color: #25252f; }
body.dark .lock-card h1 { color: #e9e9f1; }
body.dark .lock-sub { color: #a3a3b2; }
/* 暗色模式全局兜底：按钮 / 标签 / 弹窗 / 列表统一变量化，保证各模板暗色下协调 */
body.dark .cat-tab { background: var(--bg-soft); border-color: var(--line); color: var(--ink-soft); }
body.dark .cat-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
body.dark .link-row { background: var(--card); border-color: var(--line); }
body.dark .icon-btn, body.dark .modal-close { background: var(--bg-soft); border-color: var(--line); color: var(--ink); }
body.dark .tpl-opt { background: var(--bg-soft); border-color: var(--line); color: var(--ink-soft); }
body.dark .tpl-opt.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
body.dark .state-badge, body.dark .lock-badge, body.dark .section-title .count { background: var(--bg-soft); color: var(--ink-soft); }
body.dark .recent-list a { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.2); color: var(--ink-soft); }
body.dark .search-box input { background: var(--bg-soft); border-color: var(--line); color: var(--ink); }
body.dark .site-footer { color: var(--ink-faint); }
body.dark .site-footer a { color: var(--ink-soft); }
body.dark .site-footer a:hover { color: var(--accent); }


/* dark 模式下 hacker 模板保持黑色优雅（香槟金点缀，标题白字可见） */
body.dark[data-template="hacker"] {
    --bg: #0a0a0e;
    --bg-soft: #141419;
    --ink: #f3f3f7;
    --ink-soft: rgba(255,255,255,.66);
    --ink-faint: rgba(255,255,255,.38);
    --line: rgba(255,255,255,.10);
    --accent: #d4b483;
    --accent-soft: rgba(212,180,131,.12);
    --card: #141419;
}
body.dark[data-template="hacker"] .site-title { color: #fff; }
body.dark[data-template="hacker"] .site-sub { color: rgba(255,255,255,.66); }
body.dark[data-template="hacker"]::before {
    background:
        radial-gradient(560px 300px at 50% -40px, rgba(212,180,131,.10), transparent 70%),
        radial-gradient(420px 260px at 88% 94%, rgba(212,180,131,.06), transparent 70%);
}
