/* AMR 调度台 · 会员端
   深钢蓝机台 + 安全琥珀；等宽字体只用于数字、单号与金额 */
:root {
  --steel-900: #111A23;
  --steel-850: #16202B;
  --steel-800: #1B2733;
  --steel-700: #21303E;
  --steel-600: #2B3D4E;
  --steel-500: #3B5265;
  --ink-100: #E9EFF5;
  --ink-300: #A6B7C6;
  --ink-500: #7187A0;
  --amber: #F2B13B;
  --amber-ink: #241803;
  --signal: #3FC2AE;
  --alert: #E66152;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  --hazard: repeating-linear-gradient(45deg, var(--amber) 0 7px, #1A2430 7px 14px);
  --plate: inset 0 1px 0 rgba(233, 239, 245, .06);
  --ink: var(--ink-100);
  --muted: var(--ink-300);
  --line: var(--steel-600);
  --accent: var(--amber);
  --card: var(--steel-700);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-100);
  background: var(--steel-900);
  -webkit-text-size-adjust: 100%;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--ink-300); font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* ===== 外壳 ===== */
.app {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  background: var(--steel-850);
}
.topbar {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(17, 26, 35, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--steel-700);
}
.topbar::after {
  content: "";
  position: absolute; inset: auto 0 -3px;
  height: 3px;
  background: var(--hazard);
}
.mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center; overflow: hidden;
  border-radius: 3px;
  background: var(--amber); color: var(--amber-ink);
  font-weight: 700;
}
.mark img { width: 100%; height: 100%; object-fit: cover; }
.topbar h1 { margin: 0; font-size: 16px; font-weight: 600; }
.topbar p { margin: 0; color: var(--ink-300); font-size: 12px; }
.view { padding: 14px 14px 20px; }

/* ===== 面板 ===== */
.card {
  margin-bottom: 10px;
  padding: 14px;
  background: var(--steel-700);
  border: 1px solid var(--steel-600);
  border-radius: 3px;
  box-shadow: var(--plate);
}
.card h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.card > p { margin: 6px 0; }
.card > p:first-child { margin-top: 0; }
.card > p:last-child { margin-bottom: 0; }
/* 推荐码单独放大，是团队页要读出来给别人的信息 */
.card > p + h2 {
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: .06em;
  color: var(--amber);
}
a.card { display: block; }
a.card:active { background: var(--steel-600); }
/* 单号与金额用等宽对齐；中文字形不在等宽字体内，会自动回落到正文字体 */
.between strong { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  padding: 18px;
  background: var(--steel-900);
  border: 1px solid var(--steel-600);
  border-radius: 3px;
}
.hero::before {
  content: "";
  position: absolute; inset: 0 0 auto;
  height: 3px;
  background: var(--hazard);
}
.hero strong { display: block; font-size: 19px; font-weight: 600; }
.hero h2 {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--amber);
}
.hero p { margin: 6px 0 0; color: var(--ink-300); font-size: 13px; }
.hero p + h2 { margin-top: 0; }

/* ===== 产品 ===== */
.product { display: flex; gap: 12px; }
.product img, .ph {
  width: 80px; height: 80px; flex: none;
  object-fit: cover;
  border: 1px solid var(--steel-500);
  border-radius: 3px;
  background: var(--steel-800);
}
.cover {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border: 1px solid var(--steel-600);
  border-radius: 3px;
  background: var(--steel-800);
}
.price {
  font-family: var(--mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
}
/* ===== 表单 ===== */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.field > span { color: var(--ink-300); font-size: 12px; }
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  background: var(--steel-850);
  border: 1px solid var(--steel-500);
  border-radius: 3px;
  color: var(--ink-100);
}
input::placeholder, textarea::placeholder { color: var(--ink-500); }
input:focus, textarea:focus, select:focus {
  border-color: var(--amber);
  outline: none;
  box-shadow: 0 0 0 2px rgba(242, 177, 59, .18);
}
input[type="number"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
input[type="file"] { padding: 8px; border-style: dashed; color: var(--ink-300); font-size: 13px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--amber); }
textarea { min-height: 88px; resize: vertical; }
select { appearance: none; padding-right: 28px; }

