/* ============================================================
   二维码查询系统 —— 样式（浅色主题）
   ============================================================ */

:root {
  --bg:          #f4f6fa;
  --surface:     #ffffff;
  --surface-2:   #f8fafc;
  --border:      #e4e8f0;
  --border-soft: #eef1f6;
  --text:        #1a2233;
  --text-2:      #4b5768;
  --muted:       #7b8798;
  --primary:     #2563eb;
  --primary-dk:  #1d4ed8;
  --primary-soft:#eff4ff;
  --warn-bg:     #fff8eb;
  --warn-bd:     #f3d9a4;
  --warn-tx:     #8a5a00;
  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 1px 2px rgba(20, 32, 56, .04), 0 8px 24px rgba(20, 32, 56, .06);
  --shadow-lg:   0 12px 40px rgba(20, 32, 56, .14);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.wrap { width: 100%; max-width: 940px; margin: 0 auto; padding: 0 20px; }

/* ---------------- 页头 ---------------- */
.site-header {
  background: linear-gradient(160deg, #2f6bed 0%, #2454c8 100%);
  color: #fff;
  padding: 40px 0 34px;
}
.site-title {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: .5px;
}
.site-sub {
  margin: 8px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, .82);
}

/* ---------------- 查询区 ---------------- */
.search-panel { margin: -26px 0 30px; position: relative; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 8px 8px 16px;
  box-shadow: var(--shadow-lg);
  transition: border-color .18s, box-shadow .18s;
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12), var(--shadow-lg);
}
.search-icon { display: flex; flex: none; color: var(--muted); }
.search-icon svg { width: 20px; height: 20px; }

#roomInput {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  padding: 10px 0;
}
#roomInput::placeholder { color: #a8b2c1; }

.clear-btn {
  flex: none;
  width: 26px; height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--border-soft);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s;
}
.clear-btn:hover { background: #e2e7ef; color: var(--text-2); }

.search-btn {
  flex: none;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 26px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.search-btn:hover  { background: var(--primary-dk); }
.search-btn:active { transform: scale(.98); }

.search-hint {
  margin: 12px 2px 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.search-hint b { color: var(--text-2); font-weight: 600; }

/* ---------------- 结果区 ---------------- */
.output { padding-bottom: 40px; }

.result-group { margin-bottom: 26px; }
.group-label {
  font-size: 13px;
  color: var(--muted);
  margin: 0 2px 12px;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 22px;
  animation: rise .28s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.room-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.room-no {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text);
  word-break: break-all;
}
.floor-tag {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #d8e3fd;
  border-radius: 999px;
  padding: 2px 10px;
}
.card-name {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}
.multi-note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--warn-tx);
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
}
.multi-note b { font-weight: 600; }

/* ---------------- 账户余额 ---------------- */
.bal-box {
  margin: 14px 0 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid #cfe0fd;
  background: linear-gradient(180deg, #f4f8ff 0%, #eaf2ff 100%);
}
.bal-label {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dk);
}
.bal-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary-dk);
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}
.bal-value .bal-cur { font-size: 17px; font-style: normal; margin-right: 1px; }
.bal-tip {
  flex: 1 1 100%;
  font-size: 12.5px;
  font-weight: 600;
  color: #b3261e;
}
.bal-box.is-low {
  border-color: #f5c2c0;
  background: linear-gradient(180deg, #fff5f4 0%, #ffeceb 100%);
}
.bal-box.is-low .bal-label,
.bal-box.is-low .bal-value { color: #b3261e; }

/* 二维码主体 */
.qr-body { padding: 22px; display: flex; justify-content: center; }
.qr-item { width: 100%; max-width: 300px; text-align: center; }

.qr-frame {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: zoom-in;
  transition: border-color .16s, transform .16s;
  display: block;
  width: 100%;
}
.qr-frame:hover { border-color: var(--primary); transform: translateY(-2px); }
.qr-frame img {
  display: block;
  width: 100%;
  height: auto;
  /* 保证微信 / iOS 内长按图片可弹出「保存图片 / 识别图中二维码」菜单 */
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}

/* 微信内操作提示 */
.wechat-tip {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--primary-dk);
  background: var(--primary-soft);
  border: 1px solid #d8e3fd;
  border-radius: 8px;
  padding: 7px 12px;
}

.qr-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--primary-soft); border-color: #c9dafd; color: var(--primary-dk); }
.btn svg { width: 14px; height: 14px; }

/* ---------------- 缴费操作指引 ---------------- */
.pay-guide {
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border-soft);
  background: #fffdf6;
}
.pay-guide-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #a15c00;
}
.pay-guide-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #e8960c;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}
.pay-guide-desc {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-2);
}
.pay-guide-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 16px;
}
.pay-guide-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}
.pay-guide-step b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 1px solid #eac37e;
  background: #fff3d9;
  color: #a15c00;
  font-size: 11px;
  flex: none;
}
.pay-guide-step em { font-style: normal; font-weight: 600; color: var(--text); }

.pay-guide-figure { margin: 0; }
.pay-guide-figure img {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: zoom-in;
}
.pay-guide-figure figcaption {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

/* ---------------- 空状态 / 未找到 ---------------- */
.state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 46px 26px;
  text-align: center;
  box-shadow: var(--shadow);
}
.state-icon { font-size: 34px; line-height: 1; margin-bottom: 14px; }
.state-title { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.state-desc  { font-size: 14px; color: var(--muted); margin: 0; }

.suggest-wrap { margin-top: 22px; }
.suggest-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { background: var(--primary-soft); border-color: #c9dafd; color: var(--primary-dk); }

/* ---------------- 页脚 ---------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 18px 0 30px;
  font-size: 12.5px;
  color: var(--muted);
  background: transparent;
}

/* ---------------- 图片放大 ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(16, 22, 34, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade .16s ease both;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.lb-body { text-align: center; max-height: 100%; }
#lbImg {
  max-width: min(78vw, 460px);
  max-height: 76vh;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px;
  display: block;
  margin: 0 auto;
}
.lb-caption { color: #e8edf6; font-size: 14px; margin-top: 14px; }
.lb-close {
  position: absolute;
  top: 18px; right: 22px;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.lb-close:hover { background: rgba(255, 255, 255, .26); }

/* ---------------- 响应式 ---------------- */
@media (min-width: 680px) {
  .result-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 328px;
    align-items: center;
  }
  .card-head { border-bottom: 0; border-right: 1px solid var(--border-soft); }
  .qr-body { padding: 24px; }
}
@media (max-width: 679px) {
  .card-head { border-bottom: 1px solid var(--border-soft); }
}
@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .site-header { padding: 30px 0 28px; }
  .site-title { font-size: 21px; }
  .search-box { padding: 6px 6px 6px 13px; }
  .search-btn { padding: 10px 18px; }
  #roomInput { font-size: 16px; }
  .card-head { padding: 18px 18px 14px; }
  .room-no { font-size: 23px; }
  .qr-item { padding: 18px 18px 16px; }
  .state { padding: 38px 18px; }
}

/* ---------------- 打印 ---------------- */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .wrap { max-width: none; padding: 0; }
  .output { padding: 0; }
  .result-card {
    box-shadow: none;
    border: 1px solid #bbb;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 16px;
  }
  .qr-body { padding: 14px; display: block; }
  .qr-item { max-width: 320px; margin: 0 auto; border: 1px solid #e0e0e0; padding: 12px; }
  .qr-frame { cursor: default; border-color: #ddd; }
  .qr-actions { display: none !important; }
  .wechat-tip { display: none !important; }
  .multi-note { background: #fff; }
  .lightbox { display: none !important; }
}
