/* ============================================================
 * newGPT-PAY 用户前台样式（对标 aiee.fun 设计语言）
 * 与后台 style.css 完全隔离，仅前台 index.html 引用
 * ============================================================ */

/* ── 设计令牌 ── */
:root {
    --front-primary: #1769e0;
    --front-primary-dark: #0f4fb6;
    --front-success: #0f9f6e;
    --front-naive-green: #18a058;
    --front-naive-green-hover: #36ad6a;
    --front-naive-green-pressed: #0c7a43;
    --front-warning: #b7791f;
    --front-danger: #dc2626;
    --front-text: #172033;
    --front-muted: #69748a;
    --front-line: #dce7f8;
    --front-soft: #f5f8ff;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    background:
        radial-gradient(circle at 18% 12%, rgba(76, 139, 245, .16) 0, transparent 24%),
        radial-gradient(circle at 84% 6%, rgba(20, 184, 166, .12) 0, transparent 26%),
        linear-gradient(160deg, #f7fbff 0%, #edf4ff 44%, #f8fbff 100%);
    min-height: 100vh;
    color: var(--front-text);
    -webkit-font-smoothing: antialiased;
}

.customer-shell { min-height: 100vh; }

/* ── 顶部导航 ── */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 34px;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(220, 231, 248, .9);
    box-shadow: 0 10px 30px rgba(31, 87, 164, .06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 18px;
    color: var(--front-text);
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 17px;
    background: linear-gradient(135deg, var(--front-primary), #18b6a7);
    box-shadow: 0 8px 18px rgba(23, 105, 224, .22);
}

.top-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(15, 159, 110, .09);
    color: #087857;
    border: 1px solid rgba(15, 159, 110, .18);
    font-size: 13px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}

.top-status.rest {
    background: rgba(245, 158, 11, .10);
    border-color: rgba(245, 158, 11, .20);
    color: #92400e;
}

.top-status.rest .status-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, .13);
}

/* ── Hero ── */
.hero {
    max-width: 960px;
    margin: 0 auto;
    padding: 54px 20px 30px;
    text-align: center;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(197, 216, 252, .9);
    color: var(--front-primary);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
}

.hero h1 {
    color: var(--front-text);
    font-size: 42px;
    line-height: 1.15;
    letter-spacing: -1px;
    font-weight: 700;
    margin: 0 0 14px;
}

.hero p {
    max-width: 640px;
    margin: 0 auto 24px;
    color: var(--front-muted);
    line-height: 1.8;
    font-size: 16px;
}

.hero-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(197, 216, 252, .95);
    background: rgba(255, 255, 255, .75);
    box-shadow: 0 8px 18px rgba(31, 87, 164, .05);
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}

.hero-status-line {
    margin-top: 14px;
}

.hero-avg-time {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(26, 111, 232, .08);
    color: #0f4fb8;
    font-size: 13px;
    font-weight: 700;
}

.hero-avg-time small {
    color: #5d6b86;
    font-size: 12px;
    font-weight: 500;
}

.hero-pause-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: min(680px, calc(100% - 24px));
    padding: 7px 12px;
    color: #92400e;
    background: rgba(245, 158, 11, .10);
    border: 1px solid rgba(245, 158, 11, .18);
    border-radius: 12px;
    text-align: left;
}

.hero-pause-status-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    background: #f59e0b;
    border-radius: 50%;
}

