:root {
  --primary: #1890ff;
  --primary-dark: #096dd9;
  --primary-soft: #e6f4ff;
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #8c8c8c;
  --line: #edf0f5;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --orange: #d97706;
  --orange-soft: #fff7ed;
  --red: #dc2626;
  --red-soft: #fef2f2;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: #e9edf3;
  color: var(--ink);
  display: flex;
  justify-content: center;
  min-height: 100vh;
}
.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .12);
  overflow-x: hidden;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 54px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}
.topbar-title { font-size: 16px; font-weight: 650; color: var(--ink); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.wx-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: rgba(255,255,255,.9);
  font-size: 12px;
  color: #374151;
  text-decoration: none;
}
.screen { display: none; flex: 1; padding: 12px 12px 84px; }
.screen.active { display: block; }
.seg {
  display: flex;
  background: #eaeef4;
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 12px;
}
.seg button {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4b5563;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.seg button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
}
.search-bar input {
  border: 0;
  outline: none;
  flex: 1;
  font-size: 13px;
  background: transparent;
  color: var(--ink);
}
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 10px;
}
.chips::-webkit-scrollbar { height: 0; }
.chip {
  flex-shrink: 0;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #fff;
  color: #4b5563;
  font-size: 12px;
  cursor: pointer;
}
.chip.active {
  background: var(--primary-soft);
  border-color: #91caff;
  color: var(--primary);
  font-weight: 500;
}
.card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .04);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .03);
}
.card-click { cursor: pointer; }
.card-click:active { background: #f8fbff; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.muted { color: var(--muted); font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: #f1f5f9;
  color: #64748b;
}
.tag.blue { background: var(--primary-soft); color: var(--primary); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.orange { background: var(--orange-soft); color: var(--orange); }
.tag.red { background: var(--red-soft); color: var(--red); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { color: var(--red); border-color: #fecaca; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; }
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 60px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 30;
}
.bottom-nav button {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  color: #6b7280;
  cursor: pointer;
}
.bottom-nav button.active { color: var(--primary); font-weight: 600; }
.view {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: var(--bg);
  z-index: 40;
  display: none;
  flex-direction: column;
}
.view.active { display: flex; }
.view-body { flex: 1; overflow-y: auto; padding: 12px 12px 84px; }
.view-foot {
  padding: 10px 14px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
}
.view-foot .btn { flex: 1; height: 40px; }
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.sheet-mask.open { display: flex; }
.sheet {
  width: 100%;
  max-width: 430px;
  max-height: 82vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sheet-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 650;
  font-size: 15px;
}
.sheet-body { padding: 14px 16px; overflow-y: auto; flex: 1; }
.sheet-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; height: 40px; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid #d9d9d9; background: #fff; cursor: pointer; font-weight: 600;
}
.fab-help {
  position: fixed;
  right: max(14px, calc(50% - 200px));
  bottom: 74px;
  z-index: 35;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(24,144,255,.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.m-toast {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.m-toast.show { opacity: 1; }
.field-label { display: block; font-size: 12px; color: #6b7280; margin: 10px 0 5px; }
.field-ctrl {
  width: 100%; padding: 9px 11px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 13px; background: #fff; outline: none;
}
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
