:root {
  --ink: #16202a;
  --body: #33414f;
  --muted: #6b7a8c;
  --faint: #98a4b3;
  --line: #e5e9f0;
  --band: #f6f7f9;
  --white: #fff;
  --accent: #ff6a00;
  --accent-dark: #e85f00;
  --accent-soft: #fff3e9;
  --navy: #10243e;
  --navy-soft: #1b3355;
  --ok: #12b76a;
  --ok-soft: #e7f8ef;
  --warn: #f79009;
  --warn-soft: #fff5e5;
  --bad: #d92d20;
  --bad-soft: #fdeceb;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 36, 62, 0.04), 0 8px 24px rgba(16, 36, 62, 0.06);
  --maxw: 1280px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--white);
  color: var(--ink);
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', Inter, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

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

button {
  font: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: var(--ink);
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 28px;
  line-height: 1.25;
}

h2 {
  font-size: 20px;
  line-height: 1.35;
}

h3 {
  font-size: 16px;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.mono {
  font-variant-numeric: tabular-nums;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-outline {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--white);
}

.btn-outline:hover {
  background: var(--accent-soft);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--body);
}

.btn-ghost:hover {
  border-color: var(--faint);
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-lg {
  height: 48px;
  padding: 0 28px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  background: var(--band);
  border-color: var(--line);
  color: var(--faint);
  cursor: not-allowed;
  transform: none;
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-weight: 600;
}

.link-btn.plain {
  color: var(--muted);
}

.link-btn + .link-btn {
  margin-left: 14px;
}

/* ---------------- form ---------------- */

.field {
  margin-bottom: 18px;
}

.field > label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
}

.field .req {
  color: var(--bad);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.12);
}

.input::placeholder {
  color: var(--faint);
}

.hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d3dae3;
  border: 0;
  padding: 0;
  transition: background 0.18s ease;
}

.switch::after {
  content: '';
  position: absolute;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s cubic-bezier(0.32, 0.72, 0, 1);
}

.switch[aria-checked='true'] {
  background: var(--accent);
}

.switch[aria-checked='true']::after {
  transform: translateX(18px);
}

/* ---------------- header / nav ---------------- */

.utility {
  border-bottom: 1px solid var(--line);
  background: var(--white);
  font-size: 13px;
  color: var(--muted);
}

.utility .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 38px;
}

.utility a:hover {
  color: var(--accent);
}

.utility .spacer {
  flex: 1;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--band);
}

.lang-switch button {
  border: 0;
  background: none;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--muted);
}

.lang-switch button + button {
  border-left: 1px solid var(--line);
}

.lang-switch button[aria-current='true'] {
  background: #fff;
  color: var(--accent);
  font-weight: 700;
}

.masthead {
  border-bottom: 1px solid var(--line);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.masthead .logo {
  justify-content: center;
  gap: 0;
  height: 56px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.searchbar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 620px;
}

.searchbar .input {
  height: 44px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: 0;
}

.searchbar .btn {
  height: 44px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.hot-words {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.hot-words button {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--muted);
}

.hot-words button:hover {
  color: var(--accent);
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  font-weight: 600;
  white-space: nowrap;
}

.cart-badge {
  position: absolute;
  top: -8px;
  left: 12px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
}

.mainnav .wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 56px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mainnav .wrap::-webkit-scrollbar {
  display: none;
}

.mainnav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  color: var(--body);
  white-space: nowrap;
  padding: 0 26px;
}

.mainnav a[aria-current='page'] {
  color: var(--accent);
  font-weight: 700;
}

.mainnav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
}

.mainnav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 2px;
  background: var(--accent);
}

/* ---------------- tabs & filters ---------------- */

.cat-tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.cat-tabs::-webkit-scrollbar {
  display: none;
}

.cat-tabs button {
  position: relative;
  border: 0;
  background: none;
  padding: 14px 0;
  font-size: 15px;
  color: var(--body);
  white-space: nowrap;
}

.cat-tabs button[aria-current='true'] {
  color: var(--accent);
  font-weight: 700;
}

.cat-tabs button[aria-current='true']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 16px 0 20px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  font-size: 13px;
  color: var(--muted);
}

.filterbar .flabel {
  color: var(--body);
  font-weight: 600;
}

.filterbar .fdiv {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.filterbar .group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.chip {
  border: 1px solid transparent;
  background: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--body);
}

