/* 小刘科技博客系统 - 子页面共享样式（与首页同一设计体系） */
:root {
  --bg: #05070d;
  --panel: rgba(13, 20, 34, .72);
  --line: rgba(120, 180, 220, .12);
  --line-bright: rgba(34, 211, 238, .45);
  --cyan: #22d3ee;
  --red: #f87171;
  --green: #34d399;
  --text: #e6eef7;
  --text-dim: #8ea3b8;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 14px;
  --nav-h: 68px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--cyan); color: #04202a; }

.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 180, 220, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 180, 220, .05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}
.bg-fx {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(700px 500px at 8% 30%, rgba(14, 116, 144, .14), transparent 65%);
}

.wrap { width: min(1000px, 92%); margin: 0 auto; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(5, 7, 13, .72);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(34,211,238,.18), rgba(14,116,144,.08));
  border: 1px solid var(--line-bright); color: var(--cyan); flex: none;
}
.brand-name { font-weight: 900; font-size: 1.05rem; letter-spacing: .04em; }
.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a {
  color: var(--text-dim); text-decoration: none; font-size: .9rem;
  padding: 8px 14px; border-radius: 8px; transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--cyan); background: rgba(34, 211, 238, .07); }
.nav-links a.active { color: var(--cyan); border: 1px solid var(--line-bright); }

main { padding: calc(var(--nav-h) + 56px) 0 90px; }

/* ---------- 页面标题 ---------- */
.page-head { margin-bottom: 40px; }
.sec-kicker {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .22em;
  color: var(--cyan); text-transform: uppercase;
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.sec-kicker::before { content: ""; width: 34px; height: 1px; background: var(--cyan); }
.page-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 900; }
.page-desc { color: var(--text-dim); margin-top: 10px; font-weight: 300; }

/* ---------- 卡片 / 面板 ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); backdrop-filter: blur(10px);
}

/* ---------- 文章列表 ---------- */
.post-card {
  display: block; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; margin-bottom: 16px;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s;
}
.post-card:hover {
  transform: translateY(-4px); border-color: var(--line-bright);
  box-shadow: 0 18px 46px rgba(0,0,0,.4), 0 0 26px rgba(34,211,238,.08);
}
.post-meta {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  font-family: var(--mono); font-size: .72rem; color: var(--text-dim); letter-spacing: .06em;
}
.badge {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-bright); color: var(--cyan);
}
.badge.ann { color: #fbbf24; border-color: rgba(251, 191, 36, .45); }
.post-card h3 { font-size: 1.18rem; font-weight: 700; margin-bottom: 8px; transition: color .2s; }
.post-card:hover h3 { color: var(--cyan); }
.post-card p { color: var(--text-dim); font-size: .9rem; font-weight: 300; }

.empty {
  text-align: center; color: var(--text-dim); padding: 60px 20px;
  border: 1px dashed var(--line); border-radius: var(--radius); font-size: .92rem;
}
.empty a { color: var(--cyan); text-decoration: none; }
.empty a:hover { text-decoration: underline; }

/* ---------- 文章详情 ---------- */
.article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(28px, 5vw, 56px); }
.article h1 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 900; line-height: 1.35; margin-bottom: 14px; }
.article .post-meta { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.article-body p { margin-bottom: 1.1em; color: #c6d4e3; font-weight: 300; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
  color: var(--text-dim); text-decoration: none; font-family: var(--mono); font-size: .8rem;
  transition: color .2s;
}
.back-link:hover { color: var(--cyan); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-family: var(--mono); font-size: .74rem; letter-spacing: .1em;
  color: var(--text-dim); margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%; background: rgba(5, 7, 13, .6);
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-family: var(--sans); font-size: .94rem;
  padding: 12px 16px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 180px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--line-bright); box-shadow: 0 0 0 3px rgba(34, 211, 238, .12);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--mono); font-size: .86rem; font-weight: 500;
  padding: 12px 24px; border-radius: 10px; border: none; cursor: pointer;
  text-decoration: none; transition: transform .2s, box-shadow .25s, background .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { color: #04222b; background: linear-gradient(120deg, var(--cyan), #38bdf8); box-shadow: 0 8px 26px rgba(34,211,238,.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(34,211,238,.38); }
.btn-ghost { color: var(--text); background: rgba(13,20,34,.5); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--line-bright); color: var(--cyan); }
.btn-danger { color: var(--red); background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.35); }
.btn-danger:hover { background: var(--red); color: #2b0404; }
.btn-sm { padding: 8px 16px; font-size: .76rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---------- 提示 Toast ---------- */
#toast {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%) translateY(-16px);
  background: rgba(8, 12, 22, .95); border: 1px solid var(--line-bright);
  color: var(--text); font-size: .88rem; padding: 12px 24px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
  z-index: 999; max-width: 88%; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: rgba(248,113,113,.5); color: #fca5a5; }

/* ---------- 后台 ---------- */
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.tabs { display: flex; gap: 8px; }
.tab {
  font-family: var(--mono); font-size: .8rem; color: var(--text-dim);
  background: none; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 20px; cursor: pointer; transition: all .2s;
}
.tab:hover { color: var(--cyan); }
.tab.active { color: var(--cyan); border-color: var(--line-bright); background: rgba(34,211,238,.08); }
.tab svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.tab.busy { opacity: .55; cursor: progress; pointer-events: none; }
.tab.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 移动端标签栏横向滚动，保证所有入口可达 */
@media (max-width: 720px) {
  .tabs {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 6px; scrollbar-width: none; width: 100%;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; white-space: nowrap; }
}

.admin-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 12px;
}
.admin-row-main { flex: 1; min-width: 0; }
.admin-row-title { font-weight: 700; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row-meta { font-family: var(--mono); font-size: .68rem; color: var(--text-dim); margin-top: 4px; }
.admin-row-actions { display: flex; gap: 8px; flex: none; }

.login-panel { max-width: 420px; margin: 40px auto; padding: 40px 36px; }
.login-panel h1 { font-size: 1.4rem; font-weight: 900; text-align: center; margin-bottom: 6px; }
.login-panel .sub { text-align: center; color: var(--text-dim); font-size: .85rem; margin-bottom: 30px; font-weight: 300; }

.editor-panel { padding: 30px 28px; margin-bottom: 30px; }
.editor-panel h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }
.editor-actions { display: flex; gap: 12px; justify-content: flex-end; }

.hidden { display: none !important; }

/* ---------- 管理端全局背景图 ---------- */
.admin-bg {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background: url('admin-bg.jpg') center / cover no-repeat;
}
.admin-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,7,13,.88), rgba(5,7,13,.80) 45%, rgba(5,7,13,.92));
}
@media (max-width: 640px) {
  .admin-bg { background-position: 62% center; } /* 移动端聚焦主体区域 */
}

