:root {
  --ink: #182427;
  --muted: #718083;
  --line: #e3e9ea;
  --surface: #ffffff;
  --canvas: #f3f6f6;
  --teal: #173f43;
  --teal-2: #245a5e;
  --coral: #df6a5a;
  --coral-dark: #c55345;
  --coral-soft: #fff0ec;
  --sage-soft: #e8f2ee;
  --gold-soft: #f8efe1;
  --lavender-soft: #efedf7;
  --shadow: 0 10px 28px rgba(29, 52, 55, 0.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #dfe7e7;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "Microsoft YaHei UI", sans-serif;
  color: var(--ink);
  background: #dfe7e7;
  letter-spacing: 0;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

button, a {
  touch-action: manipulation;
}

svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.hidden { display: none !important; }

.login-view {
  min-height: 100vh;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(64px + var(--safe-top)) 26px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(145deg, #153d40 0%, #1b4b4f 58%, #2e6264 100%);
}

.login-art {
  color: #f9fbfb;
  margin-bottom: 36px;
}

.brand-mark,
.store-avatar {
  width: 62px;
  height: 62px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "SimHei", sans-serif;
  font-size: 29px;
  font-weight: 900;
  color: #75483d;
  background: #f4e3d2;
}

.login-art .brand-mark {
  width: 76px;
  height: 76px;
  margin-bottom: 28px;
  font-size: 36px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.8px;
}

.login-art .eyebrow {
  color: #f1ab97;
}

.login-art h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
}

.login-art p:last-child {
  max-width: 340px;
  margin: 15px 0 0;
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  line-height: 1.65;
}

.login-card,
.settings-card,
.modal-card,
.step-panel {
  background: var(--surface);
  border: 1px solid rgba(221,229,230,0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card {
  padding: 24px;
}

.login-card label,
.form-stack > label,
.two-column label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #4b595c;
  font-size: 13px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #d8e1e2;
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus, select:focus, textarea:focus {
  border-color: #5b8a87;
  box-shadow: 0 0 0 3px rgba(54, 113, 108, 0.11);
}

textarea {
  resize: vertical;
}

.primary-button,
.secondary-button,
.icon-button,
.text-button,
.quick-action,
.start-reception,
.bottom-nav button {
  border: 0;
  cursor: pointer;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  border-radius: 8px;
  padding: 11px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--coral);
  box-shadow: 0 8px 18px rgba(203, 82, 68, 0.22);
}

.primary-button:active { background: var(--coral-dark); }

.secondary-button {
  color: var(--teal);
  background: var(--sage-soft);
  border: 1px solid #d5e7e1;
}

.full-width { width: 100%; }

.helper-text,
.error-text {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.helper-text { color: var(--muted); }
.error-text { color: #b34136; min-height: 18px; }

.app-shell {
  position: relative;
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(88px + var(--safe-bottom));
  overflow: hidden;
  background: var(--canvas);
}

.app-header {
  min-height: 142px;
  padding: calc(25px + var(--safe-top)) 22px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  color: #fff;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(135deg, #153c3f, #245a5e);
}

.store-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 22px;
}

.text-button {
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  background: transparent;
}

.store-name-button {
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.store-name-button svg {
  width: 16px;
  height: 16px;
  color: rgba(255,255,255,0.56);
}

.store-heading p {
  margin: 5px 0 0;
  color: rgba(255,255,255,0.62);
  font-size: 12px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff3f3;
  color: var(--ink);
}

.icon-button.light {
  position: relative;
  color: #fff;
  background: rgba(255,255,255,0.11);
  border: 1px solid rgba(255,255,255,0.15);
}

.icon-button.subtle {
  background: #f0f4f4;
  color: #47585a;
}

.icon-button.primary {
  background: var(--coral);
  color: #fff;
}

.notification-dot {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff9c84;
  border: 2px solid #2b5c60;
}

.page {
  padding: 18px 18px 34px;
  animation: page-in 180ms ease-out;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.start-reception {
  width: 100%;
  min-height: 130px;
  border-radius: 8px;
  padding: 22px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  text-align: left;
  background: linear-gradient(115deg, #173f43, #2a6063);
  box-shadow: 0 12px 24px rgba(23,63,67,0.18);
}

.start-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--coral);
}

.start-icon svg { width: 29px; height: 29px; }

.start-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.start-copy small {
  color: rgba(255,255,255,0.62);
  font-size: 11px;
}

.start-copy strong {
  font-size: 22px;
}

.flow-hint {
  color: rgba(255,255,255,0.72);
  font-size: 11px;
}

.start-reception > svg {
  color: rgba(255,255,255,0.5);
}

.quick-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.quick-action {
  min-height: 100px;
  padding: 13px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 8px;
  color: #39494b;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.quick-icon {
  width: 39px;
  height: 39px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-icon svg { width: 21px; height: 21px; }
.quick-icon.coral { color: #bc5549; background: var(--coral-soft); }
.quick-icon.teal { color: #34706d; background: var(--sage-soft); }
.quick-icon.gold { color: #8c6226; background: var(--gold-soft); }
.quick-icon.lavender { color: #635b84; background: var(--lavender-soft); }

.metric-band {
  margin-top: 16px;
  padding: 18px 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-radius: 8px;
  color: #fff;
  background: #1c3438;
}

.metric-band > div {
  min-width: 0;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border-right: 1px solid rgba(255,255,255,0.09);
}
.metric-band > div:last-child { border-right: 0; }
.metric-band strong {
  font-size: 25px;
  font-variant-numeric: tabular-nums;
}
.metric-band span {
  color: rgba(255,255,255,0.58);
  font-size: 10px;
}

.section-block,
.settings-card {
  margin-top: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-title.compact { margin-top: 18px; }
.section-title h2,
.section-title h3,
.settings-card h2 {
  margin: 0;
  font-size: 17px;
}

.style-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.style-strip::-webkit-scrollbar { display: none; }

.style-strip-card {
  width: 142px;
  flex: 0 0 142px;
  overflow: hidden;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
}
.style-strip-card img {
  width: 100%;
  height: 110px;
  object-fit: cover;
}
.style-strip-card div {
  padding: 9px 10px 10px;
}
.style-strip-card strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}
.style-strip-card span {
  display: block;
  margin-top: 5px;
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 800;
}

.compact-list,
.member-list,
.order-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.compact-row,
.member-card,
.order-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.compact-row {
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.compact-row strong,
.order-card strong { font-size: 14px; }
.compact-row span,
.order-card span { color: var(--muted); font-size: 11px; }

.empty-state {
  min-height: 120px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed #cedada;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,0.55);
  text-align: center;
  font-size: 13px;
}
.empty-state svg {
  width: 28px;
  height: 28px;
  color: #9aabab;
}

.page-heading {
  margin: 2px 0 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.page-heading h1 {
  margin: 0;
  font-size: 28px;
}
.page-heading p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.step-panel {
  margin-bottom: 14px;
  padding: 16px;
}

.step-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 14px;
}
.step-heading h2 {
  margin: 1px 0 0;
  font-size: 17px;
}
.step-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.step-number {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.capture-empty {
  min-height: 160px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed #bdcfce;
  border-radius: 8px;
  color: var(--muted);
  background: #f7faf9;
  text-align: center;
}
.capture-empty svg {
  width: 37px;
  height: 37px;
  color: #4d7c78;
}
.capture-empty strong {
  color: var(--ink);
  font-size: 15px;
}
.capture-empty span { font-size: 11px; }

.video-upload-field {
  margin-top: 11px;
  min-height: 43px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #506063;
  background: #fafcfc;
  font-size: 12px;
}
.video-upload-field svg {
  width: 18px;
  height: 18px;
  color: var(--teal-2);
}

.video-preview {
  margin-top: 10px;
}
.video-preview video {
  width: 100%;
  max-height: 240px;
  border-radius: 8px;
  background: #111;
}
.video-preview span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.canvas-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(45deg, #e9eeee 25%, transparent 25%),
    linear-gradient(-45deg, #e9eeee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e9eeee 75%),
    linear-gradient(-45deg, transparent 75%, #e9eeee 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

#tryOnCanvas {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  touch-action: none;
}

.canvas-hint {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 5px 9px;
  border-radius: 6px;
  color: #fff;
  background: rgba(16, 39, 41, 0.66);
  font-size: 10px;
  pointer-events: none;
}

.finger-tabs,
.chip-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 12px 0 3px;
  scrollbar-width: none;
}
.finger-tabs::-webkit-scrollbar,
.chip-row::-webkit-scrollbar { display: none; }

.finger-tabs button,
.chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 17px;
  border: 1px solid #dce4e4;
  color: #607173;
  background: #fff;
  font-size: 11px;
}

.finger-tabs button.active,
.chip.active {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.slider-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
}
.slider-row label {
  color: var(--muted);
  font-size: 11px;
}
.slider-row input[type="range"] {
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: var(--coral);
}

.mini-style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.mini-style-card {
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 2px solid transparent;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}
.mini-style-card.active { border-color: var(--coral); }
.mini-style-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.mini-style-card span {
  display: block;
  padding: 6px 4px;
  overflow: hidden;
  color: #475759;
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.check-row {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 9px !important;
  font-weight: 500 !important;
  line-height: 1.5;
}
.check-row input {
  width: 19px;
  height: 19px;
  margin-top: 1px;
  accent-color: var(--coral);
}
.check-row span { color: #556567; font-size: 11px; }

.selected-summary {
  padding: 12px;
  border-radius: 8px;
  color: var(--muted);
  background: #f5f8f8;
  font-size: 12px;
}
.selected-summary strong { color: var(--ink); }

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-row input { flex: 1; }

.style-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}
.style-card {
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}
.style-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.style-card-body {
  padding: 10px;
}
.style-card-body strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}
.style-card-meta {
  margin-top: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}
.style-price {
  color: var(--coral-dark);
  font-weight: 900;
}

.member-card,
.order-card {
  padding: 14px;
}
.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
}
.member-card .avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #75483d;
  background: #f5e7d9;
  font-weight: 900;
}
.member-card .member-main {
  min-width: 0;
  flex: 1;
}
.member-card strong { font-size: 14px; }
.member-card p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.member-stats {
  text-align: right;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.order-card {
  display: flex;
  gap: 12px;
  align-items: center;
}
.order-preview {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--sage-soft);
}
.order-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.order-main { flex: 1; min-width: 0; }
.order-main p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.order-price {
  color: var(--coral-dark);
  font-size: 15px;
  font-weight: 900;
}

.settings-card {
  padding: 17px;
}
.settings-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.danger { color: #b0443a; }

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  width: min(100%, 520px);
  transform: translateX(-50%);
  min-height: calc(74px + var(--safe-bottom));
  padding: 9px 11px calc(8px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,0.97);
  border-top: 1px solid rgba(217,226,227,0.94);
  box-shadow: 0 -10px 30px rgba(26, 48, 51, 0.08);
  backdrop-filter: blur(14px);
}
.bottom-nav button {
  min-width: 0;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #8b989a;
  background: transparent;
  font-size: 10px;
}
.bottom-nav button svg {
  width: 22px;
  height: 22px;
}
.bottom-nav button.active {
  color: var(--coral-dark);
  font-weight: 900;
}

.modal {
  width: min(94vw, 480px);
  max-height: 90vh;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.modal::backdrop {
  background: rgba(9, 24, 26, 0.54);
  backdrop-filter: blur(3px);
}
.modal-card {
  max-height: 90vh;
  padding: 18px;
  overflow-y: auto;
}
.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-heading h2 {
  margin: 0;
  font-size: 19px;
}

.image-picker {
  min-height: 150px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed #b9cbc9;
  border-radius: 8px;
  color: var(--muted);
  background: #f7faf9;
  text-align: center;
  font-size: 11px;
}
.image-picker img {
  width: 100%;
  max-height: 240px;
  border-radius: 8px;
  object-fit: cover;
}

.detail-image,
.detail-video {
  display: block;
  width: 100%;
  max-height: 62vh;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #162f32;
  object-fit: contain;
}
.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.detail-stack h3,
.detail-stack p {
  margin: 0;
}
.detail-stack p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(90px + var(--safe-bottom));
  max-width: min(88vw, 430px);
  padding: 11px 16px;
  border-radius: 8px;
  color: #fff;
  background: rgba(23, 63, 67, 0.94);
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 12px;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 380px) {
  .page { padding-left: 14px; padding-right: 14px; }
  .app-header { padding-left: 17px; padding-right: 17px; }
  .quick-grid { gap: 6px; }
  .quick-action { min-height: 92px; font-size: 11px; }
  .metric-band { padding-left: 2px; padding-right: 2px; }
  .metric-band > div { padding-left: 4px; padding-right: 4px; }
  .metric-band strong { font-size: 22px; }
  .two-column { grid-template-columns: 1fr; }
}

@media (min-width: 521px) {
  body {
    padding: 20px 0;
  }
  .app-shell {
    min-height: calc(100vh - 40px);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(23, 45, 47, 0.22);
  }
  .bottom-nav {
    bottom: 20px;
    border-radius: 0 0 14px 14px;
  }
}
