:root {
  --bg: #f3f5f8;
  --surface: #fff;
  --text: #1a2332;
  --text-2: #5c6b80;
  --line: #e6eaf0;
  --primary: #1e4db7;
  --primary-press: #173d92;
  --scan: #f5a623;
  --nfc: #2bb3a3;
  --in: #1b9e5f;
  --out: #e85d04;
  --count: #3b6fe0;
  --put: #1aa6a0;
  --danger: #d7263d;
  --ok-bg: #e8f8ef;
  --err-bg: #fdecee;
  --warn-bg: #fff6e5;
  --shadow: 0 8px 24px rgba(26, 35, 50, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: #d8dee8;
  color: var(--text);
}

/* 桌面演示：手机框 */
.stage {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px;
}
.phone {
  width: 390px;
  height: 780px;
  background: #111;
  border-radius: 40px;
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  position: relative;
}
.phone::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 8px;
  background: #2a2a2a;
  border-radius: 8px;
  z-index: 5;
}
.phone-inner {
  height: 100%;
  background: var(--bg);
  border-radius: 30px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.status-bar {
  height: 36px;
  padding: 10px 20px 0;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text);
  flex-shrink: 0;
}
.nav {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}
.nav .title { font-size: 18px; font-weight: 650; }
.nav a, .nav .link {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  min-width: 48px;
}
.nav .back { color: var(--text); font-size: 20px; }
.page {
  flex: 1;
  overflow: auto;
  padding: 12px 16px 20px;
}
.page.no-pad { padding: 0 0 16px; }

.hint {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.banner {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.banner.ok { background: var(--ok-bg); color: var(--in); }
.banner.err { background: var(--err-bg); color: var(--danger); }
.banner.warn { background: var(--warn-bg); color: #b36b00; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 16px;
  background: #fff;
  outline: none;
}
.input:focus { border-color: var(--primary); }
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 650;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
}
.btn.primary { background: var(--primary); }
.btn.scan { background: var(--scan); color: #3a2500; }
.btn.nfc { background: var(--nfc); }
.btn.in { background: var(--in); }
.btn.out { background: var(--out); }
.btn.put { background: var(--put); }
.btn.count { background: var(--count); }
.btn.ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { flex: 1; }
.dock {
  padding: 10px 16px 16px;
  background: var(--bg);
  flex-shrink: 0;
}

/* 登录 */
.login-hero {
  text-align: center;
  padding: 36px 0 28px;
}
.logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: linear-gradient(145deg, #1e4db7, #3b6fe0);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.login-hero h1 { font-size: 22px; }
.login-hero p { color: var(--text-2); font-size: 13px; margin-top: 6px; }
.device-meta { text-align: center; color: var(--text-2); font-size: 12px; margin-top: 16px; }

/* 工作台 */
.user-bar { padding: 8px 16px 4px; }
.user-bar .name { font-size: 18px; font-weight: 700; }
.user-bar .wh { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 16px;
}
.tile {
  height: 118px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.tile::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
}
.tile.in::before { background: var(--in); }
.tile.put::before { background: var(--put); }
.tile.out::before { background: var(--out); }
.tile.count::before { background: var(--count); }
.tile .ico { font-size: 26px; margin-bottom: 8px; }
.tile h3 { font-size: 18px; }
.tile p { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.stats {
  display: flex;
  justify-content: space-around;
  margin: 8px 16px 0;
  background: #fff;
  border-radius: 14px;
  padding: 14px 8px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
}
.stats div { text-align: center; }
.stats b { display: block; font-size: 20px; }
.stats span { font-size: 12px; color: var(--text-2); }

/* 采集 */
.scan-visual {
  margin: 20px 8px 16px;
  height: 280px;
  border-radius: 20px;
  background: #0e1624;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.scan-visual.nfc-mode { background: #0d2422; }
.scan-frame {
  width: 200px;
  height: 140px;
  border: 2px solid var(--scan);
  border-radius: 12px;
  position: relative;
}
.scan-visual.nfc-mode .scan-frame {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border-color: var(--nfc);
}
.scan-line {
  position: absolute;
  left: 8px; right: 8px;
  height: 2px;
  background: var(--scan);
  top: 20%;
  animation: sweep 1.8s linear infinite;
}
@keyframes sweep {
  0% { top: 12%; opacity: .3; }
  50% { opacity: 1; }
  100% { top: 82%; opacity: .3; }
}
.scan-visual p { margin-top: 18px; font-size: 14px; color: #c9d3e0; text-align: center; padding: 0 24px; }
.recent {
  font-size: 13px;
  color: var(--text-2);
  padding: 4px 4px 12px;
}

/* 商品 */
.goods {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: linear-gradient(160deg, #dbe7ff, #eef3fb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.goods h2 { font-size: 20px; line-height: 1.3; }
.meta { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }
.stock-num {
  text-align: center;
  padding: 18px 0 8px;
}
.stock-num .lab { font-size: 13px; color: var(--text-2); }
.stock-num .num { font-size: 52px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.kv span { color: var(--text-2); }
.ops-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; padding: 12px 16px 16px; }
.ops-4 a {
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.ops-4 a.in { background: var(--in); }
.ops-4 a.put { background: var(--put); }
.ops-4 a.out { background: var(--out); }
.ops-4 a.count { background: var(--count); }
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #e8f8ef;
  color: var(--in);
}

/* 步进器 */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.stepper button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: #edf1f6;
  font-size: 24px;
  cursor: pointer;
}
.stepper input {
  width: 80px;
  height: 48px;
  border: 0;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  background: transparent;
}

/* 结果 */
.result {
  text-align: center;
  padding: 48px 12px 20px;
}
.badge {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #fff;
}
.badge.ok { background: var(--in); }
.badge.err { background: var(--danger); }
.result h2 { font-size: 24px; margin-bottom: 8px; }
.result .sub { color: var(--text-2); font-size: 14px; line-height: 1.7; }

/* 列表 */
.list-item {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.in { background: var(--in); }
.dot.out { background: var(--out); }
.dot.put { background: var(--put); }
.dot.count { background: var(--count); }
.list-item .main { flex: 1; }
.list-item .main b { display: block; font-size: 15px; }
.list-item .main span { font-size: 12px; color: var(--text-2); }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs a {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  background: #fff;
  color: var(--text-2);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.tabs a.on { background: var(--primary); color: #fff; }

.set-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.set-group { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px; }

/* 演示侧栏 */
.guide {
  width: 280px;
  color: #2c3544;
}
.guide h1 { font-size: 20px; margin-bottom: 8px; }
.guide p { font-size: 13px; color: #5c6b80; line-height: 1.6; margin-bottom: 16px; }
.guide a {
  display: block;
  color: #1e4db7;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 0;
}
.guide .note { font-size: 12px; color: #7a8698; margin-top: 16px; }

@media (max-width: 860px) {
  .guide { display: none; }
  .stage { padding: 0; align-items: stretch; }
  .phone {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .phone::before { display: none; }
  .phone-inner { border-radius: 0; }
}
