/* ==========================================================================
   测试支付页 · /user/test
   与官网首页同一套设计语言；无第三方框架依赖
   ========================================================================== */

:root {
    --blue-700: #0648cc;
    --blue-600: #0a5cff;
    --blue-500: #2f7bff;
    --blue-100: #dbe8ff;
    --blue-50: #eef4ff;

    --ink-900: #0b1b33;
    --ink-800: #14263f;
    --ink-700: #24364f;
    --ink-600: #3d5170;
    --ink-500: #5b6b82;
    --ink-400: #8595aa;
    --ink-300: #b3c0d0;

    --line: #e6ebf2;
    --line-soft: #eef2f7;
    --bg: #ffffff;
    --bg-soft: #f6f9fc;

    --green-600: #00a870;
    --green-50: #e8faf3;
    --red-600: #e34d59;
    --red-50: #ffeff0;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow-xs: 0 1px 2px rgba(11, 27, 51, .06);
    --shadow-sm: 0 6px 18px rgba(11, 27, 51, .07);
    --shadow-md: 0 18px 44px rgba(11, 27, 51, .1);

    --ease: cubic-bezier(.22, .61, .36, 1);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
            "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink-700);
    background:
        radial-gradient(900px 460px at 82% -12%, rgba(47, 123, 255, .13), transparent 62%),
        radial-gradient(700px 420px at 4% 6%, rgba(0, 168, 112, .07), transparent 62%),
        var(--bg-soft);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, dl, dd, dt { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

:focus-visible {
    outline: 2px solid var(--blue-600);
    outline-offset: 2px;
    border-radius: 6px;
}

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

/* ---------- header ---------- */
.tp-header {
    background: rgba(255, 255, 255, .86);
    border-bottom: 1px solid var(--line-soft);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
}
.tp-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 66px;
}
.tp-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--ink-900);
}
.tp-brand__img { height: 30px; width: auto; max-width: 190px; object-fit: contain; }
.tp-nav { display: flex; align-items: center; gap: 6px; }
.tp-nav a {
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--ink-500);
    transition: color .2s var(--ease), background-color .2s var(--ease);
}
.tp-nav a:hover { color: var(--blue-600); background: var(--blue-50); }

/* ---------- layout ---------- */
.tp-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 26px;
    align-items: start;
    padding: 36px 0 48px;
    flex: 1 0 auto;
}

/* ---------- card ---------- */
.tp-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.tp-card__head {
    padding: 26px 28px 20px;
    border-bottom: 1px solid var(--line-soft);
}
.tp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    margin-bottom: 12px;
    border: 1px solid var(--blue-100);
    border-radius: 999px;
    background: var(--blue-50);
    font-size: 12px;
    font-weight: 600;
    color: var(--blue-700);
}
.tp-badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green-600);
    box-shadow: 0 0 0 3px rgba(0, 168, 112, .14);
}
.tp-card__title {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.3px;
    color: var(--ink-900);
}
.tp-card__sub {
    margin-top: 6px;
    font-size: 13.5px;
    color: var(--ink-500);
}

/* ---------- form ---------- */
.tp-form {
    display: grid;
    gap: 18px;
    padding: 22px 28px 28px;
}
.tp-field > label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-600);
}
.tp-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink-800);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease),
                background-color .2s var(--ease);
}
.tp-input::placeholder { color: var(--ink-300); }
.tp-input:hover { border-color: var(--ink-300); }
.tp-input:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(10, 92, 255, .12);
}
.tp-input[readonly],
.tp-input:disabled {
    background: var(--bg-soft);
    color: var(--ink-500);
    cursor: default;
}
.tp-input[readonly]:hover,
.tp-input:disabled:hover { border-color: var(--line); }

.tp-money { position: relative; }
.tp-money__unit {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    font-size: 17px;
    font-weight: 700;
    color: var(--ink-400);
    pointer-events: none;
}
.tp-input--money {
    padding-left: 36px;
    height: 54px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.3px;
    font-variant-numeric: tabular-nums;
}
.tp-hint { margin-top: 6px; font-size: 12px; color: var(--ink-400); }

/* ---------- paytype ---------- */
.tp-pay {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.tp-pay .btn-group { display: block; width: 100%; }
.tp-pay .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink-800);
    text-align: center;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease),
                transform .15s var(--ease), color .2s var(--ease);
}
.tp-pay .btn:hover:not([disabled]) {
    border-color: var(--blue-500);
    color: var(--blue-600);
    box-shadow: 0 8px 18px rgba(10, 92, 255, .12);
    transform: translateY(-1px);
}
.tp-pay .btn:active:not([disabled]) { transform: translateY(0); }
.tp-pay .btn[disabled] { opacity: .62; cursor: not-allowed; }
.tp-pay .btn img,
.tp-pay .btn img[src=""] {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex: none;
}

/* ---------- states ---------- */
.tp-loading {
    grid-column: 1 / -1;
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    text-align: center;
    font-size: 13.5px;
    color: var(--ink-400);
}
.tp-empty,
.tp-error {
    grid-column: 1 / -1;
    padding: 22px 18px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: var(--bg-soft);
    text-align: center;
}
.tp-empty__title,
.tp-error__title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink-700);
}
.tp-empty__desc,
.tp-error__desc {
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--ink-400);
}
.tp-empty__retry,
.tp-error__retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-600);
    transition: border-color .2s var(--ease), color .2s var(--ease);
}
.tp-empty__retry:hover,
.tp-error__retry:hover { border-color: var(--blue-500); color: var(--blue-600); }

