* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #222;
  background: #fff;
  overflow-x: hidden;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #c62828; color: #fff; padding: 10px 14px;
  position: sticky; top: 0; z-index: 10;
}
.topbar .brand { font-size: 18px; font-weight: 700; }
.topbar .who { font-size: 14px; opacity: .95; }
.tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 10px; border-bottom: 1px solid #eee; background: #fff;
  position: sticky; top: 44px; z-index: 9;
}
.tabs a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 12px; font-size: 16px;
  color: #c62828; text-decoration: none;
  border: 1px solid #f0c0c0; border-radius: 8px; background: #fff7f7;
}
.tabs a.quit { color: #666; border-color: #ddd; background: #fafafa; margin-left: auto; }
main { padding: 12px 12px 40px; max-width: 100%; }
h1 { font-size: 20px; margin: 8px 0 12px; }
h2 { font-size: 17px; margin: 16px 0 8px; }
.flash {
  background: #fff8e1; border: 1px solid #ffe082; color: #8d6e00;
  border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 15px;
}
.empty { color: #888; padding: 16px 0; }
.legend { font-size: 14px; color: #666; margin: 0 0 10px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 10px; }
.dot.red { background: #e53935; }
.dot.yellow { background: #f9a825; }
.storelist { list-style: none; margin: 0; padding: 0; }
.storeitem {
  border: 1px solid #eee; border-left: 6px solid #ddd; border-radius: 10px;
  padding: 12px; margin-bottom: 10px; background: #fff; overflow-wrap: anywhere;
}
.storeitem.row-red { border-left-color: #e53935; background: #fff5f5; }
.storeitem.row-yellow { border-left-color: #f9a825; background: #fffbe6; }
.sname { font-size: 17px; font-weight: 700; color: #1565c0; text-decoration: none; }
.meta { font-size: 14px; color: #555; margin-top: 4px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 13px; color: #fff; }
.b-red { background: #e53935; }
.b-yellow { background: #f9a825; }
.b-green { background: #2e7d32; }
.b-blue { background: #1565c0; }
.b-gray { background: #9e9e9e; }
.warn { display: inline-block; margin-left: 6px; color: #b26a00; font-size: 13px; font-weight: 700; }
.card { border: 1px solid #eee; border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.cardform label, .loginbox label { display: block; margin-bottom: 12px; font-size: 15px; color: #444; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px;
  min-height: 44px; font-size: 16px; padding: 8px 10px;
  border: 1px solid #ccc; border-radius: 8px; background: #fff; color: #222;
}
textarea { min-height: 88px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; font-size: 16px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn.primary { background: #c62828; color: #fff; }
.btn.danger { background: #fff; color: #c62828; border-color: #c62828; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qtyrow { margin-bottom: 4px; font-size: 15px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { border: 1px solid #eee; border-radius: 10px; padding: 14px; text-align: center; background: #fffdfd; }
.stat .num { font-size: 26px; font-weight: 700; color: #c62828; }
.stat .lab { font-size: 14px; color: #666; margin-top: 4px; }
.rectable { width: 100%; border-collapse: collapse; font-size: 15px; }
.rectable th, .rectable td { border-bottom: 1px solid #eee; padding: 10px 6px; text-align: left; }
.rectable th { background: #fafafa; color: #555; font-weight: 600; }
.quickbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.quickbar .btn { border-color: #f0c0c0; background: #fff7f7; color: #c62828; }
.quickbar .btn.primary { background: #c62828; color: #fff; border-color: #c62828; }
.loginbox { max-width: 380px; margin: 24px auto 0; }
.loginbox h1 { text-align: center; }
@media (max-width: 360px) { .grid { grid-template-columns: 1fr; } }