/* ---------- 数据面板 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; transition: border-color .3s, transform .3s;
}
.stat-card:hover { border-color: var(--line-bright); transform: translateY(-3px); }
.stat-num { font-family: var(--mono); font-size: 1.8rem; font-weight: 700; color: var(--cyan); line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--text-dim); margin-top: 6px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.chart-panel { padding: 26px 24px; margin-bottom: 22px; }
.chart-panel h3, .log-panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: 20px; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bar {
  width: 100%; max-width: 46px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--cyan), rgba(34,211,238,.15));
  min-height: 3px; transition: height .5s cubic-bezier(.2,.8,.2,1);
  position: relative;
}
.chart-bar:hover::after {
  content: attr(data-v); position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: .68rem; color: var(--cyan);
}
.chart-day { font-family: var(--mono); font-size: .66rem; color: var(--text-dim); }

/* ---------- 日志 / 评论 / 用户 ---------- */
.log-panel { padding: 26px 24px; }
.log-row {
  display: flex; gap: 14px; align-items: baseline; font-size: .85rem;
  padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--text-dim);
}
.log-row:last-child { border-bottom: none; }
.log-row .who { color: var(--cyan); font-family: var(--mono); font-size: .76rem; flex: none; }
.log-row .what { color: var(--text); flex: none; }
.log-row .detail { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row .when { font-family: var(--mono); font-size: .68rem; flex: none; }

.status-badge { font-family: var(--mono); font-size: .66rem; padding: 2px 10px; border-radius: 999px; flex: none; }
.status-pending  { color: #fbbf24; border: 1px solid rgba(251,191,36,.4); }
.status-approved { color: var(--green); border: 1px solid rgba(52,211,153,.4); }
.status-rejected { color: var(--red); border: 1px solid rgba(248,113,113,.4); }
.role-badge { font-family: var(--mono); font-size: .66rem; padding: 2px 10px; border-radius: 999px; color: var(--cyan); border: 1px solid var(--line-bright); }
.role-badge.editor { color: var(--text-dim); border-color: var(--line); }

.comment-body { font-size: .88rem; color: #c6d4e3; margin-top: 6px; font-weight: 300; }

/* 批量操作栏 */
.batch-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 18px; margin-bottom: 14px;
  background: rgba(34,211,238,.05); border: 1px solid var(--line); border-radius: 12px;
  font-size: .84rem; color: var(--text-dim);
}
.batch-bar b { color: var(--cyan); font-family: var(--mono); }
.row-check { width: 16px; height: 16px; accent-color: var(--cyan); cursor: pointer; flex: none; }

/* 后台子标签（评论状态筛选等） */
.sub-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.sub-tab {
  font-family: var(--mono); font-size: .72rem; color: var(--text-dim);
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px; cursor: pointer; transition: all .2s;
}
.sub-tab:hover { color: var(--cyan); }
.sub-tab.active { color: var(--cyan); border-color: var(--line-bright); background: rgba(34,211,238,.08); }

/* 评论区（前台文章页） */
.comments { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.comments h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 18px; }
.comment-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-item:last-child { border-bottom: none; }
.comment-item .c-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.comment-item .c-author { font-weight: 700; font-size: .9rem; color: var(--cyan); }
.comment-item .c-date { font-family: var(--mono); font-size: .68rem; color: var(--text-dim); }
.comment-item .c-body { font-size: .9rem; color: #c6d4e3; font-weight: 300; }
.comment-form { margin-top: 22px; }
.comment-form .row { display: grid; grid-template-columns: 1fr; gap: 14px; }

/* ---------- 安装向导 ---------- */
.install-panel { max-width: 480px; margin: 40px auto; padding: 42px 38px; }
.install-steps { display: flex; gap: 8px; justify-content: center; margin-bottom: 30px; }
.install-steps span { width: 34px; height: 4px; border-radius: 2px; background: var(--line); }
.install-steps span.on { background: var(--cyan); }
.install-done { text-align: center; }
.install-done .ok-icon {
  width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%;
  display: grid; place-items: center; color: var(--green);
  border: 1px solid rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .08);
}
.install-done h1 { font-size: 1.35rem; margin-bottom: 10px; }
.install-done p { color: var(--text-dim); font-size: .9rem; margin-bottom: 28px; font-weight: 300; }
.install-done .links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  .admin-row { flex-wrap: wrap; }
  .admin-row-actions { width: 100%; justify-content: flex-end; }
  .login-panel, .install-panel { padding: 32px 24px; }
}
