/* ShopAny 售卖机小程序原型 — 共享样式 */
:root {
  --brand: #fc1b35;
  --brand-dark: #d91429;
  --success: #67c23a;
  --warn: #ff9800;
  --info: #4e88f7;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1d2129;
  --text-2: #4e5969;
  --text-3: #86909c;
  --line: #e5e6eb;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", sans-serif;
  background: #26282f;
  display: grid;
  place-items: center;
  gap: 14px;
  grid-auto-flow: row;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ===== 手机框 ===== */
.phone {
  position: relative;
  width: 390px;
  height: 844px;
  background: var(--bg);
  border-radius: 44px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}
@media (max-width: 699px) {
  .phone { width: 100vw; height: 100vh; border-radius: 0; }
}

/* ===== 小程序导航栏 ===== */
.nav {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 92px;
  padding: 50px 14px 0;
  background: var(--card);
}
.nav-back {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-size: 22px; color: var(--text);
  text-decoration: none;
}
.nav-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.nav-capsule {
  flex: none;
  width: 88px; height: 32px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  display: flex; align-items: center;
}
.nav-capsule span { flex: 1; text-align: center; font-size: 15px; color: #1a1a1a; line-height: 30px; }
.nav-capsule i { width: 1px; height: 18px; background: rgba(0, 0, 0, 0.12); }

/* ===== 内容区 ===== */
.body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; }

/* ===== 按钮 ===== */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 48px;
  border: none; border-radius: 24px;
  font-size: 16px; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:active { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--text-2); border: 1px solid var(--line); }
.btn-disabled { background: #f2f3f5; color: var(--text-3); cursor: not-allowed; }
.btn-fixed {
  flex: none;
  margin: 0;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
}

/* ===== 通用小件 ===== */
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; flex: none; }
.tag-green { color: var(--success); background: #f0f9eb; }
.tag-gray { color: var(--text-3); background: #f2f3f5; }
.tag-orange { color: var(--warn); background: #fff7e8; }
.tag-red { color: var(--brand); background: #ffecee; }
.sub { font-size: 12px; color: var(--text-3); line-height: 1.7; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }

/* 商品占位图 */
.thumb {
  flex: none;
  width: 56px; height: 56px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f2f3f7 0%, #e8eaf1 100%);
  display: grid; place-items: center;
  font-size: 10px; color: #c0c4cc;
}

/* ===== 原型状态切换器（演示工具，非产品 UI） ===== */
.demo-bar {
  display: none;
  gap: 8px;
  padding: 10px 16px;
}
@media (min-width: 700px) { .demo-bar { display: flex; flex-wrap: wrap; justify-content: center; } }
.demo-bar button {
  padding: 8px 16px;
  border: 1px solid #4a4d57;
  border-radius: 18px;
  background: transparent;
  color: #b9bdc7;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.demo-bar button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.demo-label { font-size: 12px; color: #7a7e89; align-self: center; }

/* 状态开关：默认只显示 data-state 匹配的块 */
[data-panel] { display: none; }
[data-panel].show { display: block; }

/* ===== 状态图形 ===== */
.big-icon {
  width: 96px; height: 96px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 44px;
  margin: 26px auto 18px;
}
.big-icon.ok { background: #f0f9eb; color: var(--success); }
.big-icon.warn { background: #fff7e8; color: var(--warn); }
.big-icon.err { background: #ffecee; color: var(--brand); }
.big-icon.info { background: #ecf3fe; color: var(--info); }

@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: 0.75; } }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* 步骤条 */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 12px; position: relative; padding-bottom: 22px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; left: 11px; top: 24px; bottom: 2px;
  width: 2px; background: var(--line);
}
.step:last-child::before { display: none; }
.step-dot {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px;
  background: #f2f3f5; color: var(--text-3);
}
.step.done .step-dot { background: var(--success); color: #fff; }
.step.doing .step-dot { background: var(--brand); color: #fff; }
.step .step-txt { font-size: 14px; color: var(--text-3); padding-top: 2px; }
.step.done .step-txt, .step.doing .step-txt { color: var(--text); font-weight: 500; }

/* 提示横幅 */
.banner {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px; line-height: 1.7;
}
.banner-warn { background: #fff7e8; color: #b26a00; }
.banner-err { background: #ffecee; color: var(--brand); }
.banner-info { background: #ecf3fe; color: #2b6cd9; }

/* 返回总览小字链 */
.home-link { display: none; font-size: 12px; color: #7a7e89; text-decoration: none; }
@media (min-width: 700px) { .home-link { display: inline; } }
