:root {
  --bg: #f2f3f7;
  --card: #ffffff;
  --text: #1f2329;
  --sub: #6f7686;
  --border: #e7e8ee;
  --fill: #f4f5f9;
  --blue: #3370ff;
  --blue-deep: #2b5bd7;
  --blue-weak: #e9efff;
  --green: #0a9e4c;
  --green-deep: #067647;
  --green-weak: #e6f7ec;
  --orange-deep: #9a5510;
  --orange-weak: #fdf0e5;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
.boot { text-align: center; color: var(--sub); padding: 120px 0; }

.card { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.tag-green { background: var(--green-weak); color: var(--green-deep); }
.tag-orange { background: var(--orange-weak); color: var(--orange-deep); }
.tag-blue { background: var(--blue-weak); color: var(--blue-deep); }
.tag-gray { background: var(--fill); color: var(--sub); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 13px 16px; border-radius: 12px;
  border: 1px solid transparent; font-size: 15px; font-weight: 500;
  cursor: pointer; font-family: inherit; color: var(--text); background: var(--fill);
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-plain { background: var(--fill); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; margin-top: 4px; }
.btn-row .btn { flex: 1; }

.nav {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 6px;
  padding: 12px 12px; background: rgba(242,243,247,.88); backdrop-filter: blur(10px);
}
.nav-title { flex: 1; text-align: center; font-size: 16px; font-weight: 500; }
.nav-back {
  width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent;
  color: var(--text); font-size: 20px; cursor: pointer; line-height: 1;
}
.nav-sp { width: 32px; }

.body { padding: 14px 16px 90px; }
.sec { display: flex; justify-content: space-between; align-items: center; margin: 18px 2px 8px; font-size: 13px; color: var(--sub); }
.sec a, .link { color: var(--blue); text-decoration: none; font-size: 13px; cursor: pointer; }

/* 首页 */
.idx-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 18px 6px; }
.idx-date { font-size: 12px; color: var(--sub); }
.idx-hi { font-size: 21px; font-weight: 500; margin: 4px 0 0; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.cta {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: none; border-radius: 16px; padding: 18px 16px; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, #3370ff, #5b8cff); color: #fff; margin-top: 14px;
  box-shadow: 0 8px 20px rgba(51,112,255,.32);
}
.cta-ic { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.cta-main { flex: 1; }
.cta-main strong { display: block; font-size: 16px; font-weight: 500; }
.cta-main small { display: block; margin-top: 2px; font-size: 12px; opacity: .85; }
.entry {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px;
  background: var(--card); cursor: pointer; font-family: inherit; color: var(--text); margin-top: 14px;
}
.entry-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--orange-weak); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }

/* 列表条目 */
.item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--card); border: none; border-radius: 14px; padding: 13px 14px;
  margin-bottom: 10px; cursor: pointer; font-family: inherit; color: var(--text);
}
.item-main { flex: 1; min-width: 0; }
.item-title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { font-size: 12px; color: var(--sub); margin-top: 3px; }

.row {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
}
.mini {
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue-weak); color: var(--blue-deep);
  display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
}
.row-name { flex: 1; font-size: 14px; }
.row-time { font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--sub); font-size: 13px; padding: 24px 0; }

/* 表单 */
.field { margin-bottom: 14px; }
.label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 7px; }
.input, .textarea {
  width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; font-size: 14px; color: var(--text); font-family: inherit;
}
.textarea { resize: none; line-height: 1.6; }
.input:focus, .textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: transparent; }
.input[readonly] { cursor: pointer; }
.counter { text-align: right; font-size: 12px; color: var(--sub); margin: 6px 2px 12px; font-variant-numeric: tabular-nums; }
.pickers { display: flex; gap: 10px; }
.pickers .input { text-align: center; }
.footer {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(242,243,247,.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border); z-index: 12; display: flex; gap: 10px;
}
.footer .btn { flex: 1; }

