:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #1a2332;
  --ink-soft: #5a6577;
  --line: #e4e8ef;
  --brand: #15487a;
  --brand-2: #1f6fb8;
  --brand-soft: #eaf1f9;
  --accent: #c8881f;
  --ok: #2f7d4f;
  --warn: #b5760f;
  --danger: #b23b3b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20,40,70,.06), 0 6px 18px rgba(20,40,70,.05);
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; gap: 18px;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { height: 34px; width: 34px; flex: 0 0 auto; }
.brand .sitename { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: .5px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; margin-left: 10px; flex-wrap: wrap; }
.nav a {
  color: var(--ink-soft); padding: 8px 12px; border-radius: 8px; font-weight: 500;
}
.nav a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.nav a.active { color: var(--brand); background: var(--brand-soft); }
.header-spacer { flex: 1; }
.auth-area { display: flex; align-items: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; font-size: 14px;
  font-weight: 600; transition: .15s; font-family: inherit;
}
.btn:hover { text-decoration: none; border-color: #cdd6e4; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: #103a64; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: #fff; color: var(--danger); border-color: #eccaca; }
.btn-danger:hover { background: #fdf1f1; }
.btn-ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-ok:hover { background: #256641; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(135deg, #103a64 0%, #1f6fb8 100%); color: #fff; }
.hero .wrap { padding: 46px 20px; }
.hero h1 { margin: 0 0 10px; font-size: 30px; letter-spacing: .5px; }
.hero p { margin: 0; max-width: 720px; color: #dbe8f5; }
.searchbox {
  margin-top: 22px; display: flex; gap: 10px; max-width: 640px;
  background: #fff; padding: 6px; border-radius: 10px; box-shadow: var(--shadow);
}
.searchbox input {
  flex: 1; border: 0; outline: 0; padding: 10px 12px; font-size: 15px; color: var(--ink);
  border-radius: 8px; font-family: inherit;
}
.searchbox .btn { white-space: nowrap; }

/* ---------- sections ---------- */
.section { padding: 34px 0; }
.section h2 { font-size: 21px; margin: 0 0 4px; }
.section .sub { color: var(--ink-soft); margin: 0 0 18px; }

.cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.cat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 12px; text-align: center; color: var(--ink); box-shadow: var(--shadow);
  transition: .15s; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.cat-card:hover { text-decoration: none; transform: translateY(-2px); border-color: #cdd6e4; }
.cat-card .ic { width: 40px; height: 40px; color: var(--brand-2); }
.cat-card .nm { font-weight: 600; font-size: 14px; }

/* ---------- listing grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: .15s; display: flex; flex-direction: column;
}
.card:hover { text-decoration: none; transform: translateY(-2px); border-color: #cdd6e4; }
.card .thumb { aspect-ratio: 16/10; background: #eef2f7; position: relative; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #9fb0c4; }
.card .badge {
  position: absolute; top: 10px; left: 10px; background: rgba(21,72,122,.92); color: #fff;
  font-size: 12px; padding: 3px 9px; border-radius: 20px; font-weight: 600;
}
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .title { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0; }
.card .meta { color: var(--ink-soft); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
.card .desc { color: var(--ink-soft); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.tag { display: inline-flex; align-items: center; gap: 5px; background: var(--brand-soft); color: var(--brand); font-size: 12px; padding: 3px 9px; border-radius: 20px; font-weight: 600; }
.price { color: var(--accent); font-weight: 700; }

/* ---------- detail ---------- */
.detail-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
.gallery { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery .main-img { aspect-ratio: 16/10; background: #eef2f7; }
.gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.detail-box h1 { margin: 0 0 10px; font-size: 24px; }
.detail-box .row { display: flex; gap: 8px; align-items: center; color: var(--ink-soft); font-size: 14px; margin: 6px 0; }
.detail-box .content { margin-top: 16px; white-space: pre-wrap; line-height: 1.9; }
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); position: sticky; top: 84px; }
.contact-card h3 { margin: 0 0 12px; font-size: 16px; }
.kv { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-soft); flex: 0 0 64px; }
.kv .v { font-weight: 600; word-break: break-all; }
.reviewed { display: inline-flex; align-items: center; gap: 6px; background: #eef6f0; color: var(--ok); font-size: 13px; padding: 5px 12px; border-radius: 20px; font-weight: 600; }

/* ---------- forms ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); max-width: 720px; margin: 0 auto; }
.form-card h1 { margin: 0 0 6px; font-size: 22px; }
.field { margin: 16px 0; }
.field label { display: block; font-weight: 600; margin-bottom: 7px; }
.field .hint { color: var(--ink-soft); font-weight: 400; font-size: 13px; }
.input, .textarea, select.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; font-family: inherit; color: var(--ink); background: #fff; outline: none;
}
.input:focus, .textarea:focus, select.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(31,111,184,.12); }
.textarea { min-height: 130px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.agree { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--brand-soft); border-radius: 8px; margin: 8px 0; font-size: 14px; }
.agree input { margin-top: 4px; width: 16px; height: 16px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }
.upload-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.upload-cell { width: 110px; height: 86px; border: 1px dashed #c3cede; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); cursor: pointer; overflow: hidden; position: relative; background: #fafcff; }
.upload-cell img { width: 100%; height: 100%; object-fit: cover; }
.upload-cell .x { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.55); color: #fff; border: 0; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 12px; line-height: 1; }

/* ---------- about / legal ---------- */
.prose { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); max-width: 900px; margin: 0 auto; }
.prose h1 { font-size: 24px; margin: 0 0 6px; }
.prose h2 { font-size: 18px; margin: 26px 0 8px; }
.prose p { color: #2c3647; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 18px 0; }
.fact { background: var(--brand-soft); border-radius: var(--radius); padding: 16px; }
.fact .n { font-size: 22px; font-weight: 800; color: var(--brand); }
.fact .l { color: var(--ink-soft); font-size: 13px; }

/* ---------- admin ---------- */
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.admin-table th { background: #f7f9fc; color: var(--ink-soft); font-weight: 600; }
.admin-table tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.pill-pending { background: #fdf3e3; color: var(--warn); }
.pill-approved { background: #eef6f0; color: var(--ok); }
.pill-rejected { background: #fbeeee; color: var(--danger); }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- footer ---------- */
.site-footer { background: #11243c; color: #c4d2e3; margin-top: 40px; }
.site-footer .wrap { padding: 34px 20px 22px; }
.site-footer a { color: #9cc4ec; }
.site-footer .cols { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; }
.site-footer h4 { color: #fff; font-size: 14px; margin: 0 0 12px; letter-spacing: .5px; }
.site-footer p { font-size: 12.5px; line-height: 1.75; margin: 0; color: #9eb5cc; }

.footer-brand { flex: 1.45; min-width: 0; }
.footer-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 8px; }
.footer-logo img { height: 34px; width: 34px; }
.footer-logo span { color: #fff; font-size: 17px; font-weight: 600; }
.footer-tagline { color: #a8bfd6; font-weight: 500; margin-bottom: 8px !important; }
.footer-brand > p { max-width: 320px; }

.footer-col { flex: 0.85; min-width: 0; }
.footer-col h4 { margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 13px; line-height: 1.4; text-decoration: none; color: #b8cee6; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

.footer-contact { flex: 1.1; min-width: 0; }
.contact-grid { display: flex; flex-direction: column; gap: 10px; }
.contact-grid span { display: flex; align-items: center; gap: 7px; font-size: 12.5px; line-height: 1.5; color: #b8cee6; }
.contact-grid span svg { flex: 0 0 auto; color: #8aaed2; }

.foot-bottom { border-top: 1px solid #24405f; margin-top: 24px; padding-top: 16px; font-size: 12px; color: #93a7bf; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: nowrap; white-space: nowrap; }
.foot-bottom a { color: #9cc4ec; text-decoration: none; white-space: nowrap; }
.foot-bottom a:hover { text-decoration: underline; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: 80px; transform: translateX(-50%);
  background: #11243c; color: #fff; padding: 11px 18px; border-radius: 8px; z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 14px; opacity: 0; transition: .2s; pointer-events: none;
}
.toast.show { opacity: 1; }

.empty { text-align: center; color: var(--ink-soft); padding: 50px 0; }
.empty svg { width: 54px; height: 54px; color: #b8c4d4; margin-bottom: 10px; }

.breadcrumb { color: var(--ink-soft); font-size: 13px; margin: 16px 0 0; }
.breadcrumb a { color: var(--ink-soft); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .cats { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .contact-card { position: static; }
  .site-footer .cols { flex-wrap: wrap; gap: 28px; }
  .footer-brand { flex: 1 1 100%; }
  .footer-brand > p { max-width: none; }
  .footer-col { flex: 1 1 calc(33.333% - 19px); }
  .facts { grid-template-columns: 1fr; }
  .nav { display: none; }
}
@media (max-width: 600px) {
  .cats { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
  .site-footer .wrap { padding: 26px 16px 18px; }
  .site-footer .cols { flex-direction: column; gap: 22px; }
  .footer-col { flex: 1 1 100%; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 6px; white-space: normal; }
}
