:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --orange: #ea580c;
  --red: #dc2626;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --sub: #64748b;
  --border: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: #e2e8f0; color: var(--text); }

.m-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
}

.m-header {
  height: 52px;
  padding: 0 12px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.m-header-title { font-size: 16px; font-weight: 800; }

.m-back-btn {
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.16);
  color: #fff;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.m-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 74px;
}

.m-tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 58px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 40;
}

.m-tab-btn {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--sub);
  cursor: pointer;
}

.m-tab-btn.active { color: var(--blue); font-weight: 800; }

.hero-blue {
  background: linear-gradient(180deg, #2563eb 0%, #3b82f6 65%, var(--bg) 65%);
  padding: 10px 12px 6px;
}

.store-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  margin-bottom: 10px;
}

.kpi-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
}

.kpi-tabs {
  display: inline-flex;
  background: #eff6ff;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.kpi-tabs button {
  border: none;
  background: transparent;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #3b82f6;
  border-radius: 6px;
  cursor: pointer;
}

.kpi-tabs button.active {
  background: #2563eb;
  color: #fff;
}

.pad { padding: 10px 12px; }

.card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; text-align: center; }

.tool-tile {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  position: relative;
}

.tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.dot-badge {
  position: absolute;
  top: -2px;
  right: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
}

.board-num { font-size: 18px; font-weight: 800; color: #0f172a; }
.board-lbl { font-size: 11px; color: var(--sub); margin-top: 2px; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn-blue { background: var(--blue); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: #f1f5f9; color: #334155; }

.inp {
  width: 100%;
  height: 38px;
  line-height: 36px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
  font-size: 13.5px;
  outline: none;
  vertical-align: middle;
}
.inp:focus { border-color: var(--blue); }

.chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.m-modal {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.m-modal.hidden { display: none; }
.m-dialog {
  width: 100%;
  max-width: 370px;
  max-height: 85%;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
}

.m-toast {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  z-index: 120;
  max-width: 84%;
  text-align: center;
}
.m-toast.hidden { display: none; }

/* 弹窗内输入框不超宽 */
.modal .inp { width: 100%; box-sizing: border-box; }
.modal input.inp, .modal select.inp { width: 100%; }

/* 弹窗尺寸：别超出屏幕 */
.m-dialog .modal, .m-dialog .card, .m-dialog > div {
  box-sizing: border-box;
  max-width: 92vw;
}
.m-dialog .modal .inp,
.m-dialog .modal input,
.m-dialog .modal select,
.m-dialog .modal textarea {
  width: 100%;
  box-sizing: border-box;
}

/* 手动上架弹窗留白 */
.m-dialog .modal { padding: 18px; }
