:root{
  --bg:#0b1220;
  --card:#0f172a;
  --card2:#111c33;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --line:#1f2a44;
  --primary:#22c55e;
  --danger:#ef4444;
  --chip:#172554;
  --chipOn:#1d4ed8;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:linear-gradient(180deg,#0b1220 0%, #060b14 100%);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px;
  background:rgba(6,11,20,.9);
  backdrop-filter: blur(8px);
  border-bottom:1px solid rgba(255,255,255,.06);
}

.brand{display:flex; gap:10px; align-items:center}
.logo{
  width:34px; height:34px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  background:rgba(34,197,94,.16);
  border:1px solid rgba(34,197,94,.35);
  font-weight:800;
}
.brand-title{font-weight:800; letter-spacing:.3px}
.brand-sub{font-size:12px; color:var(--muted); margin-top:2px}

.app{
  padding:12px 12px 84px;
  max-width:680px;
  margin:0 auto;
}

.card{
  background:rgba(15,23,42,.92);
  border:1px solid rgba(255,255,255,.06);
  border-radius:18px;
  padding:14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  margin-bottom:12px;
}
.card.subtle{
  background:rgba(17,28,51,.55);
}
.card-title{
  font-size:16px;
  font-weight:800;
  margin-bottom:10px;
}

.small{font-size:12px;color:var(--muted);line-height:1.55}
.hint{margin-top:10px;font-size:12px;color:var(--muted)}
.hint.err{color:#fecaca}
.hint.ok{color:#bbf7d0}

.form label{display:block;font-size:12px;color:var(--muted);margin:10px 0 6px}
input,textarea{
  width:100%;
  background:rgba(2,6,23,.55);
  border:1px solid rgba(255,255,255,.08);
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  outline:none;
}
textarea{resize:vertical}

.btn{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.40);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  font-weight:700;
  cursor:pointer;
}
.btn:active{transform:scale(.99)}
.btn.primary{
  background:rgba(34,197,94,.22);
  border-color:rgba(34,197,94,.45);
}
.btn.ghost{
  background:transparent;
  border-color:rgba(255,255,255,.10);
}
.actions{
  display:flex; gap:10px; flex-wrap:wrap;
  margin-top:10px;
}
.actions .btn{flex:1; min-width:120px}

.box{
  margin-top:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(2,6,23,.35);
  white-space:pre-wrap;
  line-height:1.6;
}

.kv{
  display:grid;
  grid-template-columns: 120px 1fr;
  gap:8px 10px;
  font-size:13px;
  margin-top:6px;
}
.k{color:var(--muted)}
.v{color:var(--text); word-break:break-all}

.choice-row{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px}
.chip{
  background:rgba(23,37,84,.55);
  border:1px solid rgba(255,255,255,.08);
  padding:8px 10px;
  border-radius:999px;
  font-weight:700;
  cursor:pointer;
  color:var(--text);
}
.chip.active{
  background:rgba(29,78,216,.28);
  border-color:rgba(59,130,246,.45);
}

.seg{display:flex; gap:8px; margin:10px 0}
.seg-btn{
  flex:1;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.40);
  color:var(--text);
  font-weight:800;
  cursor:pointer;
}
.seg-btn.active{
  border-color:rgba(34,197,94,.45);
  background:rgba(34,197,94,.18);
}

.list{margin-top:12px; display:flex; flex-direction:column; gap:10px}
.item{
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(2,6,23,.35);
}
.item .t{font-weight:800; margin-bottom:6px}
.badge{
  display:inline-block;
  padding:3px 8px;
  border-radius:999px;
  font-size:12px;
  margin-right:6px;
  border:1px solid rgba(255,255,255,.10);
  color:var(--muted);
}
.badge.ok{color:#bbf7d0; border-color:rgba(34,197,94,.35)}
.badge.err{color:#fecaca; border-color:rgba(239,68,68,.35)}

.tabbar{
  position:fixed; left:0; right:0; bottom:0;
  display:flex;
  background:rgba(6,11,20,.92);
  border-top:1px solid rgba(255,255,255,.06);
  padding:8px 10px calc(8px + env(safe-area-inset-bottom));
  gap:8px;
  z-index:60;
}
.tab{
  flex:1;
  border:none;
  background:transparent;
  color:var(--muted);
  font-weight:900;
  padding:10px 8px;
  border-radius:14px;
  cursor:pointer;
}
.tab.active{
  color:var(--text);
  background:rgba(255,255,255,.06);
}

.pay-box{margin-top:10px}
.qrcode{
  width:220px;
  height:220px;
  margin:10px auto;
  border-radius:16px;
  display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
}

.photo-area{
  margin-top:10px;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(2,6,23,.25);
}
.photo-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}
.photo-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}
.photo-thumb{
  position:relative;
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  aspect-ratio: 1 / 1;
}
.photo-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.photo-badge{
  position:absolute;
  left:8px; top:8px;
  padding:3px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  background:rgba(0,0,0,.45);
  border:1px solid rgba(255,255,255,.18);
}

.progress-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:8px;
}
.progress{
  flex:1;
  height:10px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
}
.progress > div{
  height:10px;
  width:0%;
  background:rgba(34,197,94,.55);
}
.progress-text{
  width:64px;
  text-align:right;
  font-size:12px;
  color:var(--muted);
}

.thumb-del{
  position:absolute;
  right:8px; top:8px;
  width:28px; height:28px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(0,0,0,.45);
  color:#fff;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.thumb-del:active{transform:scale(.98)}

.modal{
  position:fixed; inset:0;
  z-index:100;
}
.modal-mask{
  position:absolute; inset:0;
  background:rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
}
.modal-card{
  position:absolute;
  left:12px; right:12px;
  top:10vh;
  max-width:720px;
  margin:0 auto;
  background:rgba(15,23,42,.95);
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  overflow:hidden;
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 12px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.modal-title{font-weight:900}
.modal-body{
  padding:12px;
  max-height:70vh;
  overflow:auto;
}