.chip[aria-current='true'] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* ---------------- product grid ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  padding: 8px 0 40px;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  border-color: #d6dde6;
  box-shadow: var(--shadow);
}

.card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--band);
}

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

.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  flex: 1;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.card-code {
  font-size: 12px;
  color: var(--faint);
}

.price {
  color: var(--accent);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.price small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}

.dot.warn {
  background: var(--warn);
}

.dot.bad {
  background: var(--faint);
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 14px;
}

.card-foot .btn {
  flex: 1;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  flex: none;
}

.stepper button {
  width: 30px;
  height: 32px;
  border: 0;
  background: var(--band);
  color: var(--body);
  font-size: 15px;
  line-height: 1;
}

.stepper button:hover {
  background: #eceff3;
}

.stepper input {
  width: 46px;
  height: 32px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stepper input:focus {
  outline: none;
}

.thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--band);
  object-fit: cover;
  flex: none;
}

.thumb-lg {
  width: 84px;
  height: 84px;
}

/* ---------------- placeholder image ---------------- */

.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 56px;
  background: linear-gradient(135deg, #f2f4f7 0%, #e9edf2 100%);
  color: #a9b4c0;
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* ---------------- hero / home ---------------- */

.hero-band {
  position: relative;
  min-height: 430px;
  margin-top: 18px;
  background: #dfe3e8 url('/assets/img/hero.jpg') center right / cover no-repeat;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.96) 26%, rgba(255, 255, 255, 0.55) 48%, rgba(255, 255, 255, 0) 72%);
}

.hero-inner {
  position: relative;
  display: flex;
  min-height: 430px;
  align-items: center;
}

.hero-copy {
  max-width: 620px;
  padding: 48px 0;
}

.hero-copy h1 {
  font-size: 52px;
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.hero-copy p {
  margin: 18px 0 30px;
  color: var(--body);
  font-size: 15px;
}

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

.stat-card {
  position: absolute;
  top: 50%;
  right: max(28px, calc((100vw - var(--maxw)) / 2 + 28px));
  min-width: 168px;
  padding: 6px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  text-align: center;
  transform: translateY(-50%);
}

.stat-card > div {
  padding: 14px 0;
}

.stat-card > div + div {
  border-top: 1px solid var(--line);
}

.stat-card .k {
  font-size: 12px;
  color: var(--muted);
}

.stat-card .v {
  margin-top: 2px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cat-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  padding: 8px 0 32px;
}

.cat-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  text-align: center;
  padding-bottom: 10px;
}

.cat-tile .box {
  display: flex;
  aspect-ratio: 2 / 1;
  align-items: center;
  justify-content: center;
  background: var(--band);
  color: var(--faint);
  font-size: 13px;
}

.cat-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-tile span {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.section-head h2 {
  font-size: 22px;
}

.section-head .spacer {
  flex: 1;
}

/* ---------------- tables ---------------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table thead th {
  background: var(--band);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.table tbody tr:hover {
  background: #fbfcfd;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table td.sticky-action {
  white-space: nowrap;
}

.row-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--band);
  color: var(--muted);
  white-space: nowrap;
}

.pill.ok {
  background: var(--ok-soft);
  color: #067647;
  border-color: #bdf0d5;
}

.pill.warn {
  background: var(--warn-soft);
  color: #b54708;
  border-color: #fdecc2;
}

.pill.bad {
  background: var(--bad-soft);
  color: #b42318;
  border-color: #fbcfc9;
}

.pill.accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: #ffd9bd;
}

.pill.info {
  background: #eef2f7;
  color: #354154;
}

/* ---------------- panels ---------------- */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h3 {
  font-size: 16px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
  padding-bottom: 48px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  color: var(--body);
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 14px;
  font-weight: 700;
}

.summary-total .price {
  font-size: 26px;
}

.tile-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: #fff;
}

.tile .v {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tile .k {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.tile.accent .v {
  color: var(--accent);
}

.tile.ok .v {
  color: var(--ok);
}

.tile.warn .v {
  color: var(--warn);
}

/* ---------------- pagination ---------------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 0 40px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------- empty & toast ---------------- */

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 40px;
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
  pointer-events: none;
}

.toast {
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: rise 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.err {
  background: var(--bad);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------------- modal / drawer ---------------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(16, 36, 62, 0.35);
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  animation: fade 0.18s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.drawer {
  width: min(440px, 100%);
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(16, 36, 62, 0.12);
  display: flex;
  flex-direction: column;
  animation: slide 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide {
  from {
    transform: translateX(24px);
    opacity: 0.4;
  }
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h3 {
  flex: 1;
  font-size: 17px;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 24px;
}

.drawer-foot {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}

.x-btn {
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  padding: 4px 8px;
}

/* ---------------- login ---------------- */

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.login-side {
  display: flex;
  flex-direction: column;
  padding: 28px 8% 26px;
}

.login-photo {
  background: #e9edf2 url('/assets/img/login.jpg') center / cover no-repeat;
  position: relative;
  overflow: hidden;
}

.login-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-top {
  display: flex;
  justify-content: flex-end;
}

.login-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0;
}

.login-brand {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.login-brand .mark {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--accent);
  flex: none;
}

.login-brand .bt {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.login-brand .bs {
  margin-top: 6px;
  font-size: 15px;
  color: var(--muted);
}

.login-divider {
  height: 1px;
  margin: 30px 0 34px;
  background: var(--line);
}

.login-card {
  width: min(420px, 100%);
}

.pw-wrap {
  position: relative;
  display: block;
}

.pw-wrap .input {
  padding-right: 44px;
}

.pw-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  display: flex;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--faint);
  transform: translateY(-50%);
}

.pw-eye:hover {
  color: var(--body);
}

.login-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.login-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 12px;
}

.login-foot a {
  color: var(--muted);
}

.login-foot a:hover {
  color: var(--accent);
}

.login-side .spacer {
  flex: 1;
}

.tabs {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}

.tabs button {
  position: relative;
  border: 0;
  background: none;
  padding: 10px 0;
  font-size: 15px;
  color: var(--muted);
}

.tabs button[aria-current='true'] {
  color: var(--ink);
  font-weight: 700;
}

.tabs button[aria-current='true']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--band);
  color: var(--muted);
  font-size: 13px;
}

.notice.err {
  background: var(--bad-soft);
  color: #b42318;
  margin-bottom: 16px;
}

/* ---------------- detail ---------------- */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 40px;
  padding: 28px 0 48px;
}