/* ---------- captcha ---------- */
#captcha {
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: var(--bg-soft);
}
#captcha_text {
    height: 42px;
    line-height: 42px;
    text-align: center;
    font-size: 13.5px;
    color: var(--ink-400);
}
#captcha_wait { display: none; height: 42px; }
.tp-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
}
.tp-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink-300);
    animation: tpFade 1s infinite;
}
.tp-dots i:nth-child(2) { animation-delay: .12s; }
.tp-dots i:nth-child(3) { animation-delay: .24s; }
.tp-dots i:nth-child(4) { animation-delay: .36s; }
@keyframes tpFade {
    0%, 100% { opacity: .25; }
    50% { opacity: 1; }
}

/* ---------- side ---------- */
.tp-side { display: grid; gap: 16px; }
.tp-side__card {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.tp-side__card h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-900);
}
.tp-steps {
    margin-top: 12px;
    display: grid;
    gap: 10px;
    counter-reset: step;
}
.tp-steps li {
    position: relative;
    padding-left: 26px;
    font-size: 13px;
    color: var(--ink-500);
    counter-increment: step;
}
.tp-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    color: var(--blue-700);
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}
.tp-side__card--tip {
    background: linear-gradient(180deg, #fbfdff, #f5f9ff);
    border-color: var(--blue-100);
}
.tp-side__card--tip p {
    margin-top: 8px;
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--ink-500);
}
.tp-side__links { margin-top: 14px; display: grid; gap: 8px; }
.tp-side__links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-600);
    transition: border-color .2s var(--ease), color .2s var(--ease);
}
.tp-side__links a::after { content: "→"; color: var(--ink-300); }
.tp-side__links a:hover { border-color: var(--blue-500); color: var(--blue-600); }
.tp-side__links a:hover::after { color: var(--blue-500); }

/* ---------- success ---------- */
.tp-success {
    padding: 34px 28px 32px;
    text-align: center;
}
.tp-success__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--green-50);
    color: var(--green-600);
}
.tp-success__icon svg { width: 28px; height: 28px; fill: currentColor; }
.tp-success__title {
    font-size: 20px;
    font-weight: 800;
    color: var(--ink-900);
}
.tp-success__desc { margin-top: 6px; font-size: 13.5px; color: var(--ink-500); }
.tp-success__meta {
    display: grid;
    gap: 1px;
    margin: 22px auto 0;
    max-width: 380px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
}
.tp-success__meta > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-soft);
}
.tp-success__meta dt { font-size: 12.5px; color: var(--ink-400); }
.tp-success__meta dd {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-800);
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}
.tp-success__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}
.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 128px;
    height: 44px;
    padding: 0 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink-700);
    transition: border-color .2s var(--ease), color .2s var(--ease),
                box-shadow .2s var(--ease), transform .15s var(--ease);
}
.tp-btn:hover { border-color: var(--blue-500); color: var(--blue-600); }
.tp-btn--primary {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600) 55%, var(--blue-700));
    box-shadow: 0 10px 22px rgba(10, 92, 255, .26);
}
.tp-btn--primary:hover {
    color: #fff;
    box-shadow: 0 14px 28px rgba(10, 92, 255, .34);
    transform: translateY(-1px);
}

/* ---------- footer ---------- */
.tp-footer {
    flex: none;
    padding: 18px 0 26px;
    border-top: 1px solid var(--line-soft);
}
.tp-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 18px;
    font-size: 12.5px;
    color: var(--ink-400);
}

/* ---------- toast / modal ---------- */
.tp-layer-mask {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(11, 27, 51, .42);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: tpFadeIn .18s var(--ease);
}
.tp-layer-box {
    width: 100%;
    max-width: 340px;
    padding: 22px;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-md);
    text-align: center;
    animation: tpPop .2s var(--ease);
}
.tp-layer-box__msg {
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--ink-800);
    word-break: break-word;
}
.tp-layer-box__btn {
    width: 100%;
    height: 42px;
    margin-top: 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    font-size: 14.5px;
    font-weight: 600;
    color: #fff;
}
.tp-toast {
    position: fixed;
    left: 50%;
    top: 24px;
    z-index: 1100;
    transform: translate(-50%, -12px);
    max-width: min(90vw, 420px);
    padding: 11px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-md);
    font-size: 13.5px;
    color: var(--ink-800);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.tp-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.tp-toast--error { border-color: #ffd5d8; background: #fff7f7; color: #a8323c; }
.tp-toast--ok { border-color: #c7f0e0; background: #f4fdf9; color: #06794f; }

@keyframes tpFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes tpPop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .tp-main { grid-template-columns: 1fr; padding-top: 24px; }
    .tp-side { order: 2; }
    .tp-card__head { padding: 22px 20px 18px; }
    .tp-form { padding: 20px 20px 24px; }
    .tp-card__title { font-size: 20px; }
    .tp-success { padding: 28px 20px 26px; }
}
@media (max-width: 560px) {
    .tp-pay { grid-template-columns: 1fr; }
    .tp-header__inner { height: 60px; }
    .tp-nav a { padding: 6px 9px; font-size: 13px; }
    .tp-nav a.tp-nav__doc { display: none; }
    .tp-input--money { font-size: 20px; }
    .tp-main { padding-bottom: 34px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}
