/* ===== 话费充值前台样式 ===== */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --brand: #1677ff;
  --brand-dark: #0b5fd9;
  --brand-light: #e8f1ff;
  --text: #1a2233;
  --text-sub: #6b7789;
  --line: #e9edf5;
  --bg: #f2f6fd;
  --green: #12b76a;
  --orange: #f79009;
  --red: #ef4444;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(20, 60, 130, .08);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 50% -10%, #dce9ff 0%, rgba(220, 233, 255, 0) 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.wrap { max-width: 520px; margin: 0 auto; padding: 14px 14px 30px; }

/* 头部 */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 4px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(135deg, #3b8dff, #0b5fd9);
  color: #fff; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(22, 119, 255, .32);
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.head-link {
  font-size: 13px; color: var(--brand); text-decoration: none;
  background: #fff; border: 1px solid var(--line);
  padding: 7px 13px; border-radius: 999px;
}

/* 卡片 */
.card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,.9);
}

/* 主视觉 */
.hero { text-align: center; padding: 4px 0 18px; }
.hero h1 {
  margin: 0 0 8px; font-size: 25px; letter-spacing: .5px; font-weight: 800;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #1677ff, #00b3ff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { margin: 0; color: var(--text-sub); font-size: 13px; }
.hero-sm h1 { font-size: 22px; }

/* 运营商 tab */
.op-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 18px;
}
.op-tab {
  appearance: none; border: 1px solid var(--line); background: #f8fafd;
  border-radius: 12px; padding: 10px 4px; cursor: pointer;
  font-size: 13px; color: var(--text-sub); font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: .18s;
}
.op-tab .op-dot { width: 7px; height: 7px; border-radius: 50%; background: #c7d2e3; }
.op-tab[data-op="mobile"] .op-dot { background: #1a9cf0; }
.op-tab[data-op="unicom"] .op-dot { background: #e8442f; }
.op-tab[data-op="telecom"] .op-dot { background: #00a8a8; }
.op-tab.active {
  border-color: var(--brand); background: var(--brand-light);
  color: var(--brand-dark); font-weight: 600;
  box-shadow: 0 4px 12px rgba(22, 119, 255, .12);
}

/* 表单字段 */
.field { margin-bottom: 18px; }
.field > label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; margin-bottom: 9px; color: #2b3648;
}
.field-hint { font-weight: 400; font-size: 12px; color: var(--text-sub); }

#phone {
  width: 100%; height: 52px; border-radius: 12px;
  border: 1px solid var(--line); background: #fbfcfe;
  padding: 0 16px; font-size: 19px; letter-spacing: 2px;
  color: var(--text); font-family: inherit; outline: none;
  transition: .18s;
}
#phone:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(22,119,255,.12); }
#phone::placeholder { letter-spacing: 0; font-size: 15px; color: #a7b2c4; }

/* 面额 */
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.amount-item {
  position: relative; appearance: none; cursor: pointer;
  border: 1px solid var(--line); background: #fbfcfe;
  border-radius: 12px; padding: 14px 6px 10px;
  font-family: inherit; transition: .16s; text-align: center;
}
.amount-item .ai-face { display: block; font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.1; }
.amount-item .ai-face i { font-style: normal; font-size: 12px; font-weight: 500; margin-left: 1px; }
.amount-item .ai-price { display: block; font-size: 12px; color: var(--text-sub); margin-top: 5px; }
.amount-item.active {
  border-color: var(--brand); background: #f2f7ff;
  box-shadow: 0 6px 16px rgba(22, 119, 255, .16);
}
.amount-item.active .ai-face { color: var(--brand-dark); }
.empty-tip { font-size: 13px; color: var(--text-sub); padding: 20px 0; text-align: center; }

/* 支付方式 */
.pay-list { display: flex; flex-direction: column; gap: 8px; }
.pay-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; cursor: pointer; background: #fbfcfe;
  transition: .16s;
}
.pay-item input { position: absolute; opacity: 0; pointer-events: none; }
.pay-item:has(input:checked) { border-color: var(--brand); background: #f2f7ff; }
.pay-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pay-name { font-size: 14px; font-weight: 600; }
.pay-desc { font-size: 12px; color: var(--text-sub); }
.pay-ico {
  width: 30px; height: 30px; border-radius: 9px; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; color: #fff; flex: none;
}
.pay-ico.alipay { background: #1677ff; }
.pay-ico.wechat { background: #07c160; }
.pay-ico.offline { background: #7b8794; }
.pay-ico.ezpay { background: #f5a623; }
.pay-ico.caihong { background: linear-gradient(135deg, #ff8a4c, #fe4a7a); }
.pay-ico.mazhi { background: #2b9af3; }
.pay-item input:checked ~ .pay-body .pay-name { color: var(--brand-dark); }

/* 底部支付条 */
.paybar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 20px; padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.paybar-left { display: flex; flex-direction: column; gap: 2px; }
.paybar-label { font-size: 11px; color: var(--text-sub); }
#payAmount { font-size: 24px; font-weight: 800; color: #f04438; line-height: 1.1; }
.btn-primary {
  appearance: none; border: 0; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, #3b8dff, #0b5fd9);
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .5px;
  height: 50px; padding: 0 30px; border-radius: 13px;
  box-shadow: 0 8px 18px rgba(22, 119, 255, .28);
  transition: .16s; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center;
}
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }
.btn-inline { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 18px; border-radius: 11px;
  border: 1px solid var(--line); background: #fff; color: var(--text-sub);
  font-size: 14px; text-decoration: none;
}

/* 说明 */
.notice-card h2 { font-size: 15px; margin: 0 0 10px; font-weight: 700; }
.notice-body { font-size: 13px; line-height: 1.85; color: var(--text-sub); }

.flash-err {
  background: #fff2f0; border: 1px solid #ffd7cf; color: #c0392b;
  border-radius: 12px; padding: 11px 14px; font-size: 13px; margin-bottom: 14px;
}

/* 支付页 */
.pay-card { text-align: center; }
.pay-status { padding: 10px 0 6px; }
.st-ico {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
}
.st-ico.success { background: linear-gradient(135deg, #34d399, #12b76a); }
.st-ico.blue { background: linear-gradient(135deg, #3b8dff, #0b5fd9); }
.st-ico.orange { background: linear-gradient(135deg, #ffb648, #f79009); }
.st-ico.red { background: linear-gradient(135deg, #ff7a70, #ef4444); }
.st-ico.gray { background: #b6c0d0; }
.pay-status h1 { font-size: 20px; margin: 0 0 6px; }
.pay-status p { font-size: 13px; color: var(--text-sub); margin: 0; }
.pay-status .hl { color: #f04438; font-size: 18px; }

.qr-wrap { padding: 8px 0 6px; }
.qr-box {
  width: 200px; height: 200px; margin: 8px auto 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  padding: 8px; box-shadow: 0 6px 20px rgba(20, 60, 130, .08);
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.qr-fallback { font-size: 11px; color: var(--text-sub); word-break: break-all; line-height: 1.6; }
.qr-tip { font-size: 14px; font-weight: 600; }
.qr-amount { font-size: 26px; font-weight: 800; color: #f04438; margin: 8px 0 4px; }
.qr-pulse { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; color: var(--text-sub); margin-top: 8px; }
.qr-pulse .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .3; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.offline-wrap { padding: 6px 0; }
.offline-amount { font-size: 30px; font-weight: 800; color: #f04438; margin: 6px 0 10px; }
.offline-tip { font-size: 13px; color: var(--text-sub); line-height: 1.8; margin: 4px 0 14px; }
.copy-line {
  display: flex; align-items: center; justify-content: space-between;
  background: #f7f9fd; border-radius: 10px; padding: 10px 14px;
  font-size: 13px; margin-bottom: 8px;
}
.copy-line span { color: var(--text-sub); }
.copy-line strong { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; }
.copyable { cursor: pointer; }
.copyable:active { color: var(--brand); }

.alert-box { background: #fff8e6; border: 1px solid #ffe3a3; border-radius: 12px; padding: 14px; font-size: 13px; color: #8a6100; }
.alert-box p { margin: 0 0 8px; }
.alert-box .btn-inline { margin-top: 6px; }

.order-detail { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 12px; text-align: left; }
.od-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 7px 0; color: var(--text-sub); }
.od-row > span:last-child { color: var(--text); font-weight: 500; }
.order-actions { display: flex; gap: 10px; margin-top: 14px; }
.order-actions > * { flex: 1; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
}
.tag.green { background: #e8f8ef; color: #0a9a5c; }
.tag.orange { background: #fff3e2; color: #c26a00; }
.tag.blue { background: #e8f1ff; color: #0b5fd9; }
.tag.red { background: #ffeded; color: #d32f2f; }
.tag.gray { background: #f0f2f6; color: #7b8794; }

/* 查询页 */
.query-form { display: flex; gap: 9px; margin-bottom: 16px; }
.query-form input {
  flex: 1; height: 46px; border-radius: 11px; border: 1px solid var(--line);
  background: #fbfcfe; padding: 0 14px; font-size: 15px; outline: none; font-family: inherit;
}
.query-form input:focus { border-color: var(--brand); background: #fff; }
.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-item {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px;
  background: #fbfcfe; transition: .16s;
}
.order-item:active { background: #f2f7ff; }
.oi-top { display: flex; align-items: center; justify-content: space-between; }
.oi-face { font-size: 19px; font-weight: 800; }
.oi-face i { font-style: normal; font-size: 12px; font-weight: 500; color: var(--text-sub); margin-left: 1px; }
.oi-mid { display: flex; gap: 14px; font-size: 13px; color: var(--text-sub); margin: 7px 0 5px; }
.oi-bot { display: flex; justify-content: space-between; font-size: 12px; color: #9aa5b5; }
.oi-amt { color: #f04438; font-weight: 700; }
.empty-state { text-align: center; color: var(--text-sub); font-size: 13px; padding: 22px 0; line-height: 1.8; }

/* 页脚 */
.site-foot { text-align: center; padding: 8px 0 10px; }
.foot-service { font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.foot-service a { color: var(--brand); text-decoration: none; }
.foot-service .copyable { color: var(--brand); }
.foot-copy { font-size: 11px; color: #9aa5b5; line-height: 1.7; padding: 0 10px; }

@media (max-width: 360px) {
  .amount-grid { grid-template-columns: repeat(2, 1fr); }
  #payAmount { font-size: 21px; }
}

/* ===== 语言切换 ===== */
.lang-switch {
  display: flex; gap: 3px; padding: 3px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  flex: none;
}
.lang-btn {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  color: var(--text-sub); text-decoration: none; white-space: nowrap;
  transition: .15s;
}
.lang-btn.on { background: var(--brand); color: #fff; font-weight: 600; }

.hero-link {
  display: inline-block; margin-top: 9px;
  font-size: 12.5px; color: var(--brand); text-decoration: none;
  border-bottom: 1px solid rgba(22, 119, 255, .35); padding-bottom: 1px;
}

/* ===== 号码对应的本店客户信息 ===== */
.cust-card {
  margin-top: 10px; padding: 12px 14px;
  background: #f2f7ff; border: 1px solid #d9e8ff; border-radius: 12px;
  display: none;
}
.cust-card.show { display: block; }
.cust-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 3px 0; font-size: 13px;
}
.cust-label { color: var(--text-sub); }
.cust-name { font-weight: 700; }
.cust-name.new { font-weight: 500; font-size: 12.5px; color: var(--brand); }
.cust-bal { color: #f04438; font-weight: 800; font-size: 15px; }
.cust-meta {
  margin-top: 7px; padding-top: 7px; border-top: 1px dashed #dbe8fa;
  font-size: 11.5px; color: #8a94a6; line-height: 1.6;
}
.cust-meta .cm-line { display: block; line-height: 1.85; }

/* 数字保持从左到右 */
.num { direction: ltr; unicode-bidi: embed; }

/* ===== 维语 / RTL ===== */
html[dir="rtl"] body {
  font-family: "UKIJ Tuz Tom", "UKIJ Tuz", "Alkatip Basma Tom", "Microsoft Uyghur",
               "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", "Arial", sans-serif;
  letter-spacing: 0;
}
html[dir="rtl"] .brand-name,
html[dir="rtl"] .brand-sub,
html[dir="rtl"] .hero h1,
html[dir="rtl"] .hero p,
html[dir="rtl"] .field > label,
html[dir="rtl"] .notice-body,
html[dir="rtl"] .tag { letter-spacing: 0; }
html[dir="rtl"] .hero h1 { font-size: 26px; }
html[dir="rtl"] #phone { direction: ltr; text-align: left; }
html[dir="rtl"] .amount-item .ai-face i { margin-left: 0; margin-right: 2px; }
html[dir="rtl"] .qr-tip, html[dir="rtl"] .offline-tip { line-height: 1.9; }
html[dir="rtl"] .od-row > span:last-child { text-align: left; }
html[dir="rtl"] .copy-line strong { direction: ltr; }
