/* ===== 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; }

@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; }
}