.gallery-main {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--band);
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbs {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.thumbs button {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  overflow: hidden;
  padding: 0;
  background: var(--band);
}

.thumbs button[aria-current='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.16);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 18px 0;
}

.spec-grid > div {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.spec-grid > div:last-child {
  border-right: 0;
}

.spec-grid .k {
  font-size: 12px;
  color: var(--muted);
}

.spec-grid .v {
  font-size: 20px;
  font-weight: 700;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.spec-grid .v small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.spec-grid .v .dot {
  width: 9px;
  height: 9px;
}

.stepper .su {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  border-right: 1px solid var(--line);
  padding-right: 10px;
}

.stepper input:has(+ .su) {
  border-right: 0;
}

.stepper-lg button {
  width: 46px;
  height: 48px;
  font-size: 18px;
}

.stepper-lg input {
  width: 74px;
  height: 48px;
  font-size: 18px;
  font-weight: 600;
}

.stepper-lg .su {
  height: 48px;
  padding-right: 14px;
  font-size: 13px;
}

.swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.swatch {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
  padding: 0;
}

.swatch[aria-current='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.16);
}

/* ---------------- admin shell ---------------- */

.admin {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--band);
}

.side {
  background: var(--navy);
  color: #cdd8e6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side .logo {
  color: #fff;
  padding: 20px 20px 18px;
  font-size: 17px;
}

.side nav {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
  flex: 1;
  overflow: auto;
}

.side nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  font-size: 14px;
  color: #b9c7d8;
  border-left: 3px solid transparent;
}

.side nav a:hover {
  color: #fff;
  background: var(--navy-soft);
}

.side nav a[aria-current='page'] {
  color: #fff;
  background: var(--navy-soft);
  border-left-color: var(--accent);
  font-weight: 600;
}

.side .who {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 20px;
  font-size: 13px;
  color: #93a5ba;
}

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

.main-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.main-head h1 {
  font-size: 24px;
}

.main-head .sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.main-head .spacer {
  flex: 1;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .input,
.toolbar .select {
  width: auto;
  min-width: 160px;
  height: 38px;
}

.toolbar .spacer {
  flex: 1;
}

.card-plain {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.dropzone {
  border: 1px dashed #c9d3de;
  border-radius: var(--radius);
  background: #fff;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.hot {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  margin-bottom: 4px;
}

.steps {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 22px;
  flex-wrap: wrap;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.step i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
}

.step[data-state='done'] i {
  background: var(--ok-soft);
  border-color: #bdf0d5;
  color: #067647;
}

.step[data-state='active'] {
  color: var(--accent);
  font-weight: 700;
}

.step[data-state='active'] i {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step-line {
  width: 44px;
  height: 1px;
  background: var(--line);
}

.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--band);
  overflow: hidden;
  min-width: 60px;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  background: var(--band);
  color: var(--muted);
}

.rank-num.top {
  background: var(--accent);
  color: #fff;
}

.flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.flow i {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.flow i::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d3dae3;
}

.flow i.done::before {
  background: var(--accent);
}

.flow i.current::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.18);
}