.hero-pause-status-copy {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.hero-pause-status-copy strong { font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.hero-pause-status-copy small { color: #a16207; font-size: 12px; font-weight: 500; line-height: 1.45; }

/* ── 主卡片 ── */
.page-wrap {
    max-width: 920px;
    margin: 0 auto 48px;
    padding: 0 16px;
}

.main-card {
    background: #fff;
    border-radius: 22px;
    border: 1px solid rgba(220, 231, 248, .95);
    box-shadow: 0 18px 48px rgba(31, 87, 164, .12);
    overflow: hidden;
}

/* ── Tabs ── */
.front-tabs {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 0 16px;
    background: rgba(248, 251, 255, .96);
    border-bottom: 1px solid var(--front-line);
}

.front-tab {
    position: relative;
    padding: 15px 20px 17px;
    font-size: 15px;
    font-weight: 500;
    color: #4b5568;
    cursor: pointer;
    user-select: none;
    transition: color .2s;
    white-space: nowrap;
}

.front-tab:hover { color: var(--front-text); }

.front-tab.active {
    color: var(--front-naive-green);
    font-weight: 600;
}

.front-tab.active::after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 0;
    height: 3px;
    border-radius: 999px;
    background: var(--front-naive-green);
}

/* ── 面板容器 ── */
.front-pane { display: none; background: #fff; }
.front-pane.active { display: block; }

/* ── 步骤条 ── */
.steps-bar {
    display: flex;
    justify-content: center;
    padding: 28px 28px 22px;
    background: linear-gradient(180deg, #fbfdff, #f7faff);
    border-bottom: 1px solid #f0f4fd;
}

.steps-inner {
    display: flex;
    align-items: flex-start;
    width: 100%;
    max-width: 560px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #eef2f8;
    color: #9ca3af;
    border: 2px solid #e5ecf7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all .3s;
}

.step-circle.active {
    background: var(--front-primary);
    border-color: var(--front-primary);
    color: #fff;
    box-shadow: 0 0 0 5px rgba(26, 111, 232, .15);
}

.step-circle.done {
    background: var(--front-primary);
    border-color: var(--front-primary);
    color: #fff;
}

.step-connector {
    flex: 1;
    height: 2px;
    min-width: 20px;
    max-width: 80px;
    margin-top: 18px;
    background: #e3ebf7;
    transition: background .3s;
}

.step-connector.done { background: var(--front-primary); }

.step-label {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    margin-top: 6px;
    text-align: center;
    white-space: nowrap;
}

.step-label.active { color: var(--front-primary); font-weight: 600; }

/* ── 表单区 ── */
.form-section { padding: 28px 38px 36px; }

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.section-head h3 {
    margin: 0 0 7px;
    font-size: 20px;
    color: var(--front-text);
    font-weight: 600;
}

.section-head p {
    margin: 0;
    color: var(--front-muted);
    font-size: 13px;
    line-height: 1.7;
}

.section-pill {
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--front-primary);
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #d8e8ff;
}

.form-item { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 14px;
    color: #333639;
    margin-bottom: 8px;
}

.form-label .req {
    color: #d03050;
    margin-left: 4px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0 12px;
    height: 34px;
    font-size: 14px;
    font-family: inherit;
    color: var(--front-text);
    background: #fff;
    border: 1px solid #e0e0e6;
    border-radius: 8px;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.form-textarea {
    height: auto;
    min-height: 140px;
    padding: 10px 12px;
    line-height: 1.6;
    resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder { color: #b6bcc8; }

.form-input:focus,
.form-textarea:focus {
    border-color: var(--front-naive-green);
    box-shadow: 0 0 0 2px rgba(24, 160, 88, .12);
}

.input-hint {
    font-size: 12px;
    color: var(--front-muted);
    margin-top: 6px;
    line-height: 1.6;
}

.input-hint.err { color: #d03050; }
.input-hint.ok { color: var(--front-success); }

/* ── 提示条 ── */
.trust-note,
.warning-note {
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 13px;
    line-height: 1.65;
    margin: 0 0 16px;
}

.trust-note {
    background: #f7fbff;
    border: 1px solid #dce9fb;
    color: #52627a;
}

.warning-note {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #8a5a12;
}

/* ── 按钮 ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, border-color .18s, color .18s, transform .18s;
    outline: none;
}

.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-block { width: 100%; }

.btn-lg {
    height: 44px;
    border-radius: 13px;
    padding: 0 18px;
}

.btn-primary {
    background: var(--front-naive-green);
    border-color: var(--front-naive-green);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--front-naive-green-hover);
    border-color: var(--front-naive-green-hover);
}

.btn-primary:active:not(:disabled) { background: var(--front-naive-green-pressed); }

.btn-default {
    background: #fff;
    border-color: #d9dde5;
    color: var(--front-text);
}

.btn-default:hover:not(:disabled) {
    border-color: var(--front-naive-green);
    color: var(--front-naive-green);
}

.btn .spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    animation: btn-spin .7s linear infinite;
    display: none;
}

.btn.is-loading .spinner { display: inline-block; }

@keyframes btn-spin { to { transform: rotate(360deg); } }

.button-row {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.grow-btn { flex: 1; }

/* ── 信息盒 ── */
.info-box {
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid #dce8fb;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px dashed #dde8f8;
}

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

.info-label { color: var(--front-muted); }

.info-val {
    font-weight: 600;
    color: var(--front-text);
    text-align: right;
    max-width: 62%;
    word-break: break-all;
}

.info-val.blue { color: var(--front-primary); font-weight: 500; }
.info-val.success-text { color: var(--front-success); }
.txt-mono { font-family: 'SFMono-Regular', Consolas, 'Courier New', monospace; font-size: 13px; }

/* ── 等待处理区（第 4 步） ── */
.recharge-wait-section {
    padding: 30px 38px 36px;
    color: #10213b;
}

.wait-hero {
    position: relative;
    min-height: 210px;
    padding: 30px 28px 28px 184px;
    overflow: hidden;
    border: 1px solid #dbe8fb;
    border-radius: 22px;
    background: linear-gradient(135deg, #f9fcff 0%, #f2f7ff 62%, #eefbf8 100%);
}

.wait-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -95px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: rgba(26, 111, 232, .055);
}

.wait-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #1670df;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .15em;
}

.wait-hero h3 {
    margin: 0 0 10px;
    color: #10213b;
    font-size: 25px;
    line-height: 1.3;
}

.wait-hero p {
    position: relative;
    z-index: 1;
    max-width: 530px;
    margin: 0;
    color: #60708a;
    font-size: 14px;
    line-height: 1.75;
}

.wait-time {
    display: inline-flex;
    align-items: center;
    margin-top: 17px;
    padding: 6px 11px;
    color: #1871d9;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #d5e6fb;
    border-radius: 999px;
    background: rgba(255, 255, 255, .88);
}

.wait-orbit {
    position: absolute;
    left: 42px;
    top: 39px;
    width: 110px;
    height: 110px;
    border: 1px solid rgba(26, 111, 232, .20);
    border-radius: 50%;
    animation: wait-orbit-spin 7s linear infinite;
}

.wait-orbit::before,
.wait-orbit::after {
    content: "";
    position: absolute;
    inset: 13px;
    border: 1px dashed rgba(15, 164, 118, .26);
    border-radius: 50%;
}

.wait-orbit::after {
    inset: 27px;
    border-style: solid;
    border-color: rgba(26, 111, 232, .15);
}

.wait-orbit-core {
    position: absolute;
    inset: 36px;
    z-index: 2;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a6fe8, #0aa77c);
    box-shadow: 0 8px 25px rgba(26, 111, 232, .24);
    animation: wait-orbit-counter 7s linear infinite;
}

.wait-orbit i {
    position: absolute;
    width: 9px;
    height: 9px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #1a6fe8;
    box-shadow: 0 2px 9px rgba(26, 111, 232, .3);
}

.wait-orbit i:nth-of-type(1) { left: 3px; top: 49px; }
.wait-orbit i:nth-of-type(2) { right: 14px; top: 12px; background: #0aa77c; }
.wait-orbit i:nth-of-type(3) { right: 8px; bottom: 20px; background: #7c8da8; }

.wait-orbit.stopped,
.wait-orbit.stopped .wait-orbit-core { animation: none; }

.wait-hero.is-success .wait-orbit-core { background: #0aa77c; }
.wait-hero.is-failed .wait-orbit-core { background: #e05252; }

@keyframes wait-orbit-spin { to { transform: rotate(360deg); } }
@keyframes wait-orbit-counter { to { transform: rotate(-360deg); } }

.wait-progress {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 22px 0;
    padding: 23px 18px 20px;
    border: 1px solid #e1e9f5;
    border-radius: 18px;
    background: #fff;
}

.wait-progress::before {
    content: "";
    position: absolute;
    top: 41px;
    left: 13%;
    right: 13%;
    height: 2px;
    background: #e1e9f5;
}

.wait-progress-node {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.wait-node-dot {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 9px;
    color: #8a9ab1;
    font-weight: 800;
    border: 6px solid #fff;
    border-radius: 50%;
    background: #edf2f8;
    box-sizing: content-box;
}

.wait-progress-node.done .wait-node-dot,
.wait-progress-node.active .wait-node-dot {
    color: #fff;
    background: #1a6fe8;
    box-shadow: 0 0 0 4px rgba(26, 111, 232, .10);
}

.wait-progress-node.active .wait-node-dot {
    background: #0aa77c;
    animation: wait-node-pulse 1.8s ease-out infinite;
}

.wait-progress.failed .wait-progress-node.active .wait-node-dot { background: #e05252; }

.wait-progress-node strong { color: #31415b; font-size: 13px; }
.wait-progress-node small { margin-top: 3px; color: #91a0b5; font-size: 11px; }

@keyframes wait-node-pulse {
    70% { box-shadow: 0 0 0 10px rgba(10, 167, 124, 0); }
    100% { box-shadow: 0 0 0 0 rgba(10, 167, 124, 0); }
}

.wait-order-card {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 1px;
    overflow: hidden;
    border: 1px solid #e1e9f5;
    border-radius: 15px;
    background: #e1e9f5;
}

.wait-order-card > div { min-width: 0; padding: 13px 15px; background: #f9fbfe; }
.wait-order-card > div:last-child:nth-child(4) { grid-column: 1 / -1; }
.wait-order-card span { display: block; margin-bottom: 4px; color: #8b99ad; font-size: 11px; }
.wait-order-card b { display: block; overflow-wrap: anywhere; color: #25354d; font-size: 13px; }

.recharge-wait-section .result-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 12px;
}

.wait-safe-tip { color: #8492a7; font-size: 12px; }

/* ── 查询 / 账单 / 教程面板 ── */
.pane-section { padding: 28px 38px 36px; }

.result-section { text-align: left; }

.result-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    border: 1px solid #dce8fb;
    background: #f8fbff;
    font-size: 14px;
    color: #31415b;
}

.result-banner.success { border-color: #bfe9d9; background: #f0fbf7; color: #0c7a56; }
.result-banner.failed { border-color: #f6cccc; background: #fff5f5; color: #b42323; }
.result-banner.pending { border-color: #dbe8fb; background: #f8fbff; color: #245a9c; }

.result-banner-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    font-weight: 800;
    background: #1a6fe8;
}

.result-banner.success .result-banner-icon { background: #0aa77c; }
.result-banner.failed .result-banner-icon { background: #e05252; }

.tutorial-steps {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.tutorial-step {
    display: flex;
    gap: 12px;
    padding: 13px 15px;
    border: 1px solid #e3ebf8;
    border-radius: 14px;
    background: #fbfdff;
    font-size: 13.5px;
    line-height: 1.7;
    color: #3c4a5e;
}

.tutorial-step b {
    flex: 0 0 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eef5ff;
    color: var(--front-primary);
    font-size: 12px;
}

/* ── 页脚 ── */
.site-footer {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    color: #8a97aa;
    font-size: 12px;
}

.footer-dot { color: #c1cad8; }

/* ── Toast ── */
#toast-root {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
}

.toast {
    padding: 10px 22px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 6px 22px rgba(0, 0, 0, .18);
    background: #3498db;
    max-width: 80vw;
    animation: toast-in .25s ease;
}

.toast.success { background: var(--front-naive-green); }
.toast.error { background: #d03050; }
.toast.warning { background: #f0a020; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── 本地预览提示条（file:// 打开时显示） ── */
.preview-banner {
    background: #fff7e6;
    border-bottom: 1px solid #fde68a;
    color: #8a5a12;
    font-size: 12.5px;
    text-align: center;
    padding: 9px 14px;
    line-height: 1.6;
}

.preview-banner b { font-weight: 700; }

/* ── 工具类 ── */
.hidden { display: none !important; }
.mb-16 { margin-bottom: 16px; }

/* ── 响应式 ── */
@media (max-width: 700px) {
    .top-header { padding: 0 16px; height: 58px; }
    .top-logo { font-size: 16px; }

    .hero { padding: 32px 16px 24px; }
    .hero h1 { font-size: 28px; letter-spacing: -.5px; }
    .hero p { font-size: 14px; }

    .front-tab { padding: 13px 8px 15px; font-size: 14px; }
    .front-tab.active::after { left: 8px; right: 8px; }

    .form-section,
    .pane-section,
    .recharge-wait-section { padding: 22px 18px 28px; }

    .section-head { flex-direction: column; }

    .wait-hero { padding: 150px 20px 24px; }
    .wait-orbit { left: 50%; top: 26px; transform: translateX(-50%); }
    .wait-orbit { animation: none; }
    .wait-orbit .wait-orbit-core { animation: none; }

    .wait-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 0; }
    .wait-progress::before { display: none; }

    .wait-order-card { grid-template-columns: 1fr; }

    .button-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .btn-lg { height: 46px; }

    .info-val { max-width: 55%; }
}
