/* 拾光热榜 · 全站样式 */
:root {
  --primary: #6268ee;
  --primary-dark: #4e54cc;
  --accent: #ef6c45;
  --accent-dark: #d65a34;
  --text: #172033;
  --text-soft: #657084;
  --text-muted: #9aa3b7;
  --bg: #f7f8fc;
  --bg-soft: #eef0f8;
  --card: #ffffff;
  --border: #edf0f5;
  --border-dark: #dfe5ed;
  --shadow: 0 2px 10px rgba(112, 120, 200, 0.08);
  --shadow-hover: 0 8px 28px rgba(112, 120, 200, 0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ============== 前台顶部 ============== */
.site-head {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 5%;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.site-head .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
  font-weight: 800;
  color: var(--primary);
}
.site-head .brand .logo { font-size: 24px; }
.site-head .brand .tagline { font-size: 13px; color: var(--text-muted); font-weight: 400; margin-left: 8px; }
.site-head .tools { display: flex; gap: 14px; align-items: center; }
.site-head .tools a { color: var(--text-soft); }
.site-head .nav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 4px;
}
.site-head .nav-tabs a {
  white-space: nowrap;
  padding: 9px 16px;
  border-radius: 22px;
  color: var(--text-soft);
  text-decoration: none;
  background: transparent;
  font-size: 14px;
}
.site-head .nav-tabs a:hover { background: var(--bg-soft); text-decoration: none; }
.site-head .nav-tabs a.on {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 5px 12px rgba(98, 104, 238, 0.25);
}

/* ============== 公告 ============== */
.notice {
  background: linear-gradient(135deg, #fffaf0, #fff5e1);
  border: 1px solid #ffe1b1;
  color: #8a5a00;
  padding: 10px 18px;
  border-radius: var(--radius);
  margin: 14px 5%;
  font-size: 14px;
}

/* ============== 容器 ============== */
.wrap { max-width: 1180px; margin: 0 auto; padding: 30px 5%; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 30px 20px; }

/* ============== 分类网格（PC 首页：3 列） ============== */
.cats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
}
.cat-card {
  min-height: 180px;
  border-radius: var(--radius-lg);
  padding: 28px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 7px 20px rgba(74, 85, 104, 0.16);
  position: relative;
  overflow: hidden;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(74, 85, 104, 0.28); text-decoration: none; }
.cat-card .icon { font-size: 36px; margin-bottom: 12px; }
.cat-card .name { font-size: 23px; font-weight: 800; margin-bottom: 6px; }
.cat-card .desc { font-size: 13px; opacity: 0.9; }
.cat-card .lock { position: absolute; top: 16px; right: 16px; background: rgba(0, 0, 0, 0.25); color: #fff; padding: 5px 10px; border-radius: 12px; font-size: 12px; }
.cat-card .count { position: absolute; top: 16px; left: 16px; background: rgba(255, 255, 255, 0.25); color: #fff; padding: 5px 10px; border-radius: 12px; font-size: 12px; }
.cat-card.c1 { background: linear-gradient(135deg, #5ca6ff, #4484ec); }
.cat-card.c2 { background: linear-gradient(135deg, #22bfd1, #168aa4); }
.cat-card.c3 { background: linear-gradient(135deg, #2dcc9a, #10a879); }
.cat-card.c4 { background: linear-gradient(135deg, #a886f5, #7166df); }
.cat-card.c5 { background: linear-gradient(135deg, #ff9e75, #ef6c45); }
.cat-card.c6 { background: linear-gradient(135deg, #f3c969, #e39524); }
.cat-card.c7 { background: linear-gradient(135deg, #ef6c45, #c9522e); }
.cat-card.c8 { background: linear-gradient(135deg, #6268ee, #4e54cc); }

/* ============== 首页介绍 ============== */
.intro { text-align: center; margin: 20px 0 10px; }
.intro h1 { font-size: 30px; margin: 8px 0 6px; color: var(--text); }
.intro p { color: var(--text-muted); margin: 0; }

/* ============== 月份切换 ============== */
.months {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 14px 5%;
  padding-bottom: 4px;
}
.months button {
  white-space: nowrap;
  padding: 7px 14px;
  border: 1px solid var(--border-dark);
  background: #fff;
  border-radius: 8px;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.months button.on { border-color: var(--primary); background: var(--primary); color: #fff; }

/* ============== 文章卡片 ============== */
.posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 12px 5%; }
.post-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); text-decoration: none; }
.post-card .cover {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #5ca6ff, #4484ec);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  position: relative;
  overflow: hidden;
}
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.post-card .cover .pin { position: absolute; top: 10px; left: 10px; background: rgba(255, 255, 255, 0.9); color: #ef6c45; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.post-card .body { padding: 16px 18px 18px; }
.post-card .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.post-card .meta .tag { background: var(--bg-soft); color: var(--primary); padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.post-card h2 { font-size: 17px; margin: 0 0 6px; line-height: 1.4; color: var(--text); }
.post-card .excerpt { font-size: 13px; color: var(--text-soft); margin: 0; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 14px; }

/* ============== 分类页 wrapper ============== */
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 14px 5% 0; }
.section-head .crumb { color: var(--text-muted); font-size: 13px; }
.section-head .crumb a { color: var(--text-soft); }
.section-head .share { color: var(--primary); font-size: 13px; cursor: pointer; background: none; border: none; }

/* ============== 分页 ============== */
.pager { display: flex; justify-content: center; gap: 6px; margin: 30px 5%; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 8px 14px;
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 14px;
  background: #fff;
}
.pager a:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.pager .on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager .disabled { color: var(--text-muted); cursor: not-allowed; }

/* ============== 文章详情 ============== */
.article-head { padding: 18px 0; }
.article-head .meta { color: var(--text-muted); font-size: 13px; margin-bottom: 10px; }
.article-head .meta .tag { color: var(--primary); }
.article-head h1 { font-size: 28px; line-height: 1.4; margin: 0 0 12px; color: var(--text); }
.article-head .lead { color: var(--text-soft); font-size: 15px; line-height: 1.7; background: var(--bg-soft); padding: 14px 18px; border-radius: var(--radius); border-left: 4px solid var(--primary); }

.article-cover { width: 100%; max-height: 540px; object-fit: cover; border-radius: var(--radius); margin: 20px 0; }

.article-body { font-size: 16px; line-height: 1.85; color: var(--text); }
.article-body h2 { font-size: 22px; margin: 30px 0 14px; padding-left: 12px; border-left: 4px solid var(--primary); color: var(--text); }
.article-body h3 { font-size: 18px; margin: 24px 0 10px; color: var(--text); }
.article-body strong { font-weight: 700; color: var(--text); }
.article-body p { margin: 0 0 16px; }
.article-body blockquote {
  background: var(--bg-soft);
  border-left: 4px solid var(--accent);
  padding: 12px 18px;
  margin: 18px 0;
  color: var(--text-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.article-body hr { border: 0; border-top: 1px dashed var(--border-dark); margin: 30px 0; }
.article-body img { max-width: 100%; border-radius: var(--radius); margin: 14px 0; box-shadow: var(--shadow); cursor: pointer; }
.article-body video { max-width: 100%; border-radius: var(--radius); margin: 14px 0; box-shadow: var(--shadow); }
.article-body ul, .article-body ol { padding-left: 22px; margin: 0 0 16px; }
.article-body li { margin: 4px 0; }

.article-actions { display: flex; gap: 14px; margin: 30px 0; flex-wrap: wrap; }
.article-actions a {
  flex: 1;
  min-width: 140px;
  text-align: center;
  background: var(--accent);
  color: #fff !important;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.2s;
}
.article-actions a:hover { background: var(--accent-dark); text-decoration: none; }
.article-actions a.secondary { background: #fff; color: var(--primary) !important; border: 2px solid var(--primary); }
.article-actions a.secondary:hover { background: var(--primary); color: #fff !important; }

.related { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); }
.related h3 { font-size: 18px; margin: 0 0 16px; }
.related-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.related-list a {
  background: #fff;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.related-list a:hover { border-color: var(--primary); text-decoration: none; }
.related-list .thumb { width: 50px; height: 50px; border-radius: 6px; background: var(--bg-soft); flex-shrink: 0; overflow: hidden; }
.related-list .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ============== 密码锁 ============== */
.lock {
  max-width: 420px;
  margin: 60px auto;
  background: #fff;
  border-radius: var(--radius);
  padding: 36px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}
.lock .icon { font-size: 48px; margin-bottom: 16px; }
.lock h2 { font-size: 22px; margin: 0 0 10px; }
.lock p { color: var(--text-muted); margin: 0 0 24px; font-size: 14px; }
.lock input { width: 100%; padding: 12px; border: 1px solid var(--border-dark); border-radius: 6px; font-size: 15px; margin-bottom: 12px; }
.lock button { width: 100%; padding: 13px; background: var(--primary); color: #fff; border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; }
.lock button:hover { background: var(--primary-dark); }
.lock .err { color: var(--accent); background: #fff4f0; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 13px; }
.lock .badge { display: inline-block; padding: 6px 12px; background: #f3f4f6; color: #374151; border-radius: 14px; font-size: 12px; text-decoration: none; transition: all .15s; }
.lock .badge:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }
.lock .badge-locked { background: #fff4f0; color: #92400e; }
.lock-cta { display: inline-block; padding: 12px 22px; background: var(--accent); color: #fff !important; border-radius: 22px; font-size: 15px; font-weight: 600; text-decoration: none; transition: all .2s; box-shadow: 0 2px 8px rgba(239, 108, 69, 0.3); }
.lock-cta:hover { background: #d75a35; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239, 108, 69, 0.4); }

/* ============== 微信拦截 ============== */
.wechat-block {
  background: #fff;
  padding: 30px 24px;
  margin: 20px 5%;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.wechat-block h3 { color: var(--accent); margin: 0 0 10px; }
.wechat-block p { color: var(--text-soft); margin: 0; }

/* ============== 后台 ============== */
.admin {
  background: #f5f7fb;
  min-height: 100vh;
}
.admin-head {
  background: var(--text);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.admin-head .logo { font-size: 17px; font-weight: 700; }
.admin-head .logo span { color: var(--accent); }
.admin-head .user { font-size: 13px; }
.admin-head .user a { color: #fff; opacity: 0.85; margin-left: 12px; }
.admin-head .user a:hover { opacity: 1; }
.admin-main { max-width: 1180px; margin: 0 auto; padding: 20px; }

.admin-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  background: #fff;
  padding: 8px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.admin-nav a {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 9px 14px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.admin-nav a:hover { background: var(--bg-soft); text-decoration: none; }
.admin-nav a.on { background: var(--text); color: #fff; border-color: var(--text); }

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  overflow: hidden;
}
.panel h2 { margin: 0 0 18px; font-size: 18px; color: var(--text); }
.panel h3 { margin: 0 0 14px; font-size: 16px; color: var(--text); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.stat-card .label { color: var(--text-muted); font-size: 13px; margin-bottom: 6px; }
.stat-card .num { font-size: 28px; font-weight: 800; color: var(--text); }
.stat-card .sub { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

.btn {
  padding: 9px 16px;
  border: 1px solid var(--border-dark);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { background: #e25c5c; color: #fff; border-color: #e25c5c; }
.btn-danger:hover { background: #c64a4a; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; font-weight: 500; }
.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="number"],
.form-row input[type="datetime-local"],
.form-row input[type="date"],
.form-row input[type="email"],
.form-row input[type="url"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
.form-row textarea { min-height: 80px; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(98, 104, 238, 0.12); }
.form-row .check { display: inline-flex; align-items: center; gap: 6px; }

.alert { padding: 12px 16px; border-radius: 6px; margin: 0 0 16px; font-size: 14px; }
.alert-success { background: #eef9f1; color: #1a7a3b; border: 1px solid #c3e8cd; }
.alert-danger { background: #fff4f0; color: #b04020; border: 1px solid #f5c0b3; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg-soft); }
.table tbody tr:hover { background: var(--bg-soft); }
.table .actions { display: flex; gap: 4px; flex-wrap: wrap; }

.tag {
  display: inline-block;
  padding: 3px 9px;
  background: var(--bg-soft);
  color: var(--primary);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.tag-on { background: #eef9f1; color: #1a7a3b; }
.tag-draft { background: #fff4f0; color: #b04020; }
.tag-pinned { background: #fff5e1; color: #8a5a00; }
.tag-off { background: #f0f2f6; color: var(--text-muted); }

/* ============== 文章编辑器 ============== */
.editor-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.editor-grid > .panel { margin: 0; }
.editor-grid .main-content { display: flex; flex-direction: column; gap: 20px; }
.editor-grid .side-content { display: flex; flex-direction: column; gap: 20px; }

#blocks { margin-top: 12px; }
.block {
  background: var(--bg-soft);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.block-head select { padding: 4px 8px; border: 1px solid var(--border-dark); border-radius: 4px; font-size: 12px; font-family: inherit; }
.block-head .del { color: var(--accent); cursor: pointer; padding: 4px 8px; font-size: 14px; }
.block textarea { width: 100%; padding: 8px; border: 1px solid var(--border-dark); border-radius: 4px; resize: vertical; font-family: inherit; font-size: 14px; min-height: 60px; }
.block input[type="text"] { width: 100%; padding: 8px; border: 1px solid var(--border-dark); border-radius: 4px; font-size: 13px; margin-bottom: 4px; font-family: inherit; }

.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar .btn { padding: 6px 10px; font-size: 13px; }

/* ============== 图表条 ============== */
.bar-chart { display: flex; align-items: flex-end; height: 160px; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 4px; }
.bar-chart .bar { flex: 1; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; transition: background 0.2s; }
.bar-chart .bar:hover { background: var(--primary-dark); }
.bar-labels { display: flex; gap: 4px; margin-top: 6px; font-size: 11px; color: var(--text-muted); padding: 0 4px; }
.bar-labels .lbl { flex: 1; text-align: center; }

/* ============== 登录页 ============== */
.login-box {
  max-width: 400px;
  margin: 80px auto;
  background: #fff;
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow);
}
.login-box h1 { text-align: center; margin: 0 0 6px; font-size: 24px; }
.login-box .sub { text-align: center; color: var(--text-muted); margin: 0 0 28px; font-size: 13px; }
.login-box .form-row { margin-bottom: 16px; }
.action-settings-grid { display: grid; grid-template-columns: 1fr 2fr 100px; gap: 8px; }

/* ============== 响应式 ============== */
@media (max-width: 760px) {
  .cats-grid { grid-template-columns: repeat(2, 1fr); }
  .posts { grid-template-columns: 1fr; }
  .site-head .tools { display: none; }
  .wrap { padding: 20px 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .editor-grid { grid-template-columns: 1fr; }
  .action-settings-grid { grid-template-columns: 1fr; }
  .related-list { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .cats-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .article-head h1 { font-size: 22px; }
}
