/* ================= 大全朋友圈助手 · 管理后台 ================= */
:root {
  --ink: #14191d;
  --paper: #f4efe6;
  --card: #fffdf9;
  --gold: #c8a24b;
  --gold-2: #e0c078;
  --muted: #8b8f8b;
  --line: #e3dacb;
  --bg: #ebe5d9;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", "SimSun", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 13px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input { font-family: inherit; font-size: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* 登录 */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 25% 10%, #2b353b 0%, #14191d 65%, #0c0f11 100%); }
.gate-card { width: 100%; max-width: 380px; padding: 36px 30px 26px; border-radius: 22px; background: rgba(244, 239, 230, 0.98); text-align: center; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4); }
.gate-seal { width: 58px; height: 58px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--ink); color: var(--gold-2); font-family: var(--serif); font-size: 30px; border-radius: 15px; }
.gate-card h1 { margin: 0; font-size: 20px; letter-spacing: 1px; }
.gate-card > p { margin: 6px 0 22px; font-size: 11px; color: var(--muted); }
.gate-card input { width: 100%; height: 48px; border-radius: 11px; border: 1px solid #dcd2c2; background: #fbf7ee; padding: 0 14px; font-size: 16px; letter-spacing: 4px; text-align: center; outline: none; }
.gate-card input:focus { border-color: var(--gold); background: #fff; }
.gate-card button[type=submit] { width: 100%; height: 48px; margin-top: 12px; border-radius: 11px; background: var(--ink); color: var(--paper); font-size: 14px; letter-spacing: 1px; }
.gate-tip { margin-top: 16px; font-size: 10px; color: #9b9588; line-height: 1.7; }
.gate-tip.error { color: #b24a3c; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(244, 239, 230, 0.96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 11px; }
.seal { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--ink); color: var(--gold-2); font-family: var(--serif); font-size: 22px; }
.brand h1 { margin: 0; font-size: 15px; letter-spacing: 0.8px; }
.brand p { margin: 2px 0 0; font-size: 10px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: #6f8a63; margin-right: 4px; }
.sync i { width: 6px; height: 6px; border-radius: 50%; background: #7fa06f; }
.btn-sm { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid #dcd2c2; background: #fffdf9; color: #4f544f; font-size: 11px; }
.btn-sm:hover { background: #f7f1e6; }
.btn-sm.ghost { border-color: transparent; color: #9b9588; }

/* 数据 */
.stats { max-width: 1180px; margin: 20px auto 0; padding: 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.demo-banner { max-width: 1132px; margin: 14px auto 0; padding: 9px 14px; border: 1px solid #e7cf9f; border-radius: 9px; background: #fff5dc; color: #8a6420; font-size: 11px; line-height: 1.6; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 17px; }
.stat-card > span { font-size: 11px; color: var(--muted); }
.stat-card b { display: block; margin: 6px 0 1px; font-size: 30px; font-weight: 800; line-height: 1.1; }
.stat-card b.gold { color: var(--gold); }
.stat-card b.green { color: #6f8a63; }
.stat-card .foot { font-size: 9px; color: #aaa293; }

/* 布局 */
.admin-grid { max-width: 1180px; margin: 16px auto 44px; padding: 0 24px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 18px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 15px; letter-spacing: 0.5px; display: flex; align-items: center; gap: 7px; }
.count { font-size: 9.5px; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px; background: #f1eadc; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.muted { font-size: 10px; color: var(--muted); }

.recent-list { display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow-y: auto; }
.recent-item { display: flex; gap: 11px; padding: 11px; border: 1px solid #eee6d8; border-radius: 11px; background: #fdfaf4; }
.recent-item .rdate { flex: none; width: 82px; font-size: 9px; color: #a39b8c; line-height: 1.5; }
.recent-main { flex: 1; min-width: 0; }
.recent-main b { font-size: 11.5px; }
.recent-main p { margin: 3px 0 0; font-size: 10.5px; line-height: 1.65; color: #6f726a; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recent-main .rmeta { margin-top: 3px; font-size: 9px; color: #a8a08f; }
.recent-item button { flex: none; align-self: center; font-size: 10px; border: 1px solid #dcd2c2; border-radius: 7px; padding: 4px 8px; background: #fff; }
.distribution { display: flex; flex-direction: column; gap: 9px; }
.dist-row { display: flex; align-items: center; gap: 9px; font-size: 10.5px; }
.dist-row span:first-child { width: 62px; color: #5f6259; }
.dist-row .bar { flex: 1; height: 6px; background: #f1eadc; border-radius: 3px; overflow: hidden; }
.dist-row .bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.dist-row .num { width: 30px; text-align: right; color: #9b9588; }
.empty { padding: 24px; text-align: center; color: #a8a08f; font-size: 11px; border: 1px dashed #e0d6c6; border-radius: 10px; }
.tips-panel ul { margin: 0; padding-left: 16px; }
.tips-panel li { font-size: 10.5px; line-height: 1.9; color: #77756b; margin-bottom: 4px; }
.qr-link { display: inline-block; margin-top: 10px; font-size: 10.5px; color: var(--ink); border-bottom: 1px solid #cdbfa8; padding-bottom: 1px; }

/* 弹层 */
.toast { position: fixed; z-index: 100; top: 18px; left: 50%; transform: translate(-50%, -12px); padding: 9px 16px; border-radius: 9px; background: rgba(20, 25, 29, 0.95); color: var(--paper); font-size: 11.5px; opacity: 0; pointer-events: none; transition: 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; z-index: 90; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(20, 25, 29, 0.55); }
.modal-card { width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto; background: var(--paper); border-radius: 18px; padding: 24px; }
.close-x { float: right; width: 28px; height: 28px; border-radius: 50%; background: #eae1d1; color: #77756b; font-size: 16px; display: grid; place-items: center; }
.modal-card h3 { margin: 0 0 3px; font-size: 19px; letter-spacing: 0.5px; }
.modal-sub { margin-bottom: 14px; font-size: 10px; color: var(--muted); }
.raw-block { padding: 13px; border-radius: 10px; background: #eae1d1; font-size: 11.5px; line-height: 1.85; color: #5f6259; white-space: pre-wrap; }
.version-block { margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf9; }
.version-block .vhead { display: flex; justify-content: space-between; font-size: 10px; color: var(--gold); }
.version-block .vtext { margin-top: 6px; white-space: pre-wrap; font-size: 11.5px; line-height: 1.95; color: #3d4345; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn-sm { flex: 1; height: 38px; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 10px 14px; }
  .stats { padding: 0 14px; gap: 8px; }
  .admin-grid { padding: 0 14px; }
  .sync { display: none; }
  .stat-card b { font-size: 25px; }
  .recent-item .rdate { display: none; }
}
