/* A级猎魔 - 公共样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f7f5f0;
  color: #333;
  min-height: 100vh;
  padding-bottom: 70px;
  transition: padding-bottom .2s ease;
}
/* 输入框获焦时加大底部留白，方便滚到键盘上方 */
body.kb-open {
  padding-bottom: 280px;
}

.status-bar {
  height: env(safe-area-inset-top, 0);
  background: #f7f5f0;
}

.header {
  padding: 16px 20px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #c9a86c, #b8954f);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.logo svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.greeting h1 {
  font-size: 17px;
  font-weight: 600;
  color: #2c2c2c;
  line-height: 1.3;
}

.greeting p {
  font-size: 13px;
  color: #999;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.bell, .help-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: relative;
  cursor: pointer;
  border: none;
  font-size: 13px;
  color: #b8954f;
  font-weight: 600;
}

.bell svg, .help-btn svg {
  width: 18px;
  height: 18px;
  stroke: #b8954f;
  fill: none;
  stroke-width: 1.8;
}

.grid-wrap {
  padding: 8px 16px 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grid-item {
  background: #fff;
  border-radius: 16px;
  padding: 18px 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.grid-item:active {
  transform: scale(0.96);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.icon-box {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.icon-box svg {
  width: 28px;
  height: 28px;
  stroke: #c9a86c;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-box img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}

.grid-item span {
  font-size: 13px;
  color: #555;
  font-weight: 500;
  text-align: center;
}

.section {
  margin: 0 16px 16px;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #2c2c2c;
}

.section-more {
  font-size: 13px;
  color: #bbb;
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.section-more svg {
  width: 14px;
  height: 14px;
  stroke: #ccc;
  fill: none;
  stroke-width: 2;
}

.empty-state {
  text-align: center;
  padding: 24px 0 16px;
  color: #ccc;
  font-size: 14px;
}

.empty-state.with-icon {
  padding: 28px 0 20px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  opacity: 0.45;
}

.empty-icon svg {
  width: 48px;
  height: 48px;
  stroke: #d4c4a0;
  fill: none;
  stroke-width: 1.4;
}

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: #fff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -1px 8px rgba(0,0,0,0.04);
  z-index: 100;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #bbb;
  font-size: 10px;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: none;
}

.tab-item.active {
  color: #c9a86c;
}

.tab-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-item.active svg {
  fill: currentColor;
  stroke: currentColor;
}

.tab-item.active .home-icon {
  fill: #c9a86c;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 999;
  max-width: 80%;
  text-align: center;
}

.toast.show {
  opacity: 1;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-mask.show {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  max-height: 80vh;
  overflow: auto;
  padding: 20px;
}

.modal h3 {
  font-size: 17px;
  margin-bottom: 12px;
  color: #2c2c2c;
}

.modal .modal-body {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
  white-space: pre-wrap;
}

.modal .modal-close {
  margin-top: 16px;
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: #c9a86c;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.modal-actions button {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
}
.modal-btn-cancel {
  background: #f3f0ea;
  color: #666;
}
.modal-btn-ok {
  background: linear-gradient(135deg, #c9a86c, #b8954f);
  color: #fff;
  font-weight: 600;
}

/* 工单列表 */
.ticket-item {
  padding: 12px 0;
  border-bottom: 1px solid #f2f0eb;
  cursor: pointer;
}

.ticket-item:last-child {
  border-bottom: none;
}

.ticket-item .t-title {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.ticket-item .t-meta {
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.badge-0 { background: #e8f4ff; color: #409eff; }
.badge-1 { background: #fff8e1; color: #d4a017; }
.badge-2 { background: #e8f8ef; color: #67c23a; }
.badge-3 { background: #fdecea; color: #e74c3c; }

/* 表单 */
.form-page {
  padding: 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  height: 44px;
  border: 1px solid #ebe6dc;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 15px;
  background: #fff;
  outline: none;
}

.form-group textarea {
  height: 100px;
  padding: 10px 12px;
  resize: none;
}

.btn-primary {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #c9a86c, #b8954f);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.btn-primary:disabled {
  opacity: 0.6;
}

.page-title {
  padding: 12px 20px;
  font-size: 18px;
  font-weight: 600;
}

/* 综合查询聊天 */
.chat-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px - env(safe-area-inset-bottom, 0px));
  padding-bottom: 0;
  margin-bottom: 60px;
}

.chat-header {
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #f0ece4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: linear-gradient(180deg, #f7f5f0 0%, #f0ebe3 100%);
}

.msg {
  max-width: 82%;
  margin-bottom: 12px;
  clear: both;
}

.msg .bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.bot {
  float: left;
}

.msg.bot .bubble {
  background: #fff;
  color: #333;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.msg.user {
  float: right;
}

.msg.user .bubble {
  background: linear-gradient(135deg, #c9a86c, #b8954f);
  color: #fff;
  border-top-right-radius: 4px;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid #f0ece4;
}

.chat-input-bar input {
  flex: 1;
  height: 40px;
  border: 1px solid #ebe6dc;
  border-radius: 20px;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
}

.chat-input-bar button {
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 20px;
  background: #c9a86c;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.profile-card {
  margin: 16px;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.profile-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f5f2eb;
  font-size: 14px;
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-row .label {
  color: #999;
}

.profile-row .value {
  color: #333;
  font-weight: 500;
}

.btn-recharge {
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #c9a86c, #b8954f);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 4px;
}
.page-nav h2 {
  font-size: 18px;
  font-weight: 600;
}
.back-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #333;
  font-size: 22px;
  line-height: 36px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.recharge-wrap { padding: 8px 16px 24px; }
.recharge-tip {
  margin: 0 0 12px;
  background: #fff8e6;
  border: 1px solid #f0d48a;
  color: #8a6d1d;
  border-radius: 16px 16px 16px 4px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 2px 8px rgba(200, 160, 80, .12);
}
.pay-scheme {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.pay-scheme h3 {
  font-size: 16px;
  margin-bottom: 4px;
}
.scheme-sub {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 12px;
}
.vip-points-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 0;
  color: #888;
}
.vip-free-badge {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.pkg-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pkg-card {
  border: 1px solid #efe8d8;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  background: #fdfbf7;
}
.pkg-card:active { transform: scale(.98); }
.pkg-card.active {
  border-color: #c9a86c;
  background: #fff8ea;
}
.pkg-card .pkg-main {
  font-size: 16px;
  font-weight: 700;
  color: #b8954f;
}
.pkg-card .pkg-sub {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}
.okpay-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.okpay-input-row input {
  flex: 1;
  height: 42px;
  border: 1px solid #ebe6dc;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 15px;
  outline: none;
}
.okpay-input-row button {
  height: 42px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #c9a86c, #b8954f);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.pay-wait {
  background: #fff;
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.pay-wait .wait-amt {
  font-size: 28px;
  font-weight: 700;
  color: #b8954f;
  margin: 8px 0;
}
.pay-wait .wait-addr {
  font-size: 13px;
  word-break: break-all;
  background: #f7f5f0;
  border-radius: 8px;
  padding: 10px;
  margin: 12px 0;
  color: #555;
}
.pay-wait img.qr {
  width: 180px;
  height: 180px;
  margin: 8px auto;
  display: block;
  background: #fff;
  border-radius: 8px;
}
.wait-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.wait-actions button, .cash-methods button {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: #c9a86c;
  color: #fff;
  cursor: pointer;
}
.wait-actions button.ghost, .cash-methods button.ghost {
  background: #eee;
  color: #666;
}
.cash-methods {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.countdown { color: #e6a23c; font-size: 13px; margin-top: 8px; }
.hidden { display: none !important; }

.bot-tip {
  position: fixed;
  top: 56px;
  right: 12px;
  left: 12px;
  z-index: 2000;
  background: #fff8e6;
  border: 1px solid #f0d48a;
  color: #8a6d1d;
  border-radius: 12px;
  padding: 12px 36px 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.bot-tip-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #8a6d1d;
  font-size: 20px;
  line-height: 28px;
  cursor: pointer;
}

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}
