:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --surface-3: #f9faf7;
  --text: #141916;
  --muted: #6c746f;
  --line: #dde2dc;
  --brand: #0d4f45;
  --brand-2: #c9a45c;
  --danger: #aa3d36;
  --ok: #1f7651;
  --shadow: 0 18px 44px rgba(24, 31, 28, 0.08);
  --shadow-soft: 0 8px 24px rgba(24, 31, 28, 0.06);
  --ring: 0 0 0 4px rgba(13, 79, 69, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(244, 245, 242, 0) 280px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 244, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 15px;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.nav button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.nav button {
  padding: 0 14px;
}

.nav button.active {
  background: var(--brand);
  color: #fff;
}

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

.icon-button {
  position: relative;
  width: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.badge {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-2);
  color: #2d2110;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  max-width: 190px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid #d8e5dc;
  border-radius: 8px;
  background: #edf7f1;
}

.notice h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.1;
  letter-spacing: 0;
}

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

.shop-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  margin: -6px 0 18px;
  padding: 12px;
  border: 1px solid rgba(24, 31, 28, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-soft);
}

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

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.product-media {
  display: grid;
  height: 190px;
  place-items: center;
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.62), transparent 26%),
    linear-gradient(135deg, var(--tone-a), var(--tone-b));
}

.product-media span {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  color: rgba(18, 30, 25, 0.62);
  font-size: 42px;
  font-weight: 800;
}

.product-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 16px;
}

.row,
.split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-title {
  margin: 0;
  font-size: 18px;
}

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

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

.small {
  font-size: 13px;
}

.primary,
.secondary,
.danger,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 7px;
  font-weight: 700;
}

.primary {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
}

.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.danger {
  border: 1px solid rgba(191, 63, 54, 0.24);
  background: #fff5f4;
  color: var(--danger);
}

.ghost {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 16px;
}

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

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

.section-head h2,
.section-head p {
  margin: 0;
}

.section-head p {
  margin-top: 4px;
}

.toolbar {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

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

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

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

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
}

.cart-list,
.order-list,
.admin-list {
  display: grid;
  gap: 12px;
}

.line-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-product {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-product-head,
.user-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-admin-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(24, 31, 28, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.compact-form {
  gap: 10px;
}

.compact-form textarea {
  min-height: 62px;
}

.pay-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #ead7a7;
  border-radius: 8px;
  background: #fff8e7;
  color: #4b3a14;
}

.pay-box p {
  margin: 6px 0 0;
  color: #6b592c;
  line-height: 1.6;
}

.order-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qty button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

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

.empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed #ccd6d0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  text-align: center;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.drawer.open {
  display: block;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 17, 0.34);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(460px, 100%);
  height: 100%;
  background: var(--surface);
  box-shadow: -20px 0 60px rgba(18, 30, 25, 0.18);
}

