:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #1f2933;
  --muted: #66727f;
  --line: #e4e9f0;
  --primary: #1b4f72;
  --primary-d: #153c57;
  --accent: #2a7f9e;
  --ok: #2e7d5b;
  --warn: #a8651a;
  --danger: #b23b3b;
  --shadow: 0 1px 3px rgba(20, 40, 64, .08), 0 6px 20px rgba(20, 40, 64, .06);
  --radius: 12px;
  --maxw: 1160px;
}

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

/* layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 48px 0; }
.section-sm { padding: 28px 0; }

/* header */
#site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo { width: 38px; height: 38px; flex: 0 0 auto; }
.brand .sitename {
  font-size: 16px; font-weight: 700; color: var(--ink);
  letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--ink); padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
}
.nav-links a:hover { background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--primary); background: #eef4f9; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.nav-user .uname { color: var(--muted); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; background: var(--surface-2);
  color: var(--ink); transition: .15s; font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: #fff; border-color: #e7c4c4; color: var(--danger); }
.btn-danger:hover { background: #fdf3f3; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(.95); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* hero */
.hero {
  background: linear-gradient(135deg, #163c57 0%, #1b4f72 55%, #2a7f9e 100%);
  color: #fff; padding: 64px 0 60px;
}
.hero h1 { font-size: 34px; margin: 0 0 14px; font-weight: 800; letter-spacing: .5px; }
.hero p { font-size: 16px; margin: 0 0 26px; color: #dce8f1; max-width: 640px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.2); }
.hero-stats { display: flex; gap: 36px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats .s b { font-size: 24px; display: block; }
.hero-stats .s span { font-size: 13px; color: #c7d8e6; }

/* section heading */
.h2 { font-size: 24px; margin: 0 0 6px; font-weight: 800; }
.sub { color: var(--muted); margin: 0 0 26px; font-size: 15px; }

/* category grid */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: .15s;
}
.cat-card:hover { box-shadow: var(--shadow); border-color: #cdd9e6; transform: translateY(-2px); }
.cat-ico {
  width: 44px; height: 44px; border-radius: 10px; flex: 0 0 auto;
  background: #eef4f9; color: var(--primary); display: flex; align-items: center; justify-content: center;
}
.cat-card .ct { font-weight: 600; font-size: 15px; }
.cat-card .cd { font-size: 12px; color: var(--muted); }

/* listing grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .15s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .thumb { aspect-ratio: 16/10; background: #eef2f6; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 12px; color: var(--primary); background: #eef4f9; padding: 3px 10px; border-radius: 999px;
}
.card h3 { margin: 2px 0 0; font-size: 16px; font-weight: 700; }
.card .desc { color: var(--muted); font-size: 13px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); }
.badge-ok { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-size: 12px; font-weight: 600; }

/* filter bar */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; cursor: pointer; color: var(--ink);
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface);
}
.search input { border: 0; outline: 0; flex: 1; font-size: 14px; font-family: inherit; background: transparent; }

/* detail */
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
.detail-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.detail-main h1 { font-size: 24px; margin: 4px 0 12px; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.gallery img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.prose { font-size: 15px; color: #34414f; white-space: pre-wrap; }
.aside {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  position: sticky; top: 84px;
}
.aside .row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.aside .row:last-child { border-bottom: 0; }
.aside .row .k { color: var(--muted); }
.aside .row .v { font-weight: 600; text-align: right; }

/* forms */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; max-width: 760px; margin: 0 auto; }
.form-card h2 { margin: 0 0 4px; font-size: 22px; }
.field { margin: 16px 0; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.input, .textarea, .select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: var(--surface); color: var(--ink); outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #e8f0f7; }
.textarea { min-height: 130px; resize: vertical; }
.checks { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.check input { margin-top: 4px; }
.check a { color: var(--primary); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab { padding: 9px 18px; border-radius: 10px 10px 0 0; cursor: pointer; font-weight: 600; color: var(--muted); border: 1px solid transparent; }
.tab.active { color: var(--primary); border-color: var(--line); border-bottom-color: var(--surface); background: var(--surface); }
.auth-wrap { max-width: 420px; margin: 0 auto; }
.upload-box {
  border: 1.5px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center;
  color: var(--muted); cursor: pointer; background: var(--surface-2);
}
.upload-box:hover { border-color: var(--primary); }
.previews { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.previews img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* two column simple */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

/* about */
.about-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.about-hero h1 { margin: 0 0 10px; font-size: 26px; }
.about p { font-size: 15px; color: #34414f; }
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 10px; }
.value { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.value .vi { width: 38px; height: 38px; color: var(--primary); background: #eef4f9; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.value h4 { margin: 0 0 6px; font-size: 15px; }
.value p { margin: 0; font-size: 13px; color: var(--muted); }

/* footer */
#site-footer { background: #11283a; color: #c5d4e0; margin-top: 40px; }
#site-footer a { color: #9fc3dd; }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; padding: 40px 0 24px; }
.foot h5 { color: #fff; font-size: 14px; margin: 0 0 12px; }
.foot p, .foot li { font-size: 13px; color: #aebfcd; margin: 0 0 8px; line-height: 1.7; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot .fbrand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.foot .fbrand .logo { width: 32px; height: 32px; }
.foot .fbrand b { color: #fff; font-size: 14px; }
.foot-bottom { border-top: 1px solid #1d3a4f; padding: 16px 0; font-size: 12px; color: #8197a8; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.foot-bottom a { color: #9fc3dd; }

/* misc */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 54px; height: 54px; color: #b8c4d0; margin-bottom: 12px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-pending { background: #fdf3e3; color: var(--warn); }
.pill-approved { background: #e7f4ee; color: var(--ok); }
.pill-rejected { background: #fbeaea; color: var(--danger); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 12px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line); }
.table th { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table .ops { display: flex; gap: 8px; }
.modal-mask { position: fixed; inset: 0; background: rgba(17,40,58,.45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 24px; max-width: 460px; width: 100%; }
.modal textarea { width: 100%; min-height: 90px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-family: inherit; }
.notice { background: #eef4f9; border: 1px solid #d4e3ef; color: #2a557a; border-radius: 10px; padding: 12px 14px; font-size: 13px; }

@media (max-width: 920px) {
  .cats { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .two, .values, .foot { grid-template-columns: 1fr; }
  .hero h1 { font-size: 27px; }
}
@media (max-width: 560px) {
  .grid, .cats { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