/* 现场页 */
.host-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 4px 2px 12px; }
.host-head h3 { font-size: 17px; font-weight: 500; margin: 0; }
.host-head small { display: block; margin-top: 4px; font-size: 12px; color: var(--sub); }
.qr-card { text-align: center; padding: 18px 14px 12px; }
.qr-wrap { position: relative; display: inline-block; border-radius: 12px; overflow: hidden; }
#qr { display: block; width: 200px; height: 200px; background: #fff; }
.qr-dim {
  position: absolute; inset: 0; background: rgba(10,12,16,.72); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
/* display:flex 会覆盖 hidden 属性的 UA 样式，必须显式恢复 */
.qr-dim[hidden] { display: none; }
.qr-meta { margin-top: 12px; font-size: 12px; color: var(--sub); }
.count-card { display: flex; align-items: center; justify-content: center; padding: 13px; }
.count-card b { font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }
.count-card span { font-size: 13px; color: var(--sub); margin-left: 6px; }

/* 确认页 */
.banner {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  background: var(--green-weak); color: var(--green-deep); border-radius: 10px; padding: 9px 12px; margin-bottom: 12px;
}
.act-title { font-size: 17px; font-weight: 500; margin: 0 0 10px; }
.meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); margin-top: 7px; }
.success { text-align: center; padding: 26px 0 10px; }
.success-ic {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--green-weak); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 36px;
}
.success h3 { font-size: 18px; font-weight: 500; margin: 0 0 6px; }
.success p { font-size: 13px; color: var(--sub); margin: 0 0 22px; }

/* 详情 */
.seg { display: flex; background: var(--fill); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.seg button {
  flex: 1; border: none; border-radius: 8px; padding: 8px 0; font-size: 13px;
  background: transparent; color: var(--sub); cursor: pointer; font-family: inherit;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); font-weight: 500; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.me-state { display: flex; align-items: center; gap: 10px; }
.me-state .ok { color: var(--green); }
.me-state .wait { color: var(--orange-deep); }
.me-state .sub { display: block; font-size: 12px; color: var(--sub); margin-top: 2px; }
.ins-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ins-head .grow { flex: 1; }
.ins-name { font-size: 14px; font-weight: 500; }
.ins-time { font-size: 12px; color: var(--sub); }
.ins-text { font-size: 14px; line-height: 1.7; white-space: pre-wrap; margin: 0 0 10px; }
.hint { font-size: 12px; color: var(--sub); margin-top: 4px; }

/* 可见范围 */
.radio {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px;
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px;
  cursor: pointer; background: var(--card);
}
.radio:has(input:checked) { border-color: var(--blue); background: var(--blue-weak); }
.radio input { margin: 3px 0 0; accent-color: var(--blue); }
.radio b { display: block; font-size: 14px; font-weight: 500; }
.radio small { display: block; margin-top: 2px; font-size: 12px; color: var(--sub); }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(8px);
  background: rgba(20,22,28,.92); color: #fff; font-size: 13px;
  padding: 9px 16px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 99; max-width: 82%;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 遮罩（结束确认） */
.overlay {
  position: fixed; inset: 0; background: rgba(8,10,14,.45); z-index: 50;
  display: none; align-items: center; justify-content: center;
}
.overlay.show { display: flex; }
.modal {
  width: 280px; background: var(--card); border-radius: 14px; overflow: hidden; text-align: center;
}
.modal h4 { font-size: 16px; font-weight: 500; margin: 20px 20px 0; }
.modal p { font-size: 13px; color: var(--sub); line-height: 1.7; margin: 8px 20px 20px; }
.modal-btns { display: flex; border-top: 1px solid var(--border); }
.modal-btns button {
  flex: 1; border: none; background: transparent; padding: 13px 0; font-size: 15px;
  font-family: inherit; color: var(--text); cursor: pointer;
}
.modal-btns button + button { border-left: 1px solid var(--border); color: var(--blue); font-weight: 500; }
