/*
Theme Name: 审计法规库
Theme URI: https://auditmoment.com
Author: Jarvis
Description: 审计法规库专用主题 —— 深色侧栏工作台布局，基于样板 B4。
Version: 1.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: auditmoment
*/

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #0F172A; background: #FFFFFF; line-height: 1.6;
  display: flex; height: 100vh; overflow: hidden;
}
body.admin-bar { height: calc(100vh - 32px); }
a { color: inherit; text-decoration: none; }
.icon { display: inline-block; vertical-align: -2px; }
.icon svg { display: block; }

/* ===== 左侧深色侧栏 ===== */
aside.sidebar {
  width: 288px; min-width: 288px; background: #0F172A; color: #CBD5E1;
  display: flex; flex-direction: column; padding: 22px 16px;
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; color: #fff; padding: 0 12px; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #38BDF8, #2563EB);
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.search {
  display: flex; align-items: center; gap: 10px; margin: 20px 4px 8px;
  background: #1E293B; border: 1px solid #334155; border-radius: 8px;
  padding: 9px 14px; font-size: 14px;
}
.search input { flex: 1; background: transparent; border: none; outline: none; color: #E2E8F0; font-size: 14px; }
.search input::placeholder { color: #64748B; }
nav.tree { flex: 1; overflow-y: auto; margin-top: 8px; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
nav.tree::-webkit-scrollbar { width: 6px; }
nav.tree::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
.group { margin-bottom: 4px; }
.group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  font-size: 14.5px; font-weight: 600; color: #E2E8F0;
  user-select: none;
}
.group-head:hover { background: #1E293B; }
.group-head .arrow { font-size: 11px; transition: transform .15s; color: #64748B; }
.group.closed .arrow { transform: rotate(-90deg); }
.group-items { display: flex; flex-direction: column; padding-left: 12px; }
.group.closed .group-items { display: none; }
.group-items a {
  padding: 7px 12px; border-radius: 8px; font-size: 13.5px; color: #94A3B8;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.group-items a:hover { background: #1E293B; color: #E2E8F0; }
.group-items a.active { color: #38BDF8; font-weight: 600; }
.group-items a.lv3 { padding-left: 26px; font-size: 13px; }
aside .foot { font-size: 12px; color: #475569; padding: 12px 12px 0; line-height: 1.7; border-top: 1px solid #1E293B; font-family: "Songti SC", "STSong", serif; }
aside .foot a { color: #64748B; }
aside .foot a:hover { color: #94A3B8; }

/* ===== 右侧主区 ===== */
main { flex: 1; overflow-y: auto; min-width: 0; }
.topbar {
  height: 60px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 36px; border-bottom: 1px solid #F1F5F9; position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
}
body.admin-bar .topbar { top: 32px; }
.topbar .crumb { font-size: 14px; color: #64748B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34%; }
.topbar .crumb b { color: #0F172A; }
.topbar .crumb a:hover { color: #0284C7; }
.search-top {
  display: flex; align-items: center; gap: 10px; flex: 1; max-width: 420px;
  margin: 0 24px; border: 1px solid #E2E8F0; border-radius: 999px;
  padding: 8px 18px; font-size: 14px; color: #94A3B8;
  transition: border-color .15s, box-shadow .15s;
}
.search-top:focus-within { border-color: #38BDF8; box-shadow: 0 0 0 3px rgba(56,189,248,0.15); }
.search-top input { flex: 1; border: none; outline: none; font-size: 14px; color: #0F172A; background: transparent; min-width: 40px; }
.search-top input::placeholder { color: #94A3B8; }
.search-top button { background: none; border: none; cursor: pointer; padding: 0; display: flex; }
.topbar .right { display: flex; align-items: center; gap: 18px; }
.topbar .login { font-size: 13.5px; color: #64748B; cursor: pointer; }
.topbar .login:hover { color: #0F172A; }

/* ===== 内容区通用 ===== */
.content { max-width: 860px; padding: 40px 36px 64px; }
.content h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.35; }
.content .sub { color: #64748B; font-size: 15.5px; margin-top: 10px; font-family: "Songti SC", "STSong", "SimSun", serif; }

/* 首页快捷入口 */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-top: 32px; }
.quick a.q {
  border: 1px solid #F1F5F9; border-radius: 8px; padding: 18px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
  display: flex; align-items: center; gap: 12px;
}
.quick a.q:hover { border-color: #BAE6FD; box-shadow: 0 8px 20px rgba(2,132,199,0.07); }
.quick .qico {
  width: 38px; height: 38px; min-width: 38px; border-radius: 9px;
  background: #F0F9FF; display: flex; align-items: center; justify-content: center; color: #0284C7;
}
.quick .t { font-weight: 600; font-size: 15px; }
.quick .d { font-size: 12.5px; color: #94A3B8; margin-top: 3px; }

/* 最近收录 / 文章列表 */
.latest { margin-top: 40px; }
.latest h2 { font-size: 17px; margin-bottom: 14px; }
.latest ul { list-style: none; border: 1px solid #F1F5F9; border-radius: 10px; overflow: hidden; }
.latest li { border-bottom: 1px solid #F8FAFC; }
.latest li:last-child { border-bottom: none; }
.latest li a {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 13px 20px; font-size: 14px; transition: background .12s;
}
.latest li a:hover { background: #F8FAFC; }
.latest li .ttl { font-family: "Songti SC", "STSong", "SimSun", serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest li .tag {
  font-size: 12px; color: #0369A1; background: #E0F2FE; border-radius: 6px;
  padding: 3px 9px; white-space: nowrap; flex-shrink: 0;
}

/* 分类页 / 搜索页列表 */
.list-head { margin-bottom: 24px; }
.list-head .count { color: #64748B; font-size: 14px; margin-top: 8px; }
.post-list { list-style: none; border: 1px solid #F1F5F9; border-radius: 10px; overflow: hidden; }
.post-list li { border-bottom: 1px solid #F8FAFC; }
.post-list li:last-child { border-bottom: none; }
.post-list li a { display: block; padding: 14px 20px; transition: background .12s; }
.post-list li a:hover { background: #F8FAFC; }
.post-list .ttl { font-size: 14.5px; font-family: "Songti SC", "STSong", "SimSun", serif; }
.post-list .meta { font-size: 12.5px; color: #94A3B8; margin-top: 4px; display: flex; gap: 12px; }
.post-list .excerpt { font-size: 13px; color: #64748B; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pager { margin-top: 28px; display: flex; gap: 10px; justify-content: center; }
.pager a, .pager span {
  padding: 8px 16px; border: 1px solid #E2E8F0; border-radius: 8px; font-size: 14px; color: #475569;
}
.pager a:hover { border-color: #38BDF8; color: #0284C7; }
.pager .current { background: #0F172A; color: #fff; border-color: #0F172A; }

/* ===== 法规正文页 ===== */
.reg-meta { display: flex; gap: 10px; align-items: center; margin: 14px 0 6px; flex-wrap: wrap; }
.reg-meta .tag { font-size: 12px; color: #0369A1; background: #E0F2FE; border-radius: 6px; padding: 3px 10px; }
.reg-meta .date { font-size: 12.5px; color: #94A3B8; }
.regulation {
  margin-top: 22px; padding-top: 26px; border-top: 1px solid #F1F5F9;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 15.5px; line-height: 2.0; color: #1E293B;
}
.regulation h2 {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px; font-weight: 700; color: #0F172A;
  margin: 34px 0 14px; padding-left: 12px; border-left: 3px solid #38BDF8;
  line-height: 1.5;
}
.regulation h3 {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15.5px; font-weight: 700; color: #0F172A; margin: 26px 0 10px;
}
.regulation h4 { font-size: 15px; font-weight: 700; margin: 20px 0 8px; }
.regulation p { margin: 0 0 14px; text-align: justify; }
.regulation strong { color: #0F172A; }
.regulation blockquote {
  margin: 0 0 20px; padding: 10px 16px; background: #F8FAFC;
  border-left: 3px solid #CBD5E1; border-radius: 0 8px 8px 0;
  color: #64748B; font-size: 13.5px;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.regulation ul, .regulation ol { margin: 0 0 14px; padding-left: 28px; }
.regulation li { margin-bottom: 6px; }
.regulation table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; }
.regulation th, .regulation td { border: 1px solid #E2E8F0; padding: 8px 12px; text-align: left; }
.regulation th { background: #F8FAFC; font-weight: 600; }
.regulation hr { border: none; border-top: 1px solid #F1F5F9; margin: 28px 0; }
.regulation a { color: #0284C7; text-decoration: underline; }

/* 上一篇/下一篇 */
.post-nav { margin-top: 44px; padding-top: 24px; border-top: 1px solid #F1F5F9; display: flex; flex-direction: column; gap: 10px; }
.post-nav a { font-size: 13.5px; color: #64748B; display: flex; gap: 8px; }
.post-nav a:hover { color: #0284C7; }
.post-nav .lbl { color: #94A3B8; flex-shrink: 0; }

/* 空状态 */
.empty { padding: 60px 0; text-align: center; color: #94A3B8; font-size: 14.5px; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  aside.sidebar { display: none; }
  .topbar { padding: 0 16px; }
  .topbar .crumb { display: none; }
  .search-top { margin: 0; max-width: none; }
  .content { padding: 28px 18px 56px; }
  .content h1 { font-size: 23px; }
}
