:root {
  --green: #4caf50;
  --green-bg: #eaf7ec;
  --green-line: #86d08c;
  --blue: #2e86f5;
  --blue-d: #1f6fe0;
  --ink: #2b2f33;
  --sub: #7c828a;
  --muted: #b3b8bf;
  --line: #ecedf0;
  --field: #f5f6f8;
  --bg: #ffffff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #eef0f3;
  color: var(--ink);
  display: flex;
  justify-content: center;
}
.app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,.06);
}

/* 顶部 Tab */
.appbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.tabs { display: flex; }
.tab {
  flex: 1; background: none; border: none; padding: 16px 0 12px; font-size: 17px;
  color: var(--sub); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  position: relative; font-weight: 500;
}
.tab .ic { width: 20px; height: 20px; }
.tab.active { color: var(--green); font-weight: 700; }
.tab.active::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 46px; height: 3px; border-radius: 3px; background: var(--green);
}
.tab .ic svg { display: block; }

.view { display: none; flex: 1; flex-direction: column; padding: 0 16px 0; }
.view.active { display: flex; }

/* 提示行 */
.note { color: var(--sub); font-size: 13px; margin: 14px 0 6px; }

/* 日期条 */
.date-strip { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 12px; scrollbar-width: none; }
.date-strip::-webkit-scrollbar { display: none; }
.date-cell {
  flex: 0 0 auto; min-width: 60px; padding: 8px 8px 6px; text-align: center;
  border-radius: 12px; border: 1px solid transparent; cursor: pointer; transition: .12s;
}
.date-cell .w { font-size: 12px; color: var(--sub); }
.date-cell .d { font-size: 16px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.date-cell .dot { width: 5px; height: 5px; border-radius: 50%; background: #f5a623; margin: 4px auto 0; }
.date-cell .dot.gray { background: #d9dce1; }
.date-cell .check { color: var(--green); font-size: 12px; font-weight: 700; line-height: 1; height: 12px; }
.date-cell.active { background: var(--green-bg); border-color: var(--green-line); }
.date-cell.active .w { color: var(--green); }
.date-cell.disabled { opacity: .45; }
.cal-btn {
  flex: 0 0 auto; min-width: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--sub); font-size: 12px; gap: 3px; cursor: pointer; border-left: 1px solid var(--line); margin-left: 4px; padding-left: 8px;
}

/* 时段网格 */
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 8px 0 90px; }
.slot {
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 15px 4px; text-align: center; font-size: 13.5px; color: #565c64;
  cursor: pointer; position: relative; transition: .12s; letter-spacing: .2px;
}
.slot:active { transform: scale(.98); }
.slot.sel { border: 2px solid var(--blue); color: var(--ink); font-weight: 700; }
.slot.sel::after { content: "✓"; position: absolute; right: 6px; bottom: 3px; color: var(--blue); font-size: 12px; font-weight: 800; }
.slot.disabled { color: var(--muted); background: #fafbfc; border-color: #f0f1f4; cursor: not-allowed; }
.slot.disabled::after { content: attr(data-tag); position: absolute; right: 4px; bottom: 2px; font-size: 9px; color: var(--muted); }

/* 底部操作栏 */
.bottombar { position: sticky; bottom: 0; z-index: 20; display: flex; margin: 0 -16px; }
.bb-cancel {
  flex: 1; border: none; background: #b9bec6; color: #fff; font-size: 17px; padding: 16px 0; cursor: pointer;
}
.bb-cancel:active { background: #a8adb6; }
.bb-confirm {
  flex: 2; border: none; background: linear-gradient(180deg, #3d93ff, var(--blue)); color: #fff;
  font-size: 17px; padding: 10px 0 9px; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.15;
}
.bb-confirm .sub { font-size: 11.5px; opacity: .92; font-weight: 400; margin-top: 2px; }
.bb-confirm:active { background: var(--blue-d); }
.bb-confirm:disabled { opacity: .6; }

/* 时段信息行 */
.timeslot-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 2px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.ts-label { color: var(--sub); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.ts-value { font-weight: 700; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 4px; }
.ts-value .arrow { color: var(--muted); font-weight: 400; }
.ts-value.empty { color: var(--muted); font-weight: 400; }

/* 表单 */
.form { padding-top: 4px; background: #fafbfc; margin: 0 -16px; padding: 4px 16px 16px; }
.lbl { display: block; font-size: 15px; font-weight: 700; color: var(--ink); margin: 18px 0 8px; }
.lbl i { color: #e53935; font-style: normal; margin-left: 2px; }
.lbl.plain { font-weight: 700; }
.field {
  width: 100%; border: 1px solid transparent; background: var(--field); border-radius: 8px;
  padding: 13px 14px; font-size: 15px; color: var(--ink); outline: none; font-family: inherit;
}
.field::placeholder { color: #b6bbc2; }
.field:focus { background: #fff; border-color: var(--blue); }
textarea.field { min-height: 96px; resize: vertical; line-height: 1.6; }

.submit-btn {
  width: 100%; border: none; border-radius: 10px; margin: 18px 0 8px;
  background: linear-gradient(180deg, #3d93ff, var(--blue)); color: #fff; font-size: 17px; padding: 15px 0;
  cursor: pointer; box-shadow: 0 6px 16px rgba(46,134,245,.28);
}
.submit-btn:active { background: var(--blue-d); }
.submit-btn:disabled { opacity: .6; box-shadow: none; }

/* 我的预约 */
.my-bookings { padding: 8px 0 40px; }
.my-bookings h3 { font-size: 15px; margin: 22px 0 10px; }
.bk {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; background: #fff;
}
.bk .info b { font-size: 15px; }
.bk .info .meta { color: var(--sub); font-size: 12.5px; margin-top: 3px; }
.bk .info .rmk { color: #a08a5a; font-size: 12.5px; margin-top: 3px; }
.bk-del { border: none; background: #fdecea; color: #c0392b; border-radius: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(20,24,30,.42); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.mask.show { display: flex; }
.dialog { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 340px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.dialog h3 { margin: 0 0 10px; font-size: 17px; }
.dialog p { color: var(--sub); font-size: 14px; line-height: 1.7; margin: 0 0 4px; }
.dialog .acts { display: flex; gap: 10px; margin-top: 18px; }
.dialog .acts button { flex: 1; border: none; border-radius: 10px; padding: 12px 0; font-size: 15px; cursor: pointer; }
.dialog .acts .c { background: #eef0f3; color: #565c64; }
.dialog .acts .o { background: var(--blue); color: #fff; }

/* 下拉框 */
select.field {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6' fill='none' stroke='%237c828a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
select.field option { color: #2b2f33; }

/* 施工门店地址 */
.addr-box {
  display: flex; gap: 9px; align-items: flex-start; margin-top: 18px;
  background: #eef6ff; border: 1px solid #d3e6ff; border-radius: 10px; padding: 12px 14px;
}
.addr-box .addr-ic { color: var(--blue); flex: 0 0 auto; margin-top: 2px; }
.addr-title { font-size: 12.5px; color: #6f8bab; }
.addr-text { font-size: 14.5px; font-weight: 700; color: #1f6fe0; margin-top: 2px; }

/* 确认弹窗注意事项 */
.notice-box {
  margin-top: 12px; background: #fff8e8; border: 1px solid #f6e3b4; color: #8a6d0b;
  border-radius: 10px; padding: 11px 13px; font-size: 13px; line-height: 1.75;
}
.notice-box b { color: #b05e12; }

/* 已有预约提示条 */
.active-tip {
  background: #fff8e8; border: 1px solid #f6e3b4; color: #8a6d0b;
  border-radius: 10px; padding: 11px 13px; font-size: 13px; line-height: 1.7; margin: 4px 0 8px;
}
.active-tip b { color: #b05e12; }

/* 我的预约：已过期 */
.bk.expired { background: #fafbfc; }
.bk.expired .info b { color: #9aa0a8; text-decoration: line-through; }
.bk-expired {
  display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700;
  color: #b3261e; background: #fdecea; border-radius: 6px; padding: 1px 7px; text-decoration: none;
}

/* toast */
.toast {
  position: fixed; left: 50%; top: 26px; transform: translateX(-50%);
  background: #2b2f33; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px;
  z-index: 200; opacity: 0; transition: .25s; pointer-events: none; max-width: 90%;
}
.toast.show { opacity: 1; }
.toast.ok { background: var(--green); }
.toast.err { background: #e5484d; }

@media (max-width: 480px) { .app { box-shadow: none; } }
