/* ===== CMS 前台主题（现代卡片式）===== */
:root {
  --bg: #f6f8fb; --card: #fff; --line: #e8edf4; --txt: #1a2233; --mut: #7b8798;
  --pri: #4f46e5; --pri2: #7c3aed; --accent: #f59e0b; --shadow: 0 4px 20px rgba(30,41,90,.06);
  --radius: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif; background: var(--bg); color: var(--txt); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--pri); text-decoration: none; transition: color .18s; }
a:hover { color: var(--pri2); }
img { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* 头部 */
.site-header { background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.site-header .logo { display: flex; align-items: center; gap: 9px; font-size: 1.3rem; font-weight: 800; color: #111827; letter-spacing: -.3px; }
.site-header .logo::before { content: "◆"; color: var(--pri); font-size: 1.1rem; }
.site-header nav a { margin-left: 22px; color: #55607a; font-size: 14px; font-weight: 500; }
.site-header nav a:hover { color: var(--pri); }

/* Hero */
.hero { position: relative; overflow: hidden; margin: 28px 0 26px; padding: 58px 46px; border-radius: 22px; color: #fff; background: linear-gradient(125deg, #4338ca 0%, #6366f1 45%, #a855f7 100%); box-shadow: 0 18px 40px rgba(79,70,229,.25); }
.hero::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.1); top: -180px; right: -80px; }
.hero::after { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.07); bottom: -150px; right: 120px; }
.hero > * { position: relative; z-index: 1; }
.hero-tag { display: inline-block; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); padding: 5px 14px; border-radius: 99px; font-size: 13px; margin-bottom: 16px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 800; letter-spacing: -1px; line-height: 1.2; }
.hero p { margin: 0; font-size: 1.05rem; opacity: .92; max-width: 620px; }
.hero-stats { display: flex; gap: 30px; margin-top: 26px; }
.hero-stats span { font-size: 14px; opacity: .9; }
.hero-stats b { display: inline-block; font-size: 1.5rem; margin-right: 5px; }

/* 焦点推荐 */
.spotlight { display: grid; grid-template-columns: 300px 1fr; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 34px; }
.sp-cover { background: linear-gradient(135deg, #eef2ff, #f3e8ff); display: flex; align-items: center; justify-content: center; min-height: 200px; font-size: 4rem; }
.sp-cover img { width: 100%; height: 100%; object-fit: cover; }
.sp-body { padding: 28px 32px; }
.sp-tag { display: inline-block; background: #fef3c7; color: #b45309; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 99px; }
.sp-body h2 { margin: 12px 0 8px; font-size: 1.55rem; }
.sp-body h2 a { color: #111827; }
.sp-body p { color: var(--mut); margin: 0 0 18px; }

/* 区块标题 */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 16px; }
.section-head h2 { margin: 0; font-size: 1.3rem; font-weight: 700; }
.section-head::before { }

/* 分类 chips */
.cat-nav { display: flex; gap: 12px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 18px; color: #364152; font-size: 14px; font-weight: 500; box-shadow: 0 2px 8px rgba(30,41,90,.03); transition: transform .18s, border-color .18s; }
.chip:hover { transform: translateY(-2px); border-color: var(--pri); color: var(--pri); }
.chip-ico { font-size: 1.1rem; }

/* 文章卡片 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-bottom: 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .22s, box-shadow .22s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(30,41,90,.12); }
.card-cover { display: block; height: 150px; background: linear-gradient(135deg, #eef2ff, #faf5ff); position: relative; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card-cover img { transform: scale(1.05); }
.cover-ph { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 2.5rem; color: #c7d2fe; }
.badge-hot { position: absolute; top: 10px; left: 10px; background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 99px; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card-cat { font-size: 11px; color: var(--pri); font-weight: 600; margin-bottom: 6px; }
.card-body h3 { margin: 0 0 8px; font-size: 1.05rem; line-height: 1.4; }
.card-body h3 a { color: #16203a; }
.summary { color: var(--mut); font-size: 13px; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meta { color: #98a2b3; font-size: 12px; }
.btn { display: inline-block; background: var(--pri); color: #fff !important; padding: 7px 15px; border-radius: 8px; font-size: 13px; font-weight: 600; transition: background .18s, transform .18s; white-space: nowrap; }
.btn:hover { background: var(--pri2); transform: translateY(-1px); }
.btn.big { padding: 11px 26px; font-size: 15px; border-radius: 10px; }

/* 友链 / 页脚 */
.links { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 36px; box-shadow: var(--shadow); }
.links h3 { margin: 0 0 10px; font-size: 15px; }
.links p { margin: 0; color: var(--mut); font-size: 14px; }
.site-footer { background: #111827; color: #9ca3af; padding: 30px 0; margin-top: 40px; font-size: 13px; text-align: center; }
.site-footer a { color: #9ca3af; }
.empty-page { text-align: center; padding: 100px 24px; }
.empty-page h1 { font-size: 4rem; color: var(--pri); margin: 0; }
.empty, .hint { color: var(--mut); }

/* ===== 文章页 ===== */
.crumb { color: var(--mut); font-size: 13px; margin: 24px 0; }
.crumb a { color: var(--mut); }
.article-page { max-width: 900px; }
.article { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 40px; box-shadow: var(--shadow); }
.article h1 { margin: 0 0 10px; font-size: 2rem; line-height: 1.35; letter-spacing: -.5px; }
.article .subtitle { color: var(--mut); font-size: 1.05rem; margin-top: 0; }
.article .cover { width: 100%; max-height: 380px; object-fit: cover; border-radius: 12px; margin: 18px 0; }
.article .content { font-size: 15.5px; line-height: 1.95; color: #374151; }
.article .content h2 { font-size: 1.35rem; margin: 28px 0 12px; padding-left: 12px; border-left: 4px solid var(--pri); }
.article .content img { border-radius: 10px; margin: 14px 0; }
.article .tags { margin-top: 24px; }
.article .tags span { display: inline-block; background: #eef2ff; color: var(--pri); border-radius: 99px; padding: 4px 13px; font-size: 12px; margin: 0 8px 8px 0; }
.downloads { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 36px; margin: 22px 0; box-shadow: var(--shadow); }
.downloads h2, .comments h2 { margin: 0 0 18px; font-size: 1.3rem; }
.dl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.download-btn { display: flex; flex-direction: column; gap: 3px; background: linear-gradient(135deg, var(--pri), var(--pri2)); color: #fff; padding: 15px 20px; border-radius: 12px; transition: transform .18s, box-shadow .18s; }
.download-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(79,70,229,.3); color: #fff; }
.download-btn strong { font-size: 15px; }
.download-btn small { opacity: .85; font-size: 12px; }

/* 评论 */
.comments { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 36px; margin-bottom: 40px; box-shadow: var(--shadow); }
.cmt-form input, .cmt-form textarea { width: 100%; box-sizing: border-box; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; font: inherit; font-size: 14px; background: #fbfcfe; }
.cmt-form input:focus, .cmt-form textarea:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.cmt-form button { background: var(--pri); color: #fff; border: 0; border-radius: 10px; padding: 10px 26px; cursor: pointer; font-size: 14px; font-weight: 600; }
.cmt-msg { font-size: 13px; color: var(--ok); margin-left: 12px; }
.hp { position: absolute; left: -9999px; }
.cmt-list { list-style: none; padding: 0; margin-top: 22px; }
.cmt-list li { border-top: 1px solid var(--line); padding: 16px 0; }
.cmt-head { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.cmt-head .avatar { width: 30px; height: 30px; border-radius: 50%; background: #eef2ff; display: inline-flex; align-items: center; justify-content: center; }
.cmt-head time { color: var(--mut); margin-left: auto; }
.cmt-body { margin: 9px 0; white-space: pre-wrap; color: #374151; }
.cmt-acts button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 13px; cursor: pointer; margin-right: 8px; font-size: 12px; }
.cmt-acts button.on.up { background: #eef2ff; border-color: var(--pri); color: var(--pri); }
.cmt-acts button.on.down { background: #fff1f0; border-color: #ef4444; color: #dc2626; }

/* 顶部用户状态 */
.user-nav { display: inline-flex; gap: 12px; align-items: center; margin-left: 18px; }
.nav-register { background: var(--pri); color: #fff !important; padding: 5px 14px; border-radius: 8px; }
.user-greeting { color: var(--pri); font-weight: 600; }

/* 最近更新 / 栏目版块 */
.recent-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 22px; margin-bottom: 34px; box-shadow: var(--shadow); }
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li { display: flex; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.recent-list li:last-child { border-bottom: 0; }
.recent-list time { color: var(--pri); font-weight: 600; font-size: 13px; flex: none; width: 48px; }
.recent-list a { color: #374151; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-list a:hover { color: var(--pri); }
.rec-cat { color: var(--mut); font-size: 12px; flex: none; }
.section-more { color: var(--pri); font-size: 13px; }
.cat-section { margin: 44px 0; }
.my-hero { text-align: center; padding: 20px; }

@media (max-width: 760px) {
  .hero { padding: 38px 24px; }
  .spotlight { grid-template-columns: 1fr; }
  .sp-cover { min-height: 150px; }
  .article, .downloads, .comments { padding: 20px; }
  .site-header nav a { margin-left: 12px; font-size: 13px; }
  .hero-stats { gap: 16px; }
}

/* ===== 软件下载站风格（参考 uucom.cc）===== */
:root {
  --text-3: #98a2b3; --line2: #eef1f6; --header-h: 60px;
}
html[data-theme="dark"] {
  --bg: #141821; --card: #1c2230; --line: #2b3446; --line2: #242c3c;
  --txt: #e5e7eb; --mut: #9ca3af; --text-3: #6b7280;
  --pri: #818cf8; --pri2: #a78bfa; --shadow: 0 4px 20px rgba(0,0,0,.25);
}
/* 顶栏 */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--mut); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 34px; gap: 16px; }
.tb-left { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.tb-date { flex: none; font-weight: 600; color: var(--txt); }
.tb-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); flex: none; }
.tb-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-right { display: flex; gap: 14px; flex: none; }
.tb-right a { color: var(--mut); }
/* header 搜索/主题 */
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.search-mini { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; background: var(--bg); }
.search-mini input { border: 0; background: transparent; outline: none; font: inherit; font-size: 13px; color: var(--txt); width: 140px; }
.icon-btn { border: 1px solid var(--line); background: var(--card); color: var(--mut); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.nav-toggle { display: none; }
/* 焦点区 */
.focus { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin: 20px 0 28px; }
.focus > .hero { min-width: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line2); }
.panel-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.panel-head .bar, .card-title .bar { display: inline-block; width: 3px; height: 14px; background: var(--pri); border-radius: 2px; }
.panel-head .more { font-size: 12px; color: var(--mut); }
.latest-list { padding: 4px 0; }
.latest-item { display: grid; grid-template-columns: 66px 34px 1fr 42px; align-items: center; gap: 8px; padding: 7px 14px; border-bottom: 1px dashed var(--line2); }
.latest-item:last-child { border-bottom: 0; }
.latest-cat { font-size: 11px; color: var(--pri); background: #eef2ff; border-radius: 4px; padding: 2px 5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.latest-cover img, .latest-ph { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#eef2ff,#f3e8ff); color: var(--pri); font-size: 12px; }
.latest-title { margin: 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest-title a { color: var(--txt); }
.latest-time { font-size: 11px; color: var(--text-3); text-align: right; }
.latest-time.today { color: var(--pri); font-weight: 600; }
.focus-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.focus-side > .hero { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: relative; min-height: 220px; box-shadow: var(--shadow); }
.hero-slide { height: 100%; }
.hero-inner { position: relative; height: 100%; min-height: 220px; }
.hero-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 16px 14px; background: linear-gradient(transparent, rgba(0,0,0,.78)); color: #fff; }
.hero-text h1 { margin: 0 0 4px; font-size: 1.15rem; }
.hero-text p { margin: 0; font-size: 12px; opacity: .9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.focus-side-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 0; }
.focus-side-head h3 { margin: 0; font-size: 14px; }
.focus-side-head a { font-size: 12px; color: var(--mut); }
.headline-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.headline-list li { border-bottom: 1px dashed var(--line2); }
.headline-list li:last-child { border-bottom: 0; }
.headline-list a { display: flex; align-items: center; gap: 9px; padding: 8px 12px; font-size: 13px; }
.hnum { flex: none; width: 18px; height: 18px; border-radius: 4px; background: var(--line2); color: var(--mut); font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.hnum.hot { background: #ef4444; color: #fff; }
.htxt { color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 栏目导航 chips */
.cat-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 22px; }
/* 主布局 */
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.col-main { min-width: 0; }
.layout .panel { margin-bottom: 18px; }
.sec-body { padding: 14px 16px; }
.sec-lead { display: flex; gap: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--line2); margin-bottom: 8px; }
.cover-lg { flex: none; width: 150px; height: 92px; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg,#eef2ff,#f3e8ff); display: flex; align-items: center; justify-content: center; }
.cover-lg img { width: 100%; height: 100%; object-fit: cover; }
.cover-lg em { font-style: normal; color: var(--pri); font-weight: 700; }
.sec-lead-body { min-width: 0; }
.sec-lead-body h4 { margin: 0 0 6px; font-size: 14px; color: var(--txt); }
.sec-lead-body p { margin: 0; color: var(--mut); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sec-list { list-style: none; margin: 0; padding: 0; }
.sec-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--line2); }
.sec-list li:last-child { border-bottom: 0; }
.sec-list a { color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-list .t { flex: none; color: var(--text-3); font-size: 11px; }
/* 侧栏 */
.sidebar .card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-title { margin: 0 0 10px; font-size: 14px; }
.card-title > span { display: inline-flex; align-items: center; gap: 7px; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12px; border-bottom: 1px dashed var(--line2); }
.rank-list li:last-child { border-bottom: 0; }
.rk { flex: none; width: 18px; height: 18px; border-radius: 4px; background: var(--line2); color: var(--mut); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.rk.top { background: #ef4444; color: #fff; }
.rank-list a { color: var(--txt); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv { flex: none; color: var(--text-3); font-size: 11px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud a { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12px; color: var(--mut); }
.tag-cloud .count { margin-left: 4px; color: var(--text-3); font-size: 10px; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; }
/* 分类导轨 */
.cat-rail { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px; z-index: 15; }
.rail-item { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; font-size: 11px; color: var(--mut); box-shadow: var(--shadow); }
.rail-item:hover, .rail-item.active { background: var(--pri); color: #fff; border-color: var(--pri); }
/* 焦点区 hero 去掉内边距（用户要求） */
section.focus .hero { padding: 0; }
/* 友情链接单独一排 */
.links-row { margin: 20px 0 30px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; box-shadow: var(--shadow); }
.links-row h3 { margin: 0 0 12px; font-size: 14px; }
.links-row .link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 13px; }
.links-row .link-list a { color: var(--mut); }
.links-row .link-list a:hover { color: var(--pri); }

/* 回顶部 */
.to-top { position: fixed; right: 20px; bottom: 26px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--pri); font-size: 18px; cursor: pointer; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s; z-index: 20; }
.to-top.show { opacity: 1; pointer-events: auto; }
/* 模板 hero */
.tpl-hero { margin-bottom: 18px; }
/* 页脚网格 */
.site-footer .footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; text-align: left; }
.site-footer .footer-grid h4 { margin: 0 0 10px; color: #fff; font-size: 14px; }
.site-footer .footer-grid p { margin: 0 0 8px; }
.site-footer .footer-grid ul { list-style: none; margin: 0; padding: 0; }
.site-footer .footer-bottom { border-top: 1px solid #1f2937; margin-top: 20px; padding-top: 14px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
@media (max-width: 960px) {
  .focus { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .cat-rail { display: none; }
  .nav-toggle { display: inline-block; }
  .tb-sub { display: none; }
}

