/* ===== 充值中心前台样式（index.css） ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #2d3748;
    min-height: 100vh;
}

/* ===== 顶部导航栏（蓝→青绿渐变） ===== */
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 18px;
    background: linear-gradient(135deg, #5B9BD5 0%, #6BB5D6 40%, #7ECBA1 100%);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 4px 16px rgba(91,155,213,0.25), inset 0 1px 0 rgba(255,255,255,0.20);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-icon {
    width: 34px; height: 34px; background: rgba(255,255,255,0.20);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 800; color: #fff;
}
.header-title { color: #fff; font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.home-btn {
    display: flex; align-items: center; gap: 4px; padding: 7px 15px;
    background: rgba(255,255,255,0.20); border: none; border-radius: 20px;
    color: #fff; font-size: 13px; cursor: pointer; transition: all 0.2s ease; font-weight: 500;
}
.home-btn:active { transform: scale(0.95); }

/* ===== 主内容区 ===== */
.main { padding: 16px; max-width: 480px; margin: 0 auto; padding-bottom: 80px; }

.page-section { display: none; animation: fadeIn 0.3s ease; }
.page-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 横幅 ===== */
.banner {
    text-align: center; padding: 26px 18px; margin-bottom: 14px;
    background: linear-gradient(135deg, #EAF2FB 0%, #E6F0F9 100%);
    border-radius: 14px; border: 1px solid #C3D9EF;
}
.banner-text { font-size: 17px; font-weight: 700; color: #003A6E; letter-spacing: 1px; }
.banner-sub { font-size: 13px; color: #22C55E; margin-top: 7px; font-weight: 600; }
.banner-desc { font-size: 12px; color: #6B7280; margin-top: 5px; letter-spacing: 0.3px; }

/* ===== 公告条（橙色左边框风格） ===== */
.notice-bar {
    display: block; padding: 13px 16px; margin-bottom: 16px;
    background: #FFFBEB; border-left: 4px solid #F59E0B; border-radius: 0 11px 11px 0;
}
.notice-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #B45309; margin-bottom: 4px; }
.notice-text { font-size: 13px; color: #5C4033; line-height: 1.65; }

/* ===== 卡片 ===== */
.card {
    background: #fff; border-radius: 14px; padding: 20px 18px;
    box-shadow: 0 4px 18px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.03);
    border: 1px solid #E2E8F0; margin-bottom: 14px;
}
.card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.card-dot {
    width: 8px; height: 8px; background: #3B82F6; border-radius: 50%; flex-shrink: 0;
}
.card-title { font-size: 16px; font-weight: 700; color: #1f2937; }

/* ===== 输入框 ===== */
.input-group { margin-bottom: 14px; }
.input-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #4b5563; margin-bottom: 7px; }
.form-input {
    width: 100%; padding: 12px 14px; border: 1.5px solid #d1d5db; border-radius: 10px;
    font-size: 15px; color: #1f2937; outline: none; transition: all 0.2s ease; background: #f9fafb;
}
.form-input::placeholder { color: #9ca3af; }
.form-input:focus { border-color: #F59E0B; background: #fff; box-shadow: 0 0 0 3px rgba(245,158,11,0.12); }

/* ===== 按钮（橙黄琥珀色渐变） ===== */
.btn-primary {
    width: 100%; padding: 14px 20px;
    background: linear-gradient(135deg, #F5A623 0%, #E8941C 50%, #D48806 100%);
    border: none; border-radius: 26px; color: #fff; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(212,136,6,0.30), inset 0 1px 0 rgba(255,255,255,0.20);
    margin-bottom: 10px;
}
.btn-primary:active { transform: scale(0.97); background: #B5740A; box-shadow: 0 2px 6px rgba(212,136,6,0.22); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    width: 100%; padding: 13px 20px;
    background: linear-gradient(135deg, #F5A623 0%, #E8941C 50%, #D48806 100%);
    border: none; border-radius: 24px; color: #fff; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    box-shadow: 0 4px 12px rgba(212,136,6,0.26), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-secondary:active { transform: scale(0.97); background: #B5740A; }
.btn-secondary:disabled { background: #E5E7EB; color: #9CA3AF; box-shadow: none; cursor: not-allowed; }

/* ===== 状态文字 ===== */
.status-text { text-align: center; font-size: 13px; color: #9ca3af; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.status-dot { display: inline-block; width: 7px; height: 7px; background: #F59E0B; border-radius: 50%; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.2); } 100% { opacity: 1; transform: scale(1); } }
.status-success { color: #16A34A !important; }
.status-success .status-dot { background: #16A34A; animation: none; }

/* ===== 充值金额按钮 ===== */
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.amount-item {
    padding: 11px 4px; text-align: center; border: 1.5px solid #D1D5DB; border-radius: 10px;
    cursor: pointer; transition: all 0.2s ease; background: #FFFFFF;
}
.amount-item.selected {
    border-color: #F59E0B; background: #FFFBEB;
    box-shadow: 0 0 0 2px rgba(245,158,11,0.12);
}
.amount-item:active { transform: scale(0.96); }
.amount-value { font-size: 17px; font-weight: 800; color: #2563EB; }

/* ===== 订单摘要行 ===== */
.order-summary {
    background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 11px;
    padding: 12px 14px; margin-bottom: 14px; font-size: 13px;
}
.summary-row { display: flex; justify-content: space-between; padding: 5px 0; color: #4b5563; border-bottom: 1px dashed #e5e7eb; }
.summary-row:last-child { border-bottom: none; }
.summary-label { color: #374151; }
.summary-value { font-weight: 600; color: #111827; }
.summary-highlight { color: #E11D48; font-weight: 800; font-size: 14px; }

/* ===== 支付方式 ===== */
.pay-methods { display: flex; gap: 12px; margin-bottom: 16px; }
.pay-method {
    flex: 1; padding: 13px; text-align: center; border: 2px solid #e5e7eb; border-radius: 12px;
    cursor: pointer; transition: all 0.2s ease; background: #fafafa;
}
.pay-method.selected { border-color: #F59E0B; background: #FFFBEB; }
.pay-method:active { transform: scale(0.97); }
.pay-method-icon { margin-bottom: 4px; display: flex; justify-content: center; }
.pay-method-name { font-size: 13px; font-weight: 600; color: #374151; }

/* ===== 收款码区域 ===== */
.qrcode-container {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 18px; background: #f9fafb; border-radius: 12px; margin-bottom: 14px;
    border: 1px solid #e5e7eb;
}
.qrcode-img { width: 200px; height: 200px; border: 2px solid #e5e7eb; border-radius: 10px; object-fit: cover; background: #fff; margin-bottom: 8px; }
.qrcode-placeholder {
    width: 200px; height: 200px; border: 2px dashed #d1d5db; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 8px;
    background: #f9fafb; color: #9ca3af; font-size: 14px; text-align: center; padding: 10px;
}
.qrcode-tip { font-size: 13px; color: #6b7280; }

/* ===== 上传截图 ===== */
.upload-area {
    display: block; /* 明确 block，避免 label 继承 inline 导致布局异常 */
    border: 2px dashed #d1d5db; border-radius: 12px; padding: 22px; text-align: center;
    cursor: pointer; transition: all 0.2s ease; background: #fafafa;
    margin-bottom: 14px; position: relative; overflow: hidden;
}
/* 真实 file input 覆盖整个上传区域，用户点击物理命中它（最原生触发，兼容荣耀等受限浏览器） */
.upload-input-overlay {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer; z-index: 1; font-size: 0;
}
.upload-area.has-image { padding: 10px; border-style: solid; border-color: #F59E0B; background: #FFFBEB; }
.upload-icon { font-size: 36px; margin-bottom: 6px; color: #d1d5db; }
.upload-text { font-size: 14px; color: #6b7280; }
.upload-preview { width: 100%; height: 160px; object-fit: contain; border-radius: 8px; display: none; background: #f9fafb; }
.upload-preview.show { display: block; }
/* 视觉隐藏但保留可点击/可触发（避免移动端 display:none 导致 .click() 失效） */
.upload-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); -webkit-clip-path: inset(50%); clip-path: inset(50%);
    white-space: nowrap; border: 0; opacity: 0;
}

/* ===== 结果页 ===== */
/* step4 默认隐藏（继承 .page-section display:none），激活时才显示为 flex 居中布局 */
.result-step.active {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: calc(100vh - 120px);
    position: relative; overflow: hidden;
}
.result-card { text-align: center; padding: 30px 18px; }
.result-icon { font-size: 52px; margin-bottom: 12px; }
.result-title { font-size: 19px; font-weight: 800; color: #1f2937; margin-bottom: 8px; }
.result-desc { font-size: 14px; color: #6b7280; line-height: 1.6; margin-bottom: 6px; }
.result-order-id {
    font-family: 'Courier New', monospace; font-size: 12px; color: #6b7280;
    background: #f3f4f6; padding: 8px 14px; border-radius: 7px; display: inline-block;
    margin-top: 12px; word-break: break-all; border: 1px solid #e5e7eb;
}

/* ===== 小点加载动画 ===== */
.dot-loader {
    display: flex; justify-content: center; align-items: center; gap: 10px;
    margin: 26px 0 14px;
}
.dot-loader .dot {
    width: 12px; height: 12px; border-radius: 50%;
    animation: dotBounce 1.2s infinite ease-in-out;
}
.dot-loader .dot:nth-child(1) { background: #D48806; animation-delay: 0s; }
.dot-loader .dot:nth-child(2) { background: #F5A623; animation-delay: 0.15s; }
.dot-loader .dot:nth-child(3) { background: #E8941C; animation-delay: 0.30s; }
.dot-loader .dot:nth-child(4) { background: #FBBF24; animation-delay: 0.45s; }
@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
    40% { transform: scale(1.05); opacity: 1; }
}
@keyframes floatSlow {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-18px) scale(1.04); }
}
.progress-text { text-align: center; font-size: 14px; color: #6b7280; margin-top: 4px; min-height: 20px; }

/* ===== Toast ===== */
.toast {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(0.85);
    background: #5B9BD5; color: #fff; padding: 13px 26px; border-radius: 10px;
    font-size: 14px; z-index: 999; opacity: 0; visibility: hidden;
    transition: all 0.25s ease;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%,-50%) scale(1); }
