:root {
  --navy: #16263a;
  --blue: #2869e8;
  --green: #159f8c;
  --orange: #d88722;
  --red: #d3534f;
  --ink: #16202f;
  --muted: #607084;
  --line: #d7e0e9;
  --bg: #eef3f8;
  --panel: #ffffff;
  --shadow: 0 8px 22px rgba(18, 39, 65, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.nav,
.admin-top,
.map-top {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 max(20px, calc((100% - 1380px) / 2));
  background: var(--navy);
  color: #fff;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 5px 20px rgba(16, 35, 55, 0.16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  background: #f2b84b;
  color: #17212f;
  font-weight: 800;
}

.navlinks,
.nav-right,
.admin-nav,
.toolbar,
.tabs-inline,
.actions,
.page-actions,
.choice,
.section-head-row,
.table-actions,
.member-actions,
.discount-type,
.replace-segments,
.context-nav,
.summary,
.summary-line,
.list-item,
.member-account-bar,
.account-links,
.hero-actions,
.trust {
  display: flex;
  gap: 10px;
}

.navlinks a,
.nav-right a,
.map-top-actions a {
  color: #dbe6ef;
  padding: 9px 12px;
  border-radius: 5px;
  white-space: nowrap;
}
.navlinks a.active,
.navlinks a:hover,
.nav-right a:hover,
.map-top-actions a:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.nav-right {
  margin-left: auto;
  align-items: center;
}
.login,
.nav-btn,
.secondary,
.primary,
.primary-mini,
.link-btn,
.map-filter,
.tabs-inline button,
.choice button,
.discount-type button,
.replace-segments label span,
.state-controls button,
.hero-actions a,
.account-links a,
.quick-links a,
.page-actions a {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
}
.primary,
.primary-mini,
.nav-btn,
.map-top-actions .primary-link,
.page-actions .primary,
.hero-actions .solid,
.buy {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.secondary,
.login,
.page-actions .secondary,
.hero-actions .ghost,
.map-top-actions a:not(.primary-link) {
  background: transparent;
  color: #fff;
  border-color: #425b73;
}
.primary,
.secondary,
.login,
.nav-btn,
.map-top-actions a,
.page-actions a,
.hero-actions a {
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.mobile-menu,
.admin-drawer {
  display: none;
}
.mobile-menu a,
.admin-drawer a {
  display: block;
  padding: 10px 12px;
  color: var(--ink);
}
.mobile-menu a.active,
.admin-drawer a.active {
  background: #eef5ff;
  color: var(--blue);
  border-radius: 5px;
}
.menu-toggle,
.admin-menu {
  border: 1px solid #425b73;
  background: transparent;
  color: #fff;
  border-radius: 5px;
  min-height: 34px;
  padding: 0 10px;
}

.layout,
.admin-content,
.map-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}
.admin-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}
.admin-side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-side .brand { color: var(--ink); }
.admin-side .mark { background: #edf4ff; color: var(--blue); }
.admin-nav {
  display: grid;
  gap: 5px;
}
.admin-nav a {
  color: var(--ink);
  padding: 9px 10px;
  border-radius: 5px;
}
.admin-nav a.active,
.admin-nav a:hover {
  background: #eef5ff;
  color: var(--blue);
  text-decoration: none;
}
.admin-group {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.admin-main { min-width: 0; }
.admin-top { justify-content: space-between; }
.admin-top strong { font-weight: 700; }

.crumb,
.page-head,
.section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.crumb {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}
.page-head h1,
.map-heading h1,
.section-head-row h2,
.page-head h2 {
  margin: 0 0 6px;
  line-height: 1.2;
}
.page-head p,
.section-head-row p,
.map-heading p {
  margin: 0;
  color: var(--muted);
}
.page-head h1 { font-size: 28px; }
.page-head h2 { font-size: 22px; }

.grid,
.stats,
.products,
.quick-inner,
.advantages,
.branch-grid,
.admin-grid,
.system-grid,
.member-lower-grid,
.plan-overview,
.discount-layout,
.replace-layout,
.replace-origin-grid,
.replace-checks,
.member-home .member-section-title + section,
.hero-band,
.feature-grid,
.business-service-grid {
  display: grid;
  gap: 14px;
}

.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px 0; }
.stat,
.card,
.panel,
.product,
.list-item,
.member-service-card,
.business-service-card,
.plan-box,
.rule-card,
.map-node,
.hero-band article,
.feature-grid article,
.account-links a,
.quick-links a {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}
.card,
.panel { padding: 18px; }
.stat {
  padding: 18px;
}
.stat label,
.muted-help,
.page-head p,
.stat em,
.map-heading p,
.product p,
.features,
.notice,
.summary-line span,
.summary-line strong small,
.map-node small,
.node-status,
.admin-group,
.map-top-note,
.adv p {
  color: var(--muted);
}
.stat strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 30px;
}
.stat em { font-style: normal; }
.stat-warn { color: var(--orange); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: #f4f7fb;
  color: #4d5c6e;
  font-size: 13px;
}
tr:last-child td { border-bottom: 0; }

.field,
.form-row {
  display: grid;
  gap: 8px;
}
.form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.field label,
.form-row label,
.summary-line span,
.member-account-bar span,
.plan-box h3,
.hero-band span,
.feature-grid h3 {
  font-weight: 700;
}
.field input,
.field select,
.field textarea,
.input,
.admin-content input,
.admin-content select,
.admin-content textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}
.field textarea,
.admin-content textarea {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

.summary {
  flex-direction: column;
  gap: 10px;
}
.summary-line {
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.summary-total strong { font-size: 21px; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #edf4ff;
  color: var(--blue);
}
.pill.green { background: #eaf8f4; color: var(--green); }
.pill.orange { background: #fff3e7; color: var(--orange); }
.pill.red { background: #fdeceb; color: var(--red); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(22, 32, 47, 0.95);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: 0 10px 26px rgba(18, 39, 65, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.member-home .page-head {
  margin-bottom: 16px;
}
.member-account-bar {
  margin: 16px 0 24px;
}
.member-account-bar > div,
.account-links a,
.hero-band article,
.feature-grid article,
.plan-box,
.rule-card,
.map-node {
  padding: 18px;
}
.member-account-bar > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  flex: 1;
}
.member-account-bar strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 26px;
}
.member-section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin: 18px 0 14px;
}
.business-service-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.business-service-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.service-kicker { color: var(--muted); font-size: 12px; font-weight: 700; }
.service-primary strong { font-size: 34px; }
.service-details,
.plan-overview,
.rule-list,
.member-activity-list {
  display: grid;
  gap: 10px;
}
.service-details,
.plan-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.metric-bar {
  height: 8px;
  border-radius: 999px;
  background: #e4eaf1;
  overflow: hidden;
}
.metric-bar span { display: block; height: 100%; background: var(--blue); }
.member-lower-grid,
.discount-layout,
.replace-layout {
  grid-template-columns: 2fr 1fr;
}

.admin-content { background: var(--bg); }
.admin-content .grid,
.admin-content .stats { margin-top: 16px; }
.toolbar,
.page-actions,
.tabs-inline,
.choice,
.discount-type,
.replace-segments,
.context-nav {
  flex-wrap: wrap;
  align-items: center;
}
.toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}
.tabs-inline button,
.choice button,
.discount-type button,
.map-filter {
  min-height: 38px;
  padding: 0 12px;
}
.tabs-inline button.active,
.choice button.active,
.discount-type button.active,
.map-filter.active {
  background: #edf4ff;
  border-color: #8fb5f7;
  color: var(--blue);
}

.nav,
.admin-top,
.map-top {
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .admin-app { grid-template-columns: 1fr; }
  .admin-side { display: none; }
  .admin-drawer { display: block; }
  .grid,
  .stats,
  .business-service-grid,
  .member-lower-grid,
  .discount-layout,
  .replace-layout,
  .service-details,
  .plan-overview,
  .branch-grid,
  .admin-grid,
  .system-grid,
  .hero-band,
  .feature-grid,
  .products,
  .quick-inner,
  .advantages {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .layout,
  .admin-content,
  .map-shell {
    padding: 18px 16px 48px;
  }
  .nav,
  .admin-top,
  .map-top {
    padding: 0 16px;
  }
  .navlinks,
  .nav-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .form-row,
  .grid,
  .stats,
  .service-details,
  .plan-overview,
  .member-lower-grid {
    grid-template-columns: 1fr;
  }
  table { min-width: 760px; }
  .page-head,
  .section-head-row,
  .member-section-title {
    flex-direction: column;
    align-items: flex-start;
  }
}
