
:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --ink: #18181b;
  --ink-soft: #4b5563;
  --muted: #9ca3af;
  --line: #e9eaee;
  --primary: #4f46e5;
  --primary-weak: #eef2ff;
  --accent: #7c3aed;
  --serif: Georgia, "Songti SC", "Noto Serif SC", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(17,24,39,.05);
  --shadow-lg: 0 10px 24px rgba(17,24,39,.08);
  --admin-bg: #f4f5f7;
  --sidebar: #151a23;
  --sidebar-text: #c3c9d4;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.8; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: rgba(79,70,229,.16); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.site-header .inner { max-width: 1120px; margin: 0 auto; padding: 13px 28px; display: flex; align-items: center; gap: 26px; }
.site-title { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; color: var(--ink); }
.site-title b { color: var(--primary); }
.site-title:hover { text-decoration: none; }
.site-logo { max-height: 40px; max-width: 180px; object-fit: contain; }
.site-brand { display: flex; flex-direction: column; gap: 1px; }
.site-tagline { font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.site-nav { display: flex; gap: 4px; flex: 1; }
.site-nav a { font-size: 14px; color: var(--ink-soft); padding: 7px 13px; border-radius: 9px; transition: all .15s; }
.site-nav a:hover, .site-nav a.active { color: var(--primary); background: var(--primary-weak); }
.search-box input { border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px 8px 34px; font-size: 13px; width: 170px; outline: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 12px center / 13px no-repeat; transition: border-color .15s, width .2s; }
.search-box input:focus { border-color: var(--primary); width: 210px; }

/* ---------- layout: main + sidebar ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 36px 28px 70px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 44px; }
.main { min-width: 0; }
.sidebar { position: sticky; top: 76px; align-self: start; display: flex; flex-direction: column; gap: 18px; }
.sbox { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.sbox > h3 { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.sbox > h3::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(var(--primary), var(--accent)); }

/* 关于 */
.sbox.about .who { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sbox.about .avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; flex-shrink: 0; }
.sbox.about .who b { font-size: 15px; display: block; }
.sbox.about .who span { font-size: 12.5px; color: var(--muted); }
.sbox.about p { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.sbox.about .sub { display: block; text-align: center; background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; padding: 9px 0; border-radius: 10px; transition: background .15s; }
.sbox.about .sub:hover { background: #4338ca; }

/* 广告 */
.ad-zone { margin: 20px 0; }
.ad-zone-top, .ad-zone-bottom { padding: 16px 0; text-align: center; display: flex; justify-content: center; }
.ad-zone-list { padding: 8px 0; }
.ad-zone-list:empty { display: none; }
.ad-item { padding: 12px 16px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line); font-size: 13px; color: var(--muted); text-align: center; }
.ad-item.ad-code { padding: 0; background: none; border: none; text-align: left; }
.ad-item.ad-image img { max-width: 100%; border-radius: 8px; display: block; margin: 0 auto; }
.ad-item.ad-text a { color: var(--primary); text-decoration: none; font-weight: 500; }
.ad-item.ad-text a:hover { text-decoration: underline; }
.ad-sbox { margin-top: 16px; }
.ad-sbox .ad-item { border: none; background: none; padding: 0; border-radius: 0; }

/* 分类 */
.cats li { list-style: none; }
.cats a { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--ink-soft); padding: 7px 0; border-bottom: 1px dashed var(--line); transition: color .15s; }
.cats li:last-child a { border-bottom: none; }
.cats a:hover { color: var(--primary); }
.cats .n { font-size: 11.5px; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 0 9px; }
.cats a:hover .n { color: var(--primary); background: var(--primary-weak); }

/* 最近发表 */
.recent li { list-style: none; }
.recent a { display: block; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.recent li:last-child a { border-bottom: none; }
.recent .t { font-size: 13.5px; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recent a:hover .t { color: var(--primary); }
.recent .d { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* 标签 */
.tags-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tags-cloud a { font-size: 12.5px; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--line); padding: 4px 12px; border-radius: 8px; transition: all .15s; }
.tags-cloud a:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-weak); }

/* 归档 */
.arch li { list-style: none; }
.arch a { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-soft); padding: 6px 0; }
.arch a:hover { color: var(--primary); }
.arch .n { color: var(--muted); font-size: 11.5px; }

