:root {
  --brand: #2f6fed;
  --brand-dark: #1f53c0;
  --accent: #18b56a;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1b2333;
  --muted: #8a93a6;
  --line: #e7ebf3;
  --danger: #e5484d;
  --warn: #f0a020;
  --nav-h: 58px;
  --maxw: 460px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: #e9edf5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.app {
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 24px rgba(0,0,0,.06);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  padding: 16px 18px 14px;
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.topbar .sub { margin-top: 3px; font-size: 12px; opacity: .85; }

.page { padding: 16px 14px calc(var(--nav-h) + 24px); }

.section-title {
  font-size: 13px;
  color: var(--muted);
  margin: 18px 4px 8px;
  font-weight: 600;
}
.section-title:first-child { margin-top: 4px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(30,50,90,.04);
}

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: .15s;
  user-select: none;
}
.pill.active { border-color: var(--brand); background: #eef3ff; color: var(--brand); font-weight: 600; }
.pill.disabled { color: var(--muted); border-style: dashed; cursor: not-allowed; opacity: .7; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  color: var(--text);
  background: #fbfcfe;
  outline: none;
  transition: .15s;
  font-family: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); background: #fff; }
.field .err { color: var(--danger); font-size: 12px; margin-top: 5px; display: none; }
.field.invalid input { border-color: var(--danger); }
.field.invalid .err { display: block; }

.btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:active { background: var(--brand-dark); }
.btn-ghost { background: #eef1f7; color: var(--text); }
.btn-success { background: var(--accent); color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid #f3c2c4; }
.btn-sm { width: auto; padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.order {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
}
.order .row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order .oid { font-weight: 700; font-size: 14px; letter-spacing: .3px; }
.order .price { color: var(--accent); font-weight: 700; font-size: 14px; }
.order .meta { margin-top: 8px; font-size: 13px; color: #3a4256; display: grid; grid-template-columns: 64px 1fr; gap: 2px 8px; }
.order .meta b { color: var(--muted); font-weight: 500; }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.badge.todo { background: #fff2e3; color: var(--warn); }
.badge.done { background: #e6f7ee; color: var(--accent); }
.order .actions { display: flex; gap: 8px; margin-top: 10px; }

.empty { text-align: center; color: var(--muted); padding: 36px 10px; font-size: 14px; }
.empty .big { font-size: 30px; margin-bottom: 8px; }

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: var(--maxw);
  height: var(--nav-h);
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 30;
}
.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}
.bottom-nav .nav-item .ico { font-size: 19px; line-height: 1; }
.bottom-nav .nav-item.active { color: var(--brand); font-weight: 700; }

.plan-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.plan-card .time { font-size: 20px; font-weight: 800; color: var(--brand); }
.plan-card .b { color: var(--muted); font-size: 13px; margin-top: 4px; }
.plan-card .note { margin-top: 6px; font-size: 13px; color: #3a4256; }

.hidden { display: none !important; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 28px);
  transform: translateX(-50%) translateY(20px);
  background: rgba(27,35,51,.94);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 60;
  opacity: 0;
  transition: .25s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* admin */
.login-box { max-width: 320px; margin: 80px auto 0; }
.login-box .card { padding: 22px; }
.login-box h2 { margin: 0 0 4px; font-size: 17px; }
.login-box .tip { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.admin-top {
  position: sticky; top: 0; z-index: 20;
  background: #1b2333; color: #fff; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.admin-top .t { font-weight: 700; font-size: 16px; }
.admin-top .logout { font-size: 12px; color: #b9c2d6; cursor: pointer; }
.biz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.biz {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 14px; text-align: center; cursor: pointer; transition: .15s;
}
.biz:active { border-color: var(--brand); }
.biz .ico { font-size: 26px; }
.biz .name { margin-top: 8px; font-weight: 600; font-size: 14px; }
.biz.disabled { opacity: .55; cursor: not-allowed; border-style: dashed; }
.back { color: var(--brand); font-size: 13px; cursor: pointer; margin: 4px 4px 12px; display: inline-block; }
.seg { display: flex; background: #eef1f7; border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.seg div { flex: 1; text-align: center; padding: 8px; border-radius: 8px; font-size: 14px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg div.active { background: #fff; color: var(--brand); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; margin-bottom: 9px; background: #fff;
}
.admin-row .info { font-size: 13px; min-width: 0; }
.admin-row .info .oid { font-weight: 700; }
.admin-row .info .line2 { color: #3a4256; margin-top: 3px; }
.admin-row .info .line2 b { color: var(--muted); font-weight: 500; }
