:root {
  --brand: #2e3092;
  --brand-2: #0095da;
  --brand-dark: #324c85;
  --ink: #1b2030;
  --muted: #5d6478;
  --line: #e4e8f1;
  --bg: #f5f7fb;
  --bg-soft: #eef2f9;
  --white: #ffffff;
  --ok: #1f9d57;
  --shadow: 0 10px 30px rgba(28, 40, 80, 0.08);
  --shadow-sm: 0 4px 14px rgba(28, 40, 80, 0.07);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 800; font-size: 18px;
  display: grid; place-items: center; letter-spacing: .5px;
  box-shadow: var(--shadow-sm);
}
.brand .name { font-weight: 800; font-size: 18px; line-height: 1.1; color: var(--brand); }
.brand .name small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 9px 14px; border-radius: 9px; font-weight: 600; font-size: 14.5px; color: var(--ink);
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--bg-soft); color: var(--brand); }
.nav a.active { color: var(--brand); background: rgba(46, 48, 146, 0.08); }
.nav .admin-link { color: var(--brand-2); }

.nav-toggle {
  display: none; border: 1px solid var(--line); background: #fff; border-radius: 9px;
  width: 42px; height: 42px; cursor: pointer; padding: 0;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px auto; border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(0,149,218,0.18), transparent 60%),
    linear-gradient(135deg, #2e3092 0%, #324c85 55%, #1d2350 100%);
  color: #fff; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5; pointer-events: none;
}
.hero-inner { position: relative; padding: 84px 0 92px; max-width: 720px; }
.hero .eyebrow {
  display: inline-block; font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  color: #bcdcff; font-weight: 700; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.1; margin: 0 0 16px; font-weight: 800; letter-spacing: -0.5px; }
.hero p { font-size: 18px; color: #d7e1f5; margin: 0 0 28px; max-width: 600px; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 13px 22px; border-radius: 11px; font-weight: 700; font-size: 15px; border: 1px solid transparent;
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand-2); color: #04263a; box-shadow: 0 10px 24px rgba(0,149,218,0.35); }
.btn-light { background: #fff; color: var(--brand); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

/* ---------- Stats ---------- */
.stats { background: var(--white); border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 26px 18px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat .num { font-size: 30px; font-weight: 800; color: var(--brand); }
.stat .label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section.soft { background: var(--bg-soft); }
.section-head { max-width: 680px; margin-bottom: 34px; }
.section-head .kicker { color: var(--brand-2); font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; font-size: 13px; }
.section-head h2 { font-size: clamp(24px, 3vw, 34px); margin: 8px 0 10px; font-weight: 800; letter-spacing: -.4px; }
.section-head p { color: var(--muted); margin: 0; font-size: 16px; }

.cards { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(46,48,146,0.25); }
.card .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(46,48,146,0.12), rgba(0,149,218,0.14)); color: var(--brand);
  font-size: 22px; margin-bottom: 14px;
}
.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Product grid ---------- */
.toolbar {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.search {
  position: relative; flex: 1; min-width: 240px; max-width: 420px;
}
.search input {
  width: 100%; padding: 12px 14px 12px 40px; border: 1px solid var(--line); border-radius: 11px;
  font-size: 15px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(0,149,218,0.18); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); opacity: .5; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: rgba(46,48,146,0.4); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.product-grid { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.product {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.product:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product .thumb {
  aspect-ratio: 4 / 3; background: var(--bg-soft); display: grid; place-items: center; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.product .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.product .thumb .ph { font-size: 40px; opacity: .25; }
.product .body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.badge {
  align-self: flex-start; font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
  padding: 3px 9px; border-radius: 999px; background: rgba(0,149,218,0.12); color: var(--brand-2);
}
.badge.active-part { background: rgba(46,48,146,0.1); color: var(--brand); }
.product .brand { font-size: 12.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.product .name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.product .pn { font-size: 13px; color: var(--muted); font-family: "SFMono-Regular", Consolas, monospace; }
.product .foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.product .price { font-weight: 800; color: var(--brand); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,20,40,0.55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; max-width: 640px; width: 100%; overflow: hidden;
  box-shadow: var(--shadow); animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal .m-head { display: flex; gap: 18px; padding: 22px; border-bottom: 1px solid var(--line); }
.modal .m-thumb { width: 120px; height: 120px; border-radius: 12px; background: var(--bg-soft); display: grid; place-items: center; flex: none; }
.modal .m-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.modal .m-title { font-size: 20px; font-weight: 800; }
.modal .m-brand { color: var(--brand-2); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.modal .m-body { padding: 20px 22px; }
.modal .m-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.modal .m-row:last-child { border-bottom: none; }
.modal .m-row .k { color: var(--muted); }
.modal .m-desc { color: var(--muted); font-size: 14.5px; margin: 14px 0 0; }
.modal .m-close { position: absolute; }
.modal-x { float: right; border: none; background: var(--bg-soft); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 18px; color: var(--muted); }

/* ---------- Line card ---------- */
.linecard-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.brand-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; gap: 4px; transition: all .15s; cursor: pointer;
}
.brand-card:hover { border-color: var(--brand-2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.brand-card .b-name { font-weight: 800; color: var(--brand); font-size: 15px; }
.brand-card .b-count { font-size: 12.5px; color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-radius: 18px; padding: 44px; text-align: center;
}
.cta-band h2 { margin: 0 0 10px; font-size: 28px; }
.cta-band p { margin: 0 0 22px; color: #e3eeff; }

/* ---------- Footer ---------- */
.site-footer { background: #141833; color: #c5cce0; margin-top: 30px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; padding: 54px 0 30px; }
.footer-grid h4 { color: #fff; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; margin: 0 0 14px; }
.footer-grid a { display: block; color: #aeb6d4; padding: 5px 0; font-size: 14px; }
.footer-grid a:hover { color: #fff; }
.footer-grid .f-about { font-size: 14px; color: #aeb6d4; max-width: 320px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding: 18px 0; font-size: 13px; color: #8b93b5; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.skeleton {
  background: linear-gradient(90deg, #eef1f7 25%, #e2e7f1 37%, #eef1f7 63%);
  background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Contact form ---------- */
.form-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; font-size: 15px;
  font-family: inherit; outline: none; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(0,149,218,0.18); }
.info-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.info-box .row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.info-box .row:last-child { border-bottom: none; }
.info-box .row .ic { color: var(--brand); font-size: 18px; }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.alert-ok { background: #e7f7ee; color: #1f7a45; border: 1px solid #b7e6cb; }
.alert-err { background: #fdeaea; color: #b42323; border: 1px solid #f3c2c2; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav {
    display: none; position: absolute; top: 70px; left: 0; right: 0; background: #fff;
    flex-direction: column; padding: 12px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { width: 100%; }
  .nav-toggle { display: block; }
  .cards, .product-grid { grid-template-columns: 1fr; }
  .hero-inner { padding: 60px 0 70px; }
  .modal .m-head { flex-direction: column; }
}