.drawer-head,
.drawer-foot {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.drawer-body {
  overflow: auto;
  padding: 16px;
}

.auth-box {
  display: grid;
  width: min(480px, 100%);
  margin: 36px auto 0;
  gap: 14px;
}

.account-home {
  display: grid;
  min-height: 360px;
  place-items: center;
}

.account-card {
  display: grid;
  width: min(620px, 100%);
  gap: 20px;
}

.account-card h1 {
  margin: 6px 0 8px;
  font-size: 30px;
  line-height: 1.1;
}

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

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

.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.tabs button {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tabs button.active {
  background: #fff;
  color: var(--text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.admin-hub {
  display: grid;
  gap: 16px;
}

.admin-section-cards,
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-card,
.overview-card {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
}

.admin-card span,
.overview-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-card strong,
.overview-card strong {
  font-size: 18px;
}

.admin-card small,
.overview-card small {
  color: var(--muted);
  line-height: 1.45;
}

.admin-card.active {
  border-color: rgba(23, 107, 91, 0.35);
  background: #eef8f3;
}

.admin-overview {
  display: grid;
  gap: 18px;
}

.admin-overview h2 {
  margin-bottom: 8px;
  font-size: 26px;
}

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

.admin-detail-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #14231e;
  color: #fff;
  box-shadow: var(--shadow);
}

button,
.card,
.panel,
.stat,
.admin-card,
.overview-card,
.icon-button,
.user-chip,
input,
select,
textarea {
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.topbar {
  border-bottom-color: rgba(20, 25, 22, 0.08);
  background: rgba(248, 249, 246, 0.82);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.brand-mark {
  background: linear-gradient(145deg, #0b5a4d, #103d37);
  box-shadow:
    0 10px 22px rgba(13, 79, 69, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.brand-text strong {
  letter-spacing: 0.02em;
}

.nav,
.icon-button,
.user-chip,
.secondary,
.tabs {
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.82) inset,
    0 10px 28px rgba(28, 36, 32, 0.045);
}

.nav button.active,
.tabs button.active {
  background: #13221e;
  color: #fff;
  box-shadow: 0 8px 18px rgba(19, 34, 30, 0.18);
}

.primary {
  border-color: #123f38;
  background: linear-gradient(180deg, #17685b, #0e5046);
  box-shadow:
    0 10px 22px rgba(13, 79, 69, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.primary:hover,
.nav button:hover,
.secondary:hover,
.ghost:hover,
.icon-button:hover,
.user-chip:hover,
.admin-card:hover,
.overview-card:hover,
.card:hover {
  transform: translateY(-1px);
}

.primary:hover {
  background: linear-gradient(180deg, #1b7566, #10594e);
}

.notice {
  border-color: rgba(13, 79, 69, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(236, 243, 238, 0.88)),
    #eef4ef;
  box-shadow: var(--shadow-soft);
}

.notice h1 {
  color: #111714;
}

.card,
.panel,
.stat,
.admin-card,
.overview-card {
  border-color: rgba(24, 31, 28, 0.1);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
}

.card:hover,
.admin-card:hover,
.overview-card:hover {
  border-color: rgba(13, 79, 69, 0.18);
  box-shadow: 0 18px 44px rgba(24, 31, 28, 0.11);
}

.product-media {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(10, 24, 21, 0.1)),
    linear-gradient(135deg, var(--tone-a), var(--tone-b));
}

.product-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.34), transparent 38%, rgba(255, 255, 255, 0.12)),
    linear-gradient(180deg, transparent, rgba(11, 18, 16, 0.08));
  pointer-events: none;
}

.product-media span {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.54);
  color: rgba(16, 28, 24, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 16px 36px rgba(16, 28, 24, 0.12);
  backdrop-filter: blur(10px);
}

.price {
  color: #0f5b4e;
}

input,
select,
textarea {
  border-color: rgba(24, 31, 28, 0.12);
  background: rgba(255, 255, 255, 0.86);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(13, 79, 69, 0.46);
  box-shadow: var(--ring);
}

.line-item,
.admin-product {
  border-color: rgba(24, 31, 28, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.status {
  background: #eef4ef;
  color: #0d4f45;
}

.badge {
  background: #c9a45c;
  color: #20180a;
  box-shadow: 0 8px 18px rgba(201, 164, 92, 0.28);
}

.empty {
  border-color: rgba(24, 31, 28, 0.12);
  background: rgba(255, 255, 255, 0.54);
}

@media (max-width: 860px) {
  .topbar {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
  }

  .nav button {
    flex: 1;
    padding: 0 8px;
  }

  .grid,
  .stats,
  .admin-section-cards,
  .overview-grid,
  .admin-detail-grid {
    grid-template-columns: 1fr;
  }

  .notice {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .shop-search {
    grid-template-columns: 1fr;
  }

  .user-chip {
    max-width: 145px;
  }
}

@media (max-width: 520px) {
  .brand {
    min-width: 0;
  }

  .brand-text span {
    display: none;
  }

  .actions {
    margin-left: auto;
  }

  .main {
    width: min(100% - 24px, 1180px);
  }

  .product-media {
    height: 165px;
  }

  .split-row,
  .line-item,
  .admin-product-head,
  .user-admin-head {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }
}
