:root {
  --ink: #16202b;
  --muted: #617284;
  --subtle: #eef3f5;
  --line: #d9e2e8;
  --paper: #ffffff;
  --wash: #f6f8f7;
  --charcoal: #151a1f;
  --graphite: #27313b;
  --teal: #0f9f88;
  --teal-dark: #08715f;
  --amber: #c9831f;
  --red: #bb3f35;
  --blue: #2f6db1;
  --shadow: 0 18px 50px rgba(22, 32, 43, .12);
  --hero-image: url("/assets/ne-hero-factory.png");
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(217, 226, 232, .8);
  backdrop-filter: blur(16px);
}

.nav {
  width: min(1280px, calc(100% - 40px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
  font-weight: 900;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--charcoal), var(--teal));
  box-shadow: 0 10px 24px rgba(15, 159, 136, .24);
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-text strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand-text span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  color: #374858;
  font-size: 14px;
  font-weight: 760;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--teal-dark);
  background: #e8f6f2;
  outline: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.text-btn,
.primary-btn,
.ghost-btn,
.danger-btn {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 850;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.icon-btn {
  width: 40px;
  padding: 0;
  color: var(--graphite);
  background: #fff;
  border-color: var(--line);
}

.text-btn {
  color: var(--graphite);
  background: #fff;
  border-color: var(--line);
}

.primary-btn {
  color: #fff;
  background: var(--teal);
  box-shadow: 0 12px 24px rgba(15, 159, 136, .22);
}

.ghost-btn {
  color: var(--teal-dark);
  background: #eaf8f5;
  border-color: #c5e8df;
}

.danger-btn {
  color: #fff;
  background: var(--red);
}

.icon-btn:hover,
.text-btn:hover,
.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.hero {
  position: relative;
  min-height: 78vh;
  display: grid;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background-image:
    linear-gradient(90deg, rgba(12, 17, 22, .88), rgba(12, 17, 22, .62) 38%, rgba(12, 17, 22, .22) 68%, rgba(12, 17, 22, .08)),
    var(--hero-image);
  background-size: cover;
  background-position: center;
}

.hero-inner {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 92px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: #caefe8;
  background: rgba(255, 255, 255, .08);
  font-size: 13px;
  font-weight: 850;
}

.hero h1 {
  width: min(780px, 100%);
  margin: 22px 0 0;
  font-size: clamp(42px, 6.8vw, 82px);
  line-height: 1;
  font-weight: 950;
}

.hero-copy {
  width: min(660px, 100%);
  margin: 24px 0 30px;
  color: rgba(255, 255, 255, .82);
  font-size: 17px;
  line-height: 1.78;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-stats {
  width: min(1280px, calc(100% - 40px));
  margin: -46px auto 0;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.stat-item {
  min-height: 92px;
  padding: 20px 22px;
  border-right: 1px solid var(--line);
}

.stat-item:last-child {
  border-right: 0;
}

.stat-item strong {
  display: block;
  color: var(--charcoal);
  font-size: 28px;
  line-height: 1.05;
  margin-bottom: 5px;
}

.stat-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.band,
.wide-band {
  width: 100%;
}

.band-inner {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 82px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.section-kicker {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 920;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.section-head h2,
.admin-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.12;
  font-weight: 950;
}

.section-head p {
  margin: 0;
  width: min(520px, 100%);
  color: var(--muted);
  line-height: 1.72;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.capability {
  min-height: 210px;
  padding: 28px;
  border-right: 1px solid var(--line);
}

.capability:last-child {
  border-right: 0;
}

.capability b {
  display: block;
  color: var(--amber);
  font-size: 13px;
  margin-bottom: 20px;
}

.capability h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.capability p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.product-band {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.segment {
  min-height: 38px;
  flex: 0 0 auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #415262;
  padding: 0 13px;
  font-weight: 820;
}

.segment.is-active {
  color: #fff;
  background: var(--charcoal);
  border-color: var(--charcoal);
}

.search-box {
  position: relative;
  width: min(320px, 100%);
}

.search-box input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
  background: #fff;
}

.search-box input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 159, 136, .12);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.product-card {
  display: grid;
  grid-template-rows: 230px auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(22, 32, 43, .08);
}

.product-card img {
  width: 100%;
  height: 230px;
  display: block;
  object-fit: cover;
  background: var(--subtle);
}

.product-body {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.product-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.22;
}

.product-card p {
  min-height: 70px;
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
}

.product-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.fact {
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.fact span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
}

.fact strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-actions button {
  flex: 1;
}

.factory-band {
  color: #eaf1ef;
  background: var(--charcoal);
}

.factory-band .section-kicker,
.factory-band h2 {
  color: #fff;
}

.factory-band .section-head p {
  color: #bac8c6;
}

.process-layout {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 22px;
  align-items: stretch;
}

.process-photo {
  min-height: 520px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .16);
}

.process-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.process-list {
  display: grid;
  gap: 12px;
}

.process-step {
  min-height: 118px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
}

.process-step b {
  color: #64d7c2;
  font-size: 13px;
}

.process-step h3 {
  margin: 8px 0;
  color: #fff;
}

.process-step p {
  margin: 0;
  color: #bac8c6;
  line-height: 1.65;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.case-item {
  min-height: 210px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.case-item span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: #e9f7f4;
  font-size: 12px;
  font-weight: 850;
}

.case-item h3 {
  margin: 18px 0 10px;
  font-size: 22px;
}

.case-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.contact-band {
  background: #fff;
  border-top: 1px solid var(--line);
}

.contact-layout {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 24px;
  align-items: start;
}

.contact-panel,
.inquiry-panel,
.admin-card,
.admin-panel,
.login-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(22, 32, 43, .08);
}

.contact-panel {
  padding: 26px;
}

.contact-panel h3 {
  margin: 0 0 12px;
  font-size: 24px;
}

.contact-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.contact-list div {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.contact-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.contact-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.inquiry-panel {
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.is-wide {
  grid-column: 1 / -1;
}

.field label {
  color: #354656;
  font-size: 13px;
  font-weight: 850;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

.field input,
.field select {
  height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 118px;
  resize: vertical;
  padding: 12px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 159, 136, .12);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.site-footer {
  color: #bcc9c7;
  background: #111619;
}

.footer-inner {
  width: min(1280px, calc(100% - 40px));
  min-height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-inner strong {
  color: #fff;
}

.drawer,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.drawer.is-open,
.modal-backdrop.is-open {
  display: block;
}

.drawer::before,
.modal-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 16, .46);
}

.drawer-panel,
.modal-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: min(620px, 100%);
  height: 100%;
  overflow: auto;
  background: #fff;
  box-shadow: -18px 0 60px rgba(0, 0, 0, .2);
}

.modal-panel {
  inset: 6vh 50%;
  right: auto;
  transform: translateX(50%);
  width: min(920px, calc(100% - 32px));
  height: min(780px, calc(100vh - 12vh));
  border-radius: 8px;
}

.drawer-head,
.modal-head {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.drawer-body,
.modal-body {
  padding: 24px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-layout img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.spec-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.spec-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.spec-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  max-width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  display: none;
  padding: 13px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--charcoal);
  box-shadow: var(--shadow);
  font-weight: 820;
}

.toast.is-open {
  display: block;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 276px 1fr;
  background: #f5f7f6;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  color: #e8efee;
  background: #151a1f;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.admin-brand .brand-mark {
  box-shadow: none;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav button {
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #c5d0ce;
  background: transparent;
  text-align: left;
  font-weight: 840;
}

.admin-nav button.is-active,
.admin-nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .12);
}

.admin-sidebar-footer {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 10px;
}

.admin-main {
  min-width: 0;
  padding: 26px;
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.admin-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.admin-card {
  padding: 18px;
}

.admin-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.admin-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.admin-panel {
  overflow: hidden;
}

.panel-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #485968;
  background: #f8faf9;
  font-size: 12px;
  font-weight: 900;
}

td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--graphite);
  background: #edf1f2;
  font-size: 12px;
  font-weight: 850;
}

.badge.is-active,
.badge.is-won,
.badge.is-quoted {
  color: var(--teal-dark);
  background: #e7f6f2;
}

.badge.is-new,
.badge.is-high,
.badge.is-urgent {
  color: #8a5514;
  background: #fff2d9;
}

.badge.is-archived,
.badge.is-lost,
.badge.is-spam {
  color: #8a2d27;
  background: #f9e6e3;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.compact-input,
.compact-select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 18px;
}

.json-editor {
  width: 100%;
  min-height: 440px;
  border: 0;
  outline: none;
  padding: 18px;
  resize: vertical;
  background: #101417;
  color: #e9f0ee;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(17, 22, 25, .85), rgba(17, 22, 25, .52)),
    url("/assets/ne-hero-factory.png") center / cover;
}

.login-panel {
  width: min(440px, 100%);
  padding: 28px;
}

.login-panel h1 {
  margin: 18px 0 8px;
  font-size: 30px;
}

.login-panel p {
  margin: 0 0 22px;
  color: var(--muted);
}

.admin-form {
  display: grid;
  gap: 14px;
}

.empty-state {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.loading {
  min-height: 60vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 850;
}

@media (max-width: 1080px) {
  .nav-links {
    display: none;
  }

  .hero-stats,
  .capability-grid,
  .product-grid,
  .case-grid,
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .capability:nth-child(2) {
    border-right: 0;
  }

  .capability:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .process-layout,
  .contact-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
  }

  .admin-sidebar-footer {
    position: static;
    margin-top: 18px;
  }
}

@media (max-width: 720px) {
  .nav,
  .hero-inner,
  .hero-stats,
  .band-inner,
  .footer-inner {
    width: min(100% - 28px, 1280px);
  }

  .brand {
    min-width: 0;
  }

  .brand-text span {
    display: none;
  }

  .nav {
    height: 62px;
  }

  .hero {
    min-height: 74vh;
  }

  .hero-inner {
    padding: 52px 0 74px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .hero-stats,
  .capability-grid,
  .product-grid,
  .case-grid,
  .metric-grid,
  .form-grid,
  .editor-grid,
  .product-facts {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    margin-top: -26px;
  }

  .stat-item,
  .capability {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stat-item:last-child,
  .capability:last-child {
    border-bottom: 0;
  }

  .band-inner {
    padding: 58px 0;
  }

  .section-head,
  .filter-row,
  .admin-top,
  .panel-head {
    display: grid;
    align-items: start;
  }

  .search-box {
    width: 100%;
  }

  .card-actions,
  .form-actions {
    display: grid;
  }

  .modal-panel {
    inset: 0;
    width: 100%;
    height: 100%;
    transform: none;
    border-radius: 0;
  }

  .admin-main {
    padding: 16px;
  }
}