.mobile-only {
  display: none;
}

/* 手机端底部导航（原型图 06）：默认隐藏，760 以下由 .tabbar 规则打开 */
.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  align-items: stretch;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(16, 24, 40, 0.06);
}
.tabbar a {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0 6px;
  color: var(--muted);
  font-size: 11px;
  min-width: 0;
}
.tabbar a span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tabbar a svg {
  width: 22px;
  height: 22px;
}
.tabbar a[aria-current='page'] {
  color: var(--accent);
  font-weight: 600;
}
.tab-badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 6px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

/* ---------------- responsive ---------------- */

@media (max-width: 1180px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cat-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .split,
  .detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-band {
    background-position: center;
  }
  .hero-shade {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.88) 52%, rgba(255, 255, 255, 0.55) 100%);
  }
  .hero-inner {
    min-height: 0;
  }
  .hero-copy {
    max-width: none;
    padding: 34px 0 26px;
  }
  .hero-copy h1 {
    font-size: 32px;
  }
  .stat-card {
    position: static;
    display: flex;
    gap: 18px;
    margin: 0 20px 22px;
    min-width: 0;
    padding: 14px 18px;
    text-align: left;
    transform: none;
  }
  .stat-card > div {
    padding: 0;
  }
  .stat-card > div + div {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding-left: 18px;
  }
  .login-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .login-photo {
    min-height: 190px;
    background-position: center 40%;
  }
  .login-side {
    padding: 22px 24px 26px;
  }
  .login-brand .bt {
    font-size: 25px;
  }
  .login-divider {
    margin: 22px 0 26px;
  }
  .admin {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .side .logo {
    padding: 12px 16px;
    white-space: nowrap;
  }
  .side nav {
    flex-direction: row;
    padding: 0;
  }
  .side nav a {
    border-left: 0;
    border-bottom: 3px solid transparent;
    padding: 12px 14px;
    white-space: nowrap;
  }
  .side nav a[aria-current='page'] {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
  .side .who {
    display: none;
  }
  .main {
    padding: 20px 16px 48px;
  }
  .tile-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .wrap {
    padding: 0 16px;
  }
  .masthead .wrap {
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .masthead .wrap > div {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .searchbar {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .utility .wrap {
    gap: 12px;
    height: 34px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .utility .wrap::-webkit-scrollbar {
    display: none;
  }
  .utility .wrap > * {
    flex: none;
    white-space: nowrap;
  }
  .utility .spacer {
    flex: 1 0 8px;
  }
  .hot-words {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .hot-words::-webkit-scrollbar {
    display: none;
  }
  .hot-words > * {
    flex: none;
    white-space: nowrap;
  }
  /* 顶部导航在手机上由底部 tab 栏替代（原型图 06） */
  .mainnav {
    display: none;
  }
  .cat-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .cat-tabs::-webkit-scrollbar {
    display: none;
  }
  .cat-tabs button {
    flex: none;
    white-space: nowrap;
  }
  .filterbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    align-items: center;
  }
  .filterbar::-webkit-scrollbar {
    display: none;
  }
  .filterbar > * {
    flex: none;
    white-space: nowrap;
  }
  .tabbar {
    display: flex;
  }
  body {
    padding-bottom: 62px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .cat-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .card-foot {
    flex-wrap: wrap;
  }
  .card-foot .btn {
    flex-basis: 100%;
  }
  .spec-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .spec-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .table.responsive thead {
    display: none;
  }
  .table.responsive tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 6px 12px;
  }
  .table.responsive td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px dashed var(--line);
    padding: 9px 0;
  }
  .table.responsive td:last-child {
    border-bottom: 0;
  }
  .table.responsive td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 13px;
  }
  .table.responsive td.sticky-action {
    white-space: normal;
  }
  .drawer {
    width: 100%;
  }
  .mobile-only {
    display: flex;
  }
  .hide-sm {
    display: none !important;
  }
}

/* ---------------- quick order (原型 05) ---------------- */

.quick-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.quick-add {
  display: flex;
  flex: 1;
  min-width: 280px;
}

.quick-add .input {
  height: 48px;
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: 0;
  font-size: 15px;
}

.quick-add .btn {
  height: 48px;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0 26px;
}

.quick-add-row {
  display: block;
  width: calc(100% - 24px);
  margin: 12px;
  padding: 14px;
  border: 1px dashed #cfd6df;
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  font-size: 14px;
}

.quick-add-row:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.quick-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.quick-foot .k {
  font-size: 15px;
  font-weight: 700;
  color: var(--body);
}

.quick-foot .sum {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.table tr.is-active td {
  background: #fffdfb;
}

.table tr.is-active td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.table tr.quick-empty td {
  padding: 30px;
  text-align: center;
}

.pill.ok-pill {
  border-color: #b7e6cb;
  background: var(--ok-soft);
  color: #067647;
}

.pill.warn-pill {
  border-color: #fde0a8;
  background: var(--warn-soft);
  color: #b54708;
}

.pill.bad-pill {
  border-color: #fbcfd0;
  background: var(--bad-soft);
  color: #b42318;
}

.pill.faint-pill {
  border-color: var(--line);
  background: var(--band);
  color: var(--faint);
}

/* ---------------- cart (原型 03) ---------------- */

.table th.chk,
.table td.chk {
  width: 34px;
  text-align: center;
}

.table td.chk input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.cart-foot {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 2px 0;
  font-size: 13px;
}

.summary-total {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.panel .btn-block + .btn-block {
  margin-top: 10px;
}

/* ---------------- product detail (原型 02) ---------------- */

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.meta-row b {
  color: var(--body);
  font-weight: 600;
}

.tab-body {
  padding: 20px 2px 8px;
  color: var(--body);
  line-height: 1.9;
  font-size: 14px;
}

.tab-body p + p {
  margin-top: 8px;
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.spec-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: #fff;
  font-size: 13px;
}

.spec-list span {
  color: var(--muted);
}

.thumbs button[aria-current='true'] {
  border-color: var(--accent);
}

/* ---------------- my orders (原型 14) ---------------- */

.order-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.order-tabs {
  border-bottom: 0;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-range .input,
.range-pick {
  height: 40px;
  width: auto;
  min-width: 132px;
  border-radius: var(--radius-sm);
}

.order-card {
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.oc-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.oc-tag {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #fff;
  background: var(--faint);
}

.oc-tag.tag-pending { background: #e0a23c; }
.oc-tag.tag-confirmed { background: #64748b; }
.oc-tag.tag-packing { background: var(--accent); }
.oc-tag.tag-shipped { background: #2f9e6b; }
.oc-tag.tag-done { background: #2f9e6b; }
.oc-tag.tag-cancelled { background: var(--bad); }

.oc-mid {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 16px;
}

.oc-items {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  min-width: 0;
}

.oc-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.oc-item-txt {
  display: flex;
  max-width: 130px;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.oc-item-txt em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.oc-sum {
  display: flex;
  margin-left: auto;
  flex-direction: column;
  flex: none;
  align-items: flex-end;
  gap: 12px;
}

.oc-sum-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.oc-sum .k {
  font-size: 13px;
  color: var(--muted);
}

.oc-sum .p {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
}

.flow-steps {
  display: flex;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.fs {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.fs-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

.fs.done .fs-dot,
.fs.current .fs-dot {
  background: var(--accent);
}

.fs.current .fs-dot {
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.18);
}

.fs-txt {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--muted);
}

.fs.done .fs-txt {
  color: var(--body);
}

.fs.current .fs-txt {
  color: var(--accent);
}

.fs-txt em {
  font-style: normal;
  font-size: 11px;
}

.fs-line {
  height: 2px;
  min-width: 40px;
  margin: 0 10px;
  background: var(--line);
  flex: 1;
}

.fs-line.on {
  background: var(--accent);
}

@media (max-width: 760px) {
  .oc-sum {
    width: 100%;
    align-items: stretch;
  }

  .oc-sum-row {
    justify-content: space-between;
  }

  .flow-steps {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .fs-line {
    min-width: 26px;
  }
}