/* ===== 按钮 ===== */
.btn {
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 10px 16px;
  background: var(--amber);
  color: var(--amber-ink);
  font-weight: 600;
}
.btn:active { background: #DF9F28; }
.btn.ghost { background: transparent; border-color: var(--steel-500); color: var(--ink-100); font-weight: 500; }
.btn.ghost:active { background: var(--steel-600); }
.btn.bad { background: var(--alert); color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; }
.qty { display: flex; gap: 8px; align-items: center; }
.qty button {
  width: 32px; height: 32px; flex: none;
  padding: 0;
  background: var(--steel-800);
  border: 1px solid var(--steel-500);
  border-radius: 3px;
  color: var(--ink-100);
  font-size: 16px;
  line-height: 1;
}
.qty button:active { background: var(--steel-600); }
.qty input { width: 52px; text-align: center; }

/* ===== 列表与状态 ===== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--steel-500);
  border-radius: 2px;
  background: var(--steel-800);
  color: var(--ink-300);
  font-size: 12px;
}
.empty { padding: 32px 8px; color: var(--ink-500); text-align: center; }
.menu a, .menu button {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  width: 100%;
  padding: 14px 2px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--steel-600);
  color: inherit;
  text-align: left;
}
.menu a .ico, .menu button .ico {
  width: 18px; height: 18px;
  margin-right: 10px;
  color: var(--amber);
  vertical-align: -.2em;
}
.menu a > span:first-child, .menu button > span:first-child { display: flex; align-items: center; }
.menu a:last-child, .menu button:last-child { border-bottom: 0; }
.menu a:active, .menu button:active { background: rgba(233, 239, 245, .04); }
.poster-box {
  overflow: hidden;
  border: 1px solid var(--steel-600);
  border-radius: 3px;
  background: var(--steel-800);
}
.poster-box canvas { display: block; width: 100%; height: auto; }

/* ===== 底部导航 ===== */
.tabbar {
  position: fixed; left: 50%; bottom: 0;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  width: min(480px, 100%);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--steel-900);
  border-top: 1px solid var(--steel-700);
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0 7px;
  border-top: 2px solid transparent;
  color: var(--ink-500);
  font-size: 11px;
  text-align: center;
}
.tabbar a .ico { width: 22px; height: 22px; }
.tabbar a.on { border-top-color: var(--amber); color: var(--amber); font-weight: 600; }

/* 图标：描边跟随文字色，尺寸跟随字号 */
.ico {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -.18em;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== 浮层 ===== */
.toast {
  position: fixed; left: 50%; bottom: 88px;
  transform: translateX(-50%);
  z-index: 9;
  max-width: 88%;
  padding: 9px 15px;
  background: var(--steel-900);
  border: 1px solid var(--amber);
  border-radius: 3px;
  color: var(--ink-100);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
}
.toast.show { opacity: 1; }

/* ===== 首页轮播 ===== */
/* 首页不显示顶栏，Banner 贴到屏幕左右边缘 */
.is-home .topbar { display: none; }
.is-home .view { padding-top: 0; }
.banner {
  position: relative;
  margin: 0 -14px 14px;
  overflow: hidden;
  background: var(--steel-900);
}
.is-home .view > .banner:first-child { margin-top: 0; padding-top: env(safe-area-inset-top); }
/* 后台没加轮播图时，首页第一块内容离顶部留出间距 */
.is-home .view > :first-child:not(.banner) { margin-top: calc(14px + env(safe-area-inset-top)); }
.banner-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-slide {
  position: relative;
  flex: 0 0 100%;
  aspect-ratio: 15 / 8; /* 1500×800，手机竖屏上高度约占屏幕四分之一 */
  scroll-snap-align: start;
  color: inherit;
}
.banner-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.banner-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 34px 16px 26px;
  background: linear-gradient(transparent, rgba(11, 17, 23, .85));
  font-size: 15px; font-weight: 600;
}
.banner-dots {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 5px;
}
.banner-dot {
  width: 8px; height: 4px; padding: 0;
  background: rgba(233, 239, 245, .45);
  border: 0; border-radius: 1px;
  transition: width .2s, background .2s;
}
.banner-dot.on { width: 18px; background: var(--amber); }

/* ===== 邀请提示条 ===== */
.invite-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; padding: 11px 12px;
  background: rgba(242, 177, 59, .08);
  border: 1px solid rgba(242, 177, 59, .35);
  border-radius: 3px;
  font-size: 13px;
}
.invite-bar > span:nth-child(2) { flex: 1; }
.invite-bar .ico { width: 18px; height: 18px; color: var(--amber); }
.invite-bar b { font-family: var(--mono); color: var(--amber); }