/* 目录 */
.toc { max-height: 360px; overflow-y: auto; }
.toc a { display: block; font-size: 13.5px; color: var(--ink-soft); padding: 6px 0 6px 14px; border-left: 2px solid var(--line); transition: all .15s; }
.toc a:hover, .toc a.active { color: var(--primary); border-left-color: var(--primary); }
.toc a.l2 { padding-left: 28px; font-size: 13px; }

/* 热门 */
.hot li { list-style: none; }
.hot a { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.hot li:last-child a { border-bottom: none; }
.hot .rank { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--line); }
.hot li:nth-child(-n+3) .rank { color: var(--primary); }
.hot .t { font-size: 13.5px; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hot a:hover .t { color: var(--primary); }

/* ---------- main: featured hero ---------- */
.featured { margin-bottom: 26px; }
.featured .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 34px; align-items: center; }
.featured .cover { aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.featured .cover img { width: 100%; height: 100%; object-fit: cover; }
.featured .tagline { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); font-weight: 700; margin-bottom: 12px; }
.featured h1 { font-family: var(--serif); font-size: 32px; line-height: 1.25; letter-spacing: -.02em; margin-bottom: 14px; }
.featured h1 a:hover { color: var(--primary); }
.featured p { color: var(--ink-soft); font-size: 15px; max-width: 46ch; margin-bottom: 18px; }
.featured .read { font-size: 13.5px; font-weight: 600; color: var(--primary); border-bottom: 2px solid var(--primary); padding-bottom: 2px; }
.featured .read:hover { color: #4338ca; }
.featured .meta { color: var(--muted); font-size: 12.5px; margin-top: 16px; }
.featured .meta span + span::before { content: "·"; margin: 0 7px; }

/* ---------- main: list ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 20px; margin-bottom: 18px; }
.sec-head h2 { font-family: var(--serif); font-size: 21px; }
.post-list article { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; margin-bottom: 16px; transition: transform .2s, box-shadow .2s, border-color .2s; }
.post-list article:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #d7dae2; }
.post-list .cover-img { width: calc(100% + 48px); margin: -20px -24px 16px; aspect-ratio: 16/7; object-fit: cover; }
.post-list .cat { font-size: 12px; color: var(--primary); font-weight: 700; letter-spacing: .05em; margin-bottom: 6px; }
.post-list h3 { font-family: var(--serif); font-size: 19px; margin: 6px 0 8px; line-height: 1.4; }
.post-list h3 a { color: var(--ink); }
.post-list h3 a:hover { color: var(--primary); }
.post-list .excerpt { color: var(--ink-soft); font-size: 14px; margin: 0 0 10px; line-height: 1.7; }
.post-list .meta { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.post-list .meta span + span::before { content: "·"; margin: 0 7px; }

/* ---------- buttons / pagination / like ---------- */
.btn { display: inline-block; background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 9px 20px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, transform .1s, box-shadow .15s; }
.btn:hover { background: #4338ca; text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.outline { background: var(--surface); color: var(--primary); border: 1px solid var(--line); }
.btn.outline:hover { border-color: var(--primary); background: var(--primary-weak); color: var(--primary); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.pagination { display: flex; justify-content: center; margin-top: 30px; }
.pagination .btn { background: var(--surface); color: var(--primary); border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-radius: 999px; padding: 10px 24px; }
.pagination .btn:hover { border-color: var(--primary); background: var(--primary-weak); }
.like-bar { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.like-wrap { display: inline-flex; }
.like-btn { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 700; font-size: 14px; padding: 10px 26px; border: none; border-radius: 999px; box-shadow: 0 6px 18px rgba(79,70,229,.32); transition: transform .15s; cursor: pointer; }
.like-btn:hover { transform: translateY(-2px); color: #fff; }
.like-btn:disabled { opacity: 1; cursor: default; }
.like-count { font-weight: 700; }

/* ---------- article ---------- */
.article { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 44px 46px; }
.article .cat { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); font-weight: 700; margin-bottom: 14px; }
.article h1 { font-family: var(--serif); font-size: 34px; line-height: 1.28; letter-spacing: -.02em; margin: 0 0 18px; }
.article .byline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.article .avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.article .byline span + span::before { content: "·"; margin: 0 8px; }
.article .cover { width: 100%; aspect-ratio: 16/7; object-fit: cover; border-radius: 12px; margin-bottom: 30px; }

/* content */
.content { font-size: 16px; }
.content > *:first-child { margin-top: 0; }
.content p { margin: 0 0 1.3em; color: #26272c; }
.content h2 { font-size: 22px; font-weight: 700; margin: 2em 0 .8em; padding-left: 13px; border-left: 4px solid var(--primary); }
.content h3 { font-size: 18px; font-weight: 700; margin: 1.8em 0 .6em; }
.content a { color: var(--primary); border-bottom: 1px solid rgba(79,70,229,.4); }
.content a:hover { color: #4338ca; border-color: var(--primary); }
.content ul, .content ol { margin: 0 0 1.3em; padding-left: 1.5em; }
.content li { margin: .3em 0; }
.content li::marker { color: var(--primary); }
.content blockquote { margin: 1.6em 0; padding: 14px 20px; background: var(--primary-weak); border-radius: 10px; border-left: 3px solid var(--primary); color: #4338ca; }
.content blockquote p { margin-bottom: .3em; color: inherit; }
.content pre { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 20px 24px; font-family: var(--mono); font-size: 13.5px; line-height: 1.75; overflow-x: auto; margin: 1.6em 0; position: relative; }
.content pre::before { content: "●●●"; position: absolute; top: 14px; right: 18px; letter-spacing: 4px; font-size: 10px; color: #475569; }
.content code { font-family: var(--mono); font-size: .88em; background: #f1f3f6; border: 1px solid #e6e9ef; border-radius: 5px; padding: 2px 6px; color: #0f766e; }
.content pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
.content img { border-radius: 10px; margin: 1.4em 0; box-shadow: 0 6px 20px rgba(17,24,39,.1); }
.content table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 1.6em 0; }
.content th, .content td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.content th { background: #f8f9fb; font-weight: 700; }
.content tr:nth-child(even) td { background: #fafbfd; }
.content hr { border: none; border-top: 1px dashed var(--line); margin: 2.4em auto; width: 50%; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tags a { font-size: 13px; color: var(--primary); background: var(--primary-weak); padding: 5px 14px; border-radius: 8px; }
.tags a:hover { background: #e0e7ff; }

/* ---------- comments ---------- */
.comments { margin-top: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 34px; }
.comments h2 { font-family: var(--serif); font-size: 19px; margin-bottom: 18px; }
.comment-list { margin-top: 18px; }
.comment { display: flex; gap: 13px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment:last-of-type { border-bottom: none; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #22d3ee, #6366f1); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.comment-head strong { font-size: 14px; }
.comment-time { font-size: 12px; color: var(--muted); }
.comment-body { font-size: 14.5px; color: #334155; margin-top: 4px; white-space: pre-wrap; overflow-wrap: break-word; }
.comment-form { margin-top: 18px; display: grid; gap: 12px; }
.comment-form .hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.comment-form .form-grid { display: grid; gap: 12px; }
.comment-form .field { margin-bottom: 0; }
.comment-form input, .comment-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; font-size: 14px; font-family: inherit; outline: none; background: var(--surface); }
.comment-form textarea { min-height: 90px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.comment-form label { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: block; color: var(--ink-soft); }
.comment-form .hint { font-size: 12px; color: var(--muted); margin-left: 10px; }
.comment-form .btn { justify-self: start; }

/* ---------- page title / sub ---------- */
.page-title { font-family: var(--serif); font-size: 26px; font-weight: 700; margin: 6px 0 20px; }
.page-sub { color: var(--muted); font-size: 14px; margin: -12px 0 20px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 30px 28px 44px; }
.site-footer > div { max-width: 1120px; margin: 0 auto; display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }

/* ---------- alert ---------- */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ---------- admin ---------- */
.admin-wrap { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar { width: 236px; background: var(--surface); border-right: 1px solid var(--line); flex-shrink: 0; padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.admin-brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); padding: 2px 8px 20px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.admin-brand .mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; box-shadow: 0 4px 12px rgba(79,70,229,.3); }
.admin-brand .txt span { color: var(--primary); }
.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; color: var(--ink-soft); font-size: 14px; border-radius: 10px; transition: color .15s, background .15s; }
.admin-nav a:hover { color: var(--primary); background: var(--primary-weak); }
.admin-nav a.active { color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 4px 14px rgba(79,70,229,.32); }
.admin-nav a .ico { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.admin-main { flex: 1; padding: 26px 34px 60px; max-width: 1120px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-topbar h1 { font-family: var(--serif); font-size: 24px; letter-spacing: -.02em; margin: 0; }
.admin-user { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 14px; }
.admin-user .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.admin-user em { font-style: normal; opacity: .8; }
.admin-user a { color: var(--ink-soft); }
.admin-user a:hover { color: var(--primary); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.card h2 { margin: 0 0 16px; font-size: 16px; display: flex; align-items: center; gap: 9px; font-family: var(--serif); }
.card h2::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: linear-gradient(var(--primary), var(--accent)); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 9px; transition: transform .18s, box-shadow .18s; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--sc, var(--primary)), var(--accent)); }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-ico { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--sc, var(--primary)), var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(79,70,229,.22); }
.stat-ico svg { width: 18px; height: 18px; }
.stat-num { font-size: 26px; font-weight: 700; line-height: 1.05; }
.stat-label { color: var(--muted); font-size: 13px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; font-size: 13px; background: #fafafa; }
.badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; }
.badge.published { background: #dcfce7; color: #166534; }
.badge.draft { background: #fef3c7; color: #92400e; }
.badge.trash { background: #e5e7eb; color: #4b5563; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.approved { background: #dcfce7; color: #166534; }
.badge.spam { background: #fee2e2; color: #991b1b; }
.badge.scheduled { background: #dbeafe; color: #1e40af; }
.trend { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 6px 2px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.trend-bar { width: 70%; max-width: 36px; background: linear-gradient(180deg, var(--primary), var(--accent)); border-radius: 6px 6px 0 0; min-height: 2px; transition: filter .15s; }
.trend-col:hover .trend-bar { filter: brightness(1.12); }
.trend-count { font-size: 12px; color: var(--muted); line-height: 1; }
.trend-day { font-size: 12px; color: var(--muted); }
.comment-admin { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.comment-admin-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-admin-head span.badge { font-size: 11px; }
.comment-admin-body { font-size: 14px; line-height: 1.6; color: var(--ink); margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: break-word; }
.comment-admin-actions { display: flex; gap: 8px; }
.row-actions { display: flex; gap: 10px; font-size: 13px; }
.tag-rename { display: flex; align-items: center; gap: 8px; }
.tag-rename .tag-hash { color: var(--muted); }
.tag-rename input { width: 120px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 13px; font-family: inherit; outline: none; }
.tag-rename input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=datetime-local], .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 14px; font-family: inherit; background: var(--surface); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.field textarea { min-height: 120px; resize: vertical; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.field.full { grid-column: 1 / -1; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.checkbox input { width: 16px; height: 16px; }

#vditor { z-index: 0; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.media-item { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.media-item img { width: 100%; height: 120px; object-fit: cover; display: block; background: #eee; }
.media-item .meta { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.media-item .meta .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-item .actions { display: flex; gap: 8px; padding: 0 10px 8px; font-size: 12px; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); position: relative; overflow: hidden; padding: 24px; }
.auth-glow { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; }
.auth-glow.g1 { width: 440px; height: 440px; background: radial-gradient(circle, rgba(79,70,229,.45), rgba(79,70,229,0) 70%); top: -140px; left: -120px; }
.auth-glow.g2 { width: 480px; height: 480px; background: radial-gradient(circle, rgba(34,211,238,.35), rgba(34,211,238,0) 70%); bottom: -160px; right: -140px; }
.auth-glow.g3 { width: 340px; height: 340px; background: radial-gradient(circle, rgba(124,58,237,.3), rgba(124,58,237,0) 70%); top: 45%; left: 58%; }
.auth-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 42px 40px 34px; width: 380px; box-shadow: 0 20px 50px rgba(17,24,39,.10); }
.auth-brand { display: flex; justify-content: center; margin-bottom: 4px; }
.auth-logo { width: 52px; height: 52px; border-radius: 15px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 25px; font-weight: 700; box-shadow: 0 10px 24px rgba(79,70,229,.35); }
.auth-title { font-family: var(--serif); font-size: 24px; letter-spacing: -.02em; margin: 14px 0 6px; text-align: center; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 26px; text-align: center; }
.auth-submit { width: 100%; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 6px 18px rgba(79,70,229,.32); }
.auth-submit:hover { background: linear-gradient(135deg, #4338ca, #6d28d9); }
.auth-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.auth-foot a { color: var(--muted); }
.auth-foot a:hover { color: var(--primary); }
.captcha-field { margin-bottom: 16px; }
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-img { height: 40px; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); background: #f3f4f6; flex-shrink: 0; }
.captcha-img:hover { opacity: .85; }
.captcha-input { flex: 1; min-width: 0; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tabs a { padding: 6px 14px; border-radius: 8px; font-size: 13px; color: var(--muted); background: #f3f4f6; }
.tabs a.active { background: var(--primary); color: #fff; }
.tabs a:hover { text-decoration: none; }

@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; gap: 32px; }
  .sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .article { padding: 28px 24px; }
}
@media (max-width: 720px) {
  .site-header .inner { flex-wrap: wrap; gap: 12px; }
  .site-nav { order: 3; flex-basis: 100%; overflow-x: auto; gap: 6px; }
  .featured .wrap { grid-template-columns: 1fr; gap: 22px; }
  .featured h1 { font-size: 25px; }
  .admin-sidebar { width: 64px; padding: 22px 10px; }
  .admin-sidebar .admin-brand { justify-content: center; padding: 2px 0 20px; }
  .admin-sidebar .admin-brand .txt, .admin-sidebar .admin-nav a .txt { display: none; }
  .admin-sidebar .admin-nav a { justify-content: center; padding: 10px; }
  .admin-sidebar .admin-nav a .ico { width: 20px; height: 20px; }
  .auth-card { width: 92vw; padding: 32px 24px 28px; }
  .auth-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .form-grid, .editor { grid-template-columns: 1fr; }
  .container { padding: 22px 16px 60px; }
  .article h1 { font-size: 26px; }
  .article { padding: 22px 20px; border-radius: 14px; }
  .comments { padding: 20px 18px; }
  .sidebar { grid-template-columns: 1fr; }
}

/* HTMX loading indicator */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
.htmx-settling .htmx-indicator { display: none; }
.htmx-loading { opacity: .5; transition: opacity 200ms; }
.htmx-loading .htmx-indicator { display: inline-block; }
#loading-bar { position: fixed; top: 0; left: 0; width: 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); z-index: 9999; transition: width 200ms; }
.htmx-request #loading-bar { width: 40%; }
.htmx-settling #loading-bar { width: 100%; transition: width 400ms ease-out; }
.htmx-after-settled #loading-bar { width: 100%; opacity: 0; transition: opacity 300ms; }

/* 防重复点击状态 */
.btn-loading { position: relative; pointer-events: none; opacity: .7; }
.btn-loading::after { content: ''; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: btn-spin .6s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
button:disabled, input[type="submit"]:disabled { cursor: not-allowed; }
.form-submitting { pointer-events: none; }

/* 筛选器 */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.filter-label { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-right: 2px; white-space: nowrap; }
.filter-chip { font-size: 13px; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--line); padding: 5px 14px; border-radius: 8px; transition: all .15s; text-decoration: none; cursor: pointer; }
.filter-chip:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-weak); }
.filter-chip.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.filter-chip.active:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-chip .n { font-size: 11px; margin-left: 3px; opacity: .7; }

/* 文章卡片导航反馈 */
.card-navigating { pointer-events: none; opacity: .6; }
.card-navigating .excerpt { color: var(--primary); font-weight: 600; }
.card-navigating .cover-img { filter: brightness(.6); }
.link-loading { pointer-events: none; }
.post-card, .featured-card, article { transition: opacity .15s; }
