:root {
  --primary: #07C160;
  --primary-dark: #06AD56;
  --danger: #FA5151;
  --warn: #FA9D3B;
  --info: #4A7DFF;
  --text: #1A1A1A;
  --text2: #888888;
  --text3: #B2B2B2;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --border: #EBEDF0;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 72px; }
.loading { text-align: center; color: var(--text3); padding: 80px 0; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.topbar .title { font-size: 17px; font-weight: 600; }
.bell { position: relative; font-size: 20px; line-height: 1; padding: 4px; }
.bell .dot {
  position: absolute; top: 0; right: -2px; min-width: 16px; height: 16px;
  background: var(--danger); color: #fff; font-size: 10px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

.page { padding: 14px 16px; }
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card-title { font-size: 14px; color: var(--text2); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }

.btn {
  display: block; width: 100%; border: none; border-radius: 12px;
  padding: 13px; font-size: 16px; font-weight: 500; cursor: pointer;
  background: var(--primary); color: #fff; text-align: center;
}
.btn:active { background: var(--primary-dark); }
.btn[disabled] { background: var(--text3); }
.btn-ghost { background: #F0F1F3; color: var(--text); }
.btn-ghost:active { background: #E4E6E9; }
.btn-danger { background: var(--danger); }
.btn-sm { width: auto; display: inline-block; padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.pill {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 500;
}
.pill-warn { background: #FFF3E6; color: var(--warn); }
.pill-info { background: #EBF1FF; color: var(--info); }
.pill-ok { background: #E8F9F0; color: var(--primary); }
.pill-danger { background: #FEEBEB; color: var(--danger); }
.pill-grey { background: #F0F1F3; color: var(--text2); }

.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.money-lg { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }

.util-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.util-row:last-child { border-bottom: none; }
.util-name { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.util-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.util-icon.water { background: #E7F4FF; }
.util-icon.electric { background: #FFF6E5; }
.util-icon.gas { background: #F0EBFF; }
.util-amount { font-size: 16px; }
.pending-tag { font-size: 12px; color: var(--text3); background: #F0F1F3; border-radius: 6px; padding: 2px 8px; }

.input, select.input {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; font-size: 16px; background: #FAFBFC; outline: none;
}
.input:focus { border-color: var(--primary); background: #fff; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.field-row { display: flex; align-items: center; gap: 10px; }
.field-row .input { flex: 1; }

.switch-row { display: flex; align-items: center; justify-content: space-between; }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; z-index: 1; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: #D8DADE; border-radius: 999px; transition: .2s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(20px); }

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff;
  border-top: 1px solid var(--border); display: flex; z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; text-align: center; padding: 8px 0 10px;
  font-size: 11px; color: var(--text2); display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabbar a .ico { font-size: 20px; }
.tabbar a.active { color: var(--primary); }

.room-card {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border-radius: var(--radius); padding: 18px 16px; margin-bottom: 12px;
  border: 2px solid transparent; cursor: pointer;
}
.room-card:active { border-color: var(--primary); }
.room-card .avatar {
  width: 46px; height: 46px; border-radius: 12px; background: #E8F9F0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.room-card .name { font-size: 17px; font-weight: 600; }
.room-card .desc { font-size: 13px; color: var(--text2); }

.qr-box { text-align: center; padding: 8px 0; }
.qr-box img { width: 220px; height: 220px; object-fit: contain; border-radius: 12px; border: 1px solid var(--border); }
.qr-empty { color: var(--text3); font-size: 14px; padding: 30px 0; }

.timeline { padding-left: 4px; }
.timeline-item { position: relative; padding: 0 0 16px 22px; font-size: 14px; }
.timeline-item::before {
  content: ''; position: absolute; left: 5px; top: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--primary);
}
.timeline-item::after { content: ''; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline-item:last-child::after { display: none; }
.timeline-item .time { font-size: 12px; color: var(--text3); }

.notice-item { padding: 14px 16px; background: var(--card); border-radius: var(--radius); margin-bottom: 10px; font-size: 14px; }
.notice-item.unread { border-left: 3px solid var(--primary); }
.notice-item .time { font-size: 12px; color: var(--text3); margin-top: 4px; }

.empty { text-align: center; color: var(--text3); padding: 60px 0; font-size: 14px; }
.hint { font-size: 13px; color: var(--text2); line-height: 1.7; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.text-c { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }

.steps { counter-reset: step; }
.steps li {
  list-style: none; position: relative; padding: 6px 0 6px 34px; font-size: 14px;
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 8px; width: 22px; height: 22px;
  background: #E8F9F0; color: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}

.acct-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.acct-row:last-child { border-bottom: none; }
.acct-no { font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.acct-empty { color: var(--text3); font-size: 14px; }

.ocr-results { margin-top: 10px; }
.ocr-chip {
  display: inline-flex; align-items: center; gap: 6px; margin: 4px 6px 0 0;
  background: #F0F1F3; border-radius: 8px; padding: 6px 10px; font-size: 13px;
}
.ocr-chip b { font-variant-numeric: tabular-nums; }
.ocr-chip button { border: none; background: var(--primary); color: #fff; border-radius: 5px; font-size: 11px; padding: 2px 6px; margin-left: 2px; cursor: pointer; }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.75); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 99;
  max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.proof-img { width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.upload-preview { margin-top: 10px; text-align: center; }
.upload-preview img { max-height: 220px; border-radius: 10px; border: 1px solid var(--border); }
.room-taken { opacity: .45; pointer-events: none; }
.room-taken .avatar { background: #F0F1F3; }
