:root {
  --bg: #f3f1ea;
  --surface: #ffffff;
  --surface-2: #eef4f5;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d9ded9;
  --brand: #214c63;
  --brand-2: #2f6f77;
  --jade: #16735f;
  --gold: #ad741b;
  --red: #b42318;
  --green: #067647;
  --shadow: 0 10px 28px rgba(28, 43, 45, 0.1);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(33, 76, 99, 0.1), transparent 220px),
    radial-gradient(circle at 15% 20%, rgba(22, 115, 95, 0.08), transparent 250px),
    var(--bg);
  color: var(--ink);
}

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

button {
  border: 0;
}

#app {
  min-height: 100vh;
}

.phone {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(33, 76, 99, 0.08);
  position: relative;
}

.login {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.brand-mark {
  width: 66px;
  height: 66px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    var(--brand);
  box-shadow: var(--shadow);
}

.login h1 {
  margin: 16px 0 8px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

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

.panel,
.login-form,
.card,
.sheet,
.toast {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-form {
  padding: 16px;
  display: grid;
  gap: 13px;
}

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

.field > span {
  font-size: 13px;
  color: var(--muted);
}

.input {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.input input,
.input textarea,
.input select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.input textarea {
  min-height: 78px;
  padding: 11px 0;
  resize: vertical;
}

.topbar {
  min-height: 82px;
  padding: max(14px, env(safe-area-inset-top)) 14px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #fff;
  background: var(--brand);
}

.eyebrow {
  font-size: 12px;
  opacity: 0.78;
}

.title {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 850;
}

.content {
  padding: 14px 12px 102px;
  display: grid;
  gap: 12px;
}

.panel {
  padding: 13px;
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}

.head h2,
.head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.small {
  font-size: 12px;
}

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

.primary,
.secondary,
.ghost,
.icon-btn,
.tab,
.chip,
.qty,
.seg {
  min-height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease;
}

.primary:active,
.secondary:active,
.ghost:active,
.icon-btn:active,
.tab:active,
.chip:active,
.qty:active,
.seg:active {
  transform: translateY(1px);
}

.primary {
  padding: 0 15px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
}

.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secondary {
  padding: 0 13px;
  color: var(--brand);
  background: var(--surface-2);
  border: 1px solid #c3d4d7;
  font-weight: 800;
}

.ghost {
  padding: 0 9px;
  color: var(--ink);
  background: transparent;
}

.icon-btn {
  width: 42px;
  color: var(--ink);
  background: #f0f3f1;
}

.topbar .icon-btn {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.92);
}

.hero {
  min-height: 132px;
  border-radius: 8px;
  overflow: hidden;
  padding: 15px;
  display: grid;
  align-content: end;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(22, 44, 56, 0.94), rgba(33, 76, 99, 0.55)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='760' height='280' viewBox='0 0 760 280'%3E%3Crect width='760' height='280' fill='%23d4ddd9'/%3E%3Cg fill='%23f6f2e7' stroke='%2397a6a0' stroke-width='3'%3E%3Crect x='390' y='42' width='248' height='150' rx='8'/%3E%3Crect x='420' y='76' width='46' height='56' rx='4'/%3E%3Crect x='477' y='76' width='46' height='56' rx='4'/%3E%3Crect x='534' y='76' width='46' height='56' rx='4'/%3E%3C/g%3E%3Cg fill='%23214c63'%3E%3Crect x='82' y='76' width='210' height='120' rx='12'/%3E%3Crect x='112' y='48' width='150' height='40' rx='8'/%3E%3C/g%3E%3Cg fill='%23b17b2a'%3E%3Ccircle cx='128' cy='220' r='18'/%3E%3Ccircle cx='246' cy='220' r='18'/%3E%3Ccircle cx='452' cy='220' r='18'/%3E%3Ccircle cx='584' cy='220' r='18'/%3E%3C/g%3E%3Cpath d='M0 232h760v48H0z' fill='%2398aaa4'/%3E%3C/svg%3E");
  background-size: cover;
}

.hero strong {
  font-size: 21px;
  line-height: 1.25;
}

.hero span {
  margin-top: 7px;
  font-size: 12px;
  opacity: 0.86;
}

.category-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.category-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  white-space: nowrap;
}

.chip.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 800;
}

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

.list {
  display: grid;
  gap: 10px;
}

.card {
  padding: 11px;
}

.product-card {
  min-height: 238px;
  display: grid;
  grid-template-rows: 94px auto;
  gap: 10px;
}

.product-art {
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    #d7dfdd;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.product-art::before {
  content: "";
  width: 58%;
  height: 42%;
  border-radius: 8px;
  background: var(--brand);
  box-shadow: 18px 18px 0 rgba(177, 123, 42, 0.85);
}

.product-art.tile::before {
  width: 38%;
  height: 58%;
  background: #f8f0df;
  box-shadow:
    20px 0 0 #f8f0df,
    40px 0 0 #f8f0df;
  border: 2px solid #bcc4be;
}

.product-art.frame::before {
  width: 64%;
  height: 52%;
  background: transparent;
  border: 12px solid var(--jade);
  box-shadow: none;
}

.product-art.panel::before {
  width: 72%;
  height: 28%;
  background: #495963;
  box-shadow: none;
}

.product-art.corner::before {
  width: 46%;
  height: 46%;
  border-radius: 50%;
  background: #b17b2a;
  box-shadow: none;
}

.product-art.other::before {
  width: 54%;
  height: 28%;
  background: var(--brand-2);
  box-shadow: 0 18px 0 rgba(33, 76, 99, 0.5);
}

.card-title {
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.card-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.price {
  margin-top: 7px;
  color: var(--red);
  font-size: 18px;
  font-weight: 900;
}

.badge {
  flex: 0 0 auto;
  min-height: 25px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
}

.badge.info {
  color: var(--brand);
  background: #eaf2f3;
  border-color: #c7d9de;
}

.badge.warn {
  color: var(--gold);
  background: #fff5df;
  border-color: #e8cb8c;
}

.badge.ok {
  color: var(--green);
  background: #e8f6ee;
  border-color: #b9e5c8;
}

.badge.danger {
  color: var(--red);
  background: #fff1f0;
  border-color: #f1bbb7;
}

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

.row {
  justify-content: flex-start;
}

.line {
  padding: 10px 0;
  border-top: 1px solid #edf0ee;
}

.line:first-child {
  border-top: 0;
}

.package-parts {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.part {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #fbfcfb;
}

.part select {
  width: 100%;
  min-height: 38px;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 9px;
}

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

.qty {
  width: 34px;
  min-height: 34px;
  background: #eef1ef;
  color: var(--ink);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.seg {
  flex: 0 0 auto;
  padding: 0 11px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.seg.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  width: min(100%, 460px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.tab {
  min-height: 58px;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
}

.tab.active {
  color: var(--brand);
  background: #eaf2f3;
  font-weight: 850;
}

.empty {
  min-height: 116px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  background: rgba(16, 29, 35, 0.48);
}

.sheet {
  width: min(100%, 460px);
  max-height: 88vh;
  overflow: auto;
  margin: 0 auto;
  border-radius: 8px 8px 0 0;
  padding: 15px;
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  z-index: 60;
  transform: translateX(-50%);
  width: min(calc(100% - 28px), 432px);
  padding: 12px 14px;
  font-weight: 800;
}

.toast.error {
  color: var(--red);
  border-color: #efb4ae;
}

.toast.success {
  color: var(--green);
  border-color: #b9e5c8;
}

@media (min-width: 760px) {
  body {
    padding: 22px 0;
  }

  .phone,
  .login {
    min-height: calc(100vh - 44px);
    border-radius: 8px;
    overflow: hidden;
  }

  .bottom-nav {
    bottom: 22px;
    border-radius: 0 0 8px 8px;
  }
}
