:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --line: #d9e2f2;
  --line-strong: #b9c8df;
  --text: #172033;
  --muted: #64748b;
  --muted-2: #8da0ba;
  --brand: #0b63e5;
  --brand-2: #0ea5e9;
  --brand-dark: #073d8f;
  --ok: #0f9f6e;
  --warn: #d97706;
  --danger: #dc2626;
  --ink: #0f172a;
  --shadow: 0 18px 44px rgba(19, 45, 85, 0.09);
  --shadow-soft: 0 10px 24px rgba(19, 45, 85, 0.06);
  --radius: 10px;
  --radius-sm: 6px;
  --content: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--content), calc(100vw - 40px));
  min-height: 64px;
  margin: 0 auto;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  font-weight: 800;
  color: var(--brand);
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 12px;
  letter-spacing: 0;
}

.top-nav,
.sub-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn,
.sub-nav a,
.tab-btn,
.ghost-btn,
.primary-btn,
.soft-btn,
.danger-btn {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.nav-btn.active,
.sub-nav a.active,
.tab-btn.active {
  background: #eaf2ff;
  color: var(--brand);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  width: 230px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface-soft);
  color: var(--text);
}

.content {
  width: min(var(--content), calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  align-items: center;
  min-height: 430px;
  gap: 40px;
  padding: 48px 0 36px;
}

.hero-copy h1 {
  max-width: 680px;
  margin: 0 0 18px;
  color: var(--ink);
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 610px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.hero-actions,
.row-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.primary-btn {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 20px rgba(11, 99, 229, 0.18);
}

.soft-btn {
  border-color: #c6d7f2;
  background: #eef5ff;
  color: var(--brand);
}

.ghost-btn {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.danger-btn {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--danger);
}

.hero-media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #dfeefa;
  box-shadow: var(--shadow);
}

.hero-media img {
  display: block;
  width: 100%;
  min-height: 320px;
  object-fit: cover;
}

.media-float {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 210px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

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

.metric,
.panel,
.card,
.table-wrap,
.flow-strip,
.form-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.metric {
  padding: 18px;
}

.metric strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
}

.metric span,
.small,
.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.section {
  margin-top: 34px;
}

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

.section-title h2,
.page-title h1 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.25;
}

.section-title p,
.page-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.category {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 8px;
  background: var(--surface);
  text-align: center;
  color: var(--text);
  font-weight: 700;
}

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

.card {
  overflow: hidden;
}

.card-media {
  position: relative;
  height: 172px;
  overflow: hidden;
  background: #e6f3ff;
}

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

.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(3, 20, 43, 0.08));
}

.card-body {
  padding: 16px;
}

.card h3,
.panel h3,
.form-panel h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #edf4ff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.tag.warn {
  background: #fff7ed;
  color: var(--warn);
}

.tag.ok {
  background: #ecfdf5;
  color: var(--ok);
}

.price {
  color: var(--brand);
  font-size: 22px;
  font-weight: 800;
}

.price small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 10px 0 20px;
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 47% 1fr;
  gap: 26px;
  padding: 18px;
}

.detail-hero .hero-media {
  box-shadow: none;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.spec {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.spec b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.panel {
  padding: 18px;
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
}

.flow-step {
  position: relative;
  min-height: 82px;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.flow-step:last-child {
  border-right: 0;
}

.flow-step.active {
  background: #eef6ff;
}

.flow-step b {
  display: block;
  margin-bottom: 6px;
}

.sub-nav {
  position: sticky;
  top: 65px;
  z-index: 15;
  margin: -8px 0 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
}

.side-panel {
  position: sticky;
  top: 130px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.side-panel a {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.side-panel a.active,
.side-panel a:hover {
  background: #eaf2ff;
  color: var(--brand);
}

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

.table-wrap {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

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

th {
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef2ff;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.status.ok {
  background: #ecfdf5;
  color: var(--ok);
}

.status.warn {
  background: #fff7ed;
  color: var(--warn);
}

.status.danger {
  background: #fff1f2;
  color: var(--danger);
}

.form-panel {
  padding: 18px;
}

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

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.notice {
  border: 1px solid #bcd7ff;
  border-radius: 10px;
  padding: 14px 16px;
  background: #eff6ff;
  color: #1e3a8a;
  line-height: 1.7;
}

.notice.warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #7c2d12;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 12px;
}

.timeline-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 28px;
  background: #fbfdff;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  min-width: 260px;
  border: 1px solid #bcd7ff;
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--text);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  padding: 28px 0 0;
  color: var(--muted);
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ecf6;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

@media (max-width: 980px) {
  .topbar-inner,
  .content {
    width: min(100vw - 24px, var(--content));
  }

  .topbar-inner,
  .top-nav,
  .top-actions {
    flex-wrap: wrap;
  }

  .hero,
  .detail-hero,
  .layout-two,
  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .product-grid,
  .dashboard-grid,
  .spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .search {
    width: 100%;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .metric-grid,
  .product-grid,
  .dashboard-grid,
  .spec-grid,
  .category-grid,
  .form-grid,
  .flow-strip {
    grid-template-columns: 1fr;
  }

  .flow-step {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .page-title,
  .section-head {
    display: block;
  }

  .table-wrap {
    overflow-x: auto;
  }
}
