:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #1b2733;
  --ink-soft: #5a6b7b;
  --line: #e2e9f1;
  --brand: #0f3d6e;
  --brand-2: #1f6fb2;
  --accent: #39b3a6;
  --warn: #c8852b;
  --danger: #c0392b;
  --ok: #2e8b6f;
  --shadow: 0 6px 22px rgba(15, 61, 110, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
  box-shadow: 0 2px 10px rgba(15,61,110,0.04);
}
.topbar-inner {
  max-width: 1140px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { width: 38px; height: 38px; display: block; }
.brand .name { font-size: 17px; font-weight: 700; color: var(--brand); letter-spacing: .3px; line-height: 1.2; }
.brand .sub { font-size: 11px; color: var(--ink-soft); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 8px 14px; border-radius: 8px; color: var(--ink); font-size: 14px; font-weight: 500;
}
.nav a:hover { background: #eef4fb; text-decoration: none; }
.nav a.active { color: var(--brand); background: #eaf2fb; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s;
  font-family: inherit; text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #0c335c; text-decoration: none; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--brand); }
.btn-ghost:hover { border-color: var(--brand-2); text-decoration: none; }
.btn-accent { background: var(--accent); color: #07261f; }
.btn-accent:hover { background: #2fa093; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.hero {
  background: linear-gradient(135deg, #0f3d6e 0%, #1f6fb2 100%);
  color: #fff; padding: 40px 20px 46px;
}
.hero-inner { max-width: 1140px; margin: 0 auto; }
.hero h1 { margin: 0 0 10px; font-size: 27px; font-weight: 700; }
.hero p { margin: 0; max-width: 760px; color: #d7e7f6; font-size: 15px; }
.hero-stat { display: flex; gap: 30px; margin-top: 22px; flex-wrap: wrap; }
.hero-stat div { font-size: 13px; color: #bcd6ee; }
.hero-stat b { display: block; font-size: 22px; color: #fff; }

.container { max-width: 1140px; margin: 0 auto; padding: 26px 20px 40px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 16px; }
.section-title h2 { font-size: 19px; margin: 0; color: var(--ink); }
.section-title .more { font-size: 13px; color: var(--ink-soft); }

/* category nav */
.cat-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 30px; }
.cat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 10px; text-align: center; cursor: pointer; transition: .15s; box-shadow: var(--shadow);
}
.cat-card:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.cat-card.active { border-color: var(--brand); background: #eef4fb; }
.cat-card .ic { width: 30px; height: 30px; margin: 0 auto 8px; display: block; }
.cat-card span { font-size: 13px; color: var(--ink); font-weight: 500; }

/* filter bar */
.filterbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.filterbar input[type=text] {
  flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 14px; font-family: inherit;
}
.filterbar select {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; background: #fff;
}
.chip {
  padding: 7px 14px; border-radius: 20px; border: 1px solid var(--line); background: #fff;
  font-size: 13px; cursor: pointer; color: var(--ink-soft);
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* info list */
.info-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.info-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); cursor: pointer; transition: .15s; display: flex; flex-direction: column;
}
.info-card:hover { border-color: var(--brand-2); transform: translateY(-1px); }
.info-card .meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 6px; background: #eaf2fb; color: var(--brand); font-weight: 600; }
.tag.paid { background: #fff3e0; color: var(--warn); }
.info-card h3 { margin: 0 0 8px; font-size: 16px; color: var(--ink); line-height: 1.45; }
.info-card .summary { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 14px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.info-card .foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink-soft); }
.info-card .price { color: var(--warn); font-weight: 700; font-size: 14px; }

/* detail */
.detail-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.detail-wrap .meta { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.detail-wrap h1 { font-size: 23px; margin: 6px 0 14px; color: var(--ink); }
.detail-body { font-size: 15px; color: #2c3a48; white-space: pre-wrap; }
.paywall {
  border: 1px dashed var(--warn); background: #fffaf0; border-radius: var(--radius);
  padding: 22px; text-align: center; margin: 20px 0;
}
.paywall .pp { font-size: 26px; font-weight: 800; color: var(--warn); margin: 8px 0; }
.paywall p { color: var(--ink-soft); font-size: 14px; margin: 6px 0 16px; }
.paywall .qrcode-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 14px 0 18px; }
.paywall .qrcode { width: 220px; max-width: 80%; border-radius: 8px; border: 1px solid var(--line); }
.paywall .qrcode-box span { color: var(--ink-soft); font-size: 13px; }
.backlink { display: inline-block; margin-bottom: 16px; font-size: 14px; color: var(--brand-2); }

/* forms */
.form-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); max-width: 720px; margin: 0 auto; }
.form-card h2 { margin: 0 0 6px; font-size: 20px; }
.form-card .hint { color: var(--ink-soft); font-size: 13px; margin: 0 0 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field .req { color: var(--danger); }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand-2); }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--ink-soft); margin-bottom: 10px; }
.check input { margin-top: 4px; }
.agree-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: 14px; margin-bottom: 18px; }

/* two col */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* notice */
.notice { background: #fffaf0; border: 1px solid #f3d9a8; color: #8a5a12; border-radius: 9px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 16px; }
.error-box { background: #fdecea; border: 1px solid #f3c0bb; color: #a93226; border-radius: 9px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 16px; }
.ok-box { background: #eafaf1; border: 1px solid #bfe6cf; color: #1e7a4f; border-radius: 9px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 16px; }

/* about */
.about-hero { background: linear-gradient(135deg,#0f3d6e,#1f6fb2); color:#fff; padding: 34px 20px; }
.about-hero-inner { max-width: 1140px; margin: 0 auto; }
.about-hero h1 { margin: 0 0 8px; font-size: 24px; }
.about-hero p { margin: 0; color: #d7e7f6; max-width: 760px; }
.about-body { max-width: 880px; margin: 0 auto; padding: 30px 20px 40px; }
.about-body h3 { color: var(--brand); font-size: 18px; margin: 26px 0 10px; }
.about-body p, .about-body li { color: #2c3a48; font-size: 15px; }
.about-body ul { padding-left: 20px; }
.info-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-top: 18px; }
.info-box .row { display: flex; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.info-box .row:last-child { border-bottom: none; }
.info-box .row .k { width: 110px; color: var(--ink-soft); flex-shrink: 0; }
.info-box .row .v { color: var(--ink); font-weight: 600; }

/* admin */
.admin-bar { background: var(--brand); color: #fff; }
.admin-bar-inner { max-width: 1140px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.admin-bar-inner .t { font-weight: 700; }
.stat-row { display: grid; grid-template-columns: repeat(5,1fr); gap: 14px; margin: 22px 0; }
.stat-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.stat-box b { display: block; font-size: 24px; color: var(--brand); }
.stat-box span { font-size: 13px; color: var(--ink-soft); }
table.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.tbl th, table.tbl td { padding: 12px 14px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--line); }
table.tbl th { background: #f3f7fb; color: var(--ink-soft); font-weight: 600; }
table.tbl tr:last-child td { border-bottom: none; }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 6px; font-weight: 600; }
.badge.pending { background: #fff3e0; color: var(--warn); }
.badge.approved { background: #eafaf1; color: var(--ok); }
.badge.rejected { background: #fdecea; color: var(--danger); }
.modal-mask { position: fixed; inset: 0; background: rgba(20,35,55,.45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 100%; max-width: 460px; }
.modal h3 { margin: 0 0 14px; }

/* footer */
.footer { background: #0f2236; color: #b9c8d8; margin-top: 30px; }
.footer-inner { max-width: 1140px; margin: 0 auto; padding: 30px 20px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px; }
.footer h4 { color: #fff; font-size: 15px; margin: 0 0 12px; }
.footer a { color: #b9c8d8; display: block; font-size: 13.5px; margin-bottom: 7px; }
.footer a:hover { color: #fff; }
.footer .desc { font-size: 13px; line-height: 1.7; }
.footer-bottom { border-top: 1px solid #1c3550; text-align: center; padding: 14px; font-size: 12.5px; color: #8aa0b8; }
.footer-bottom a { display: inline; color: #cfe0f0; }

.empty { text-align: center; color: var(--ink-soft); padding: 50px 0; font-size: 14px; }

@media (max-width: 900px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .info-list { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2,1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .nav { display: none; }
}