/* ===== 产品列表 ===== */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 10px; }
.sec-head h2 {
  margin: 0; padding-left: 9px;
  border-left: 3px solid var(--amber);
  font-size: 16px; font-weight: 600; line-height: 1.2;
}
.goods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goods {
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--steel-700);
  border: 1px solid var(--steel-600);
  border-radius: 3px;
  box-shadow: var(--plate);
}
.goods:active { border-color: var(--amber); }
.goods-pic {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 1 / 1;
  background: var(--steel-800);
  color: var(--steel-500);
}
.goods-pic img { width: 100%; height: 100%; object-fit: cover; }
.goods-pic > .ico { width: 40px; height: 40px; }
.goods-flag {
  position: absolute; left: 0; top: 8px;
  padding: 2px 8px;
  background: var(--alert); color: #fff;
  font-size: 11px;
}
.goods-body { display: flex; flex-direction: column; gap: 3px; flex: 1; padding: 10px 10px 12px; }
.goods-body strong {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px; font-weight: 600; line-height: 1.4;
}
.goods-sub {
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  color: var(--ink-500); font-size: 12px;
}
.goods-price {
  margin-top: auto; padding-top: 4px;
  font-family: var(--mono); font-size: 17px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
}
.goods-price small { margin-right: 1px; font-size: 12px; }
.empty > .ico { width: 36px; height: 36px; color: var(--steel-500); }

/* ===== 登录 / 注册 ===== */
.auth {
  position: relative;
  overflow: hidden;
  margin: 18px 2px 8px;
  padding: 26px 20px 20px;
  background:
    linear-gradient(rgba(242, 177, 59, .05), transparent 140px),
    var(--steel-800);
  border: 1px solid var(--steel-600);
  border-radius: 4px;
  box-shadow: var(--plate);
}
.auth::before {
  content: "";
  position: absolute; inset: 0 0 auto;
  height: 3px;
  background: var(--hazard);
}
.auth-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-head .mark { width: 44px; height: 44px; font-size: 20px; }
.auth-head h2 { margin: 0; font-size: 21px; font-weight: 600; }
.auth-head p { margin: 2px 0 0; color: var(--ink-300); font-size: 13px; }
.auth-field { display: block; margin-bottom: 14px; }
.auth-label { display: block; margin-bottom: 6px; color: var(--ink-300); font-size: 12px; }
.auth-box {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  background: var(--steel-900);
  border: 1px solid var(--steel-500);
  border-radius: 3px;
  transition: border-color .15s, box-shadow .15s;
}
.auth-box:focus-within { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242, 177, 59, .16); }
.auth-box > .ico { width: 18px; height: 18px; color: var(--ink-500); }
.auth-box:focus-within > .ico { color: var(--amber); }
.auth-box input {
  flex: 1; min-width: 0;
  height: 46px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 16px; /* 16px 以上 iOS 聚焦时不会自动放大页面 */
}
.auth-box input:focus { box-shadow: none; }
.auth-box input[type="tel"] { font-family: var(--mono); letter-spacing: .04em; }
.auth-eye {
  display: grid; place-items: center;
  width: 32px; height: 32px; margin-right: -6px;
  padding: 0; background: none; border: 0;
  color: var(--ink-500);
}
.auth-eye .ico { width: 18px; height: 18px; }
.auth-eye.on { color: var(--amber); }
.auth-submit { height: 48px; margin-top: 8px; font-size: 16px; letter-spacing: .1em; }
.auth-note { margin: 12px 0 0; color: var(--ink-500); font-size: 12px; text-align: center; }
.auth-foot {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px dashed var(--steel-600);
  color: var(--ink-300); font-size: 14px; text-align: center;
}
.auth-foot a { color: var(--amber); font-weight: 600; }
.auth-ref {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 14px; padding: 11px 12px;
  background: rgba(242, 177, 59, .08);
  border: 1px solid rgba(242, 177, 59, .35);
  border-radius: 3px;
  font-size: 13px; line-height: 1.5;
}
.auth-ref .ico { width: 18px; height: 18px; margin-top: 1px; color: var(--amber); }
.auth-ref b { font-family: var(--mono); color: var(--amber); letter-spacing: .06em; }

/* ===== 推广海报 ===== */
.poster-stage {
  display: grid; place-items: center;
  padding: 14px;
  background: var(--steel-900);
  border: 1px solid var(--steel-600);
  border-radius: 3px;
}
/* 按 9:16 固定比例，同时限制高度，整张海报一屏看完不用滚动 */
.poster-stage img, .poster-stage canvas {
  display: block;
  width: auto;
  height: min(62vh, 560px);
  max-width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.poster-tip { display: flex; align-items: center; gap: 6px; justify-content: center; margin: 10px 0 0; }
.poster-tip .ico { color: var(--amber); }
.poster-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.poster-actions .btn { display: flex; align-items: center; justify-content: center; gap: 6px; }

@media (max-width: 520px) {
  .app { max-width: none; }
  .tabbar { width: 100%; }
}
