* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* 与 nPlayer 领奖页一致的科技风配色 */
    --tech-cyan: #00d4ff;
    --tech-blue: #0088ff;
    --tech-glow: rgba(0, 212, 255, 0.45);
    --tech-border: rgba(0, 200, 255, 0.35);
    --tech-bg-deep: #060a12;
    --tech-bg-panel: rgba(8, 16, 28, 0.92);
    --tech-text: #e8f4ff;
    --tech-label: #7a9bb8;
    --tech-input-bg: rgba(4, 12, 24, 0.85);
    --tech-input-border: rgba(0, 180, 220, 0.25);
    --primary-color: #00d4ff;
    --secondary-color: #0088ff;
    --danger-color: #ff6b7a;
    --warning-color: #00d4ff;
    --text-color: var(--tech-text);
    --border-color: var(--tech-border);
    --shadow: 0 0 32px rgba(0, 100, 200, 0.12);
    --shadow-hover: 0 0 24px rgba(0, 200, 255, 0.25);
    --touch-min: 44px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--tech-bg-deep);
    background-image:
        linear-gradient(rgba(0, 200, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 200, 255, 0.04) 1px, transparent 1px),
        radial-gradient(ellipse 70% 50% at 50% -20%, rgba(0, 136, 255, 0.18) 0%, transparent 55%),
        linear-gradient(165deg, #060a12 0%, #0a1420 50%, #0d1a2d 100%);
    background-size: 28px 28px, 28px 28px, 100% 100%, 100% 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(12px, var(--safe-top)) max(12px, var(--safe-right)) max(16px, var(--safe-bottom)) max(12px, var(--safe-left));
    color: var(--tech-text);
    touch-action: manipulation;
    overflow-x: hidden;
}

.container {
    max-width: 560px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInDown 0.6s ease;
}

.header h1 {
    font-size: clamp(1.35rem, 5vw, 2rem);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--tech-text);
    text-shadow: 0 0 18px rgba(0, 212, 255, 0.4);
}

.header .subtitle {
    font-size: clamp(0.85rem, 3vw, 1rem);
    color: var(--tech-label);
}

.charge-form {
    background: var(--tech-bg-panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--tech-border);
    border-radius: 12px;
    padding: clamp(16px, 4vw, 30px);
    box-shadow: var(--shadow);
    animation: fadeInUp 0.6s ease;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--tech-label);
}

.form-group label .icon {
    margin-right: 6px;
    font-size: 1.1rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--tech-input-border);
    border-radius: 8px;
    font-size: 16px;
    min-height: var(--touch-min);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background: var(--tech-input-bg);
    color: var(--tech-text);
}

.form-control::placeholder {
    color: #5a7a94;
}

.form-control:focus {
    border-color: var(--tech-cyan);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
}

.form-control:disabled {
    background: rgba(4, 12, 24, 0.5);
    color: #5a7a94;
    cursor: not-allowed;
    opacity: 0.85;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
    min-width: 0;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    outline: none;
    min-height: var(--touch-min);
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #0088ff 100%);
    border: 1px solid rgba(0, 229, 255, 0.55);
    box-shadow: 0 0 18px rgba(0, 200, 255, 0.35);
    color: #041018;
    flex-shrink: 0;
}

.btn-primary:hover {
    box-shadow: 0 0 24px rgba(0, 200, 255, 0.5);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: rgba(4, 12, 24, 0.85);
    border: 1px solid var(--tech-input-border);
    color: var(--tech-label);
}

.btn-secondary:hover {
    border-color: var(--tech-cyan);
    color: var(--tech-text);
}

.btn-charge {
    width: 100%;
    background: linear-gradient(135deg, #00d4ff 0%, #0088ff 100%);
    border: 1px solid rgba(0, 229, 255, 0.55);
    box-shadow: 0 0 18px rgba(0, 200, 255, 0.35);
    color: #041018;
    font-size: 1.1rem;
    padding: 14px;
    position: relative;
    min-height: 48px;
}

.btn-charge:active:not(:disabled) {
    transform: scale(0.99);
}

.btn-charge:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.product-desc-box {
    padding: 12px 16px;
    border: 1px solid var(--tech-input-border);
    border-radius: 8px;
    background: rgba(4, 12, 24, 0.6);
    min-height: 72px;
    max-height: 160px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.captcha-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.captcha-input {
    flex: 1 1 120px;
    min-width: 0;
    font-size: 16px;
    min-height: var(--touch-min);
}

.captcha-img {
    height: 48px;
    min-width: 130px;
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 2px solid #00c8ff;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.25s ease;
    background: #ffffff;
    object-fit: contain;
    box-shadow: 0 0 12px rgba(0, 200, 255, 0.25);
}

.captcha-img:active {
    transform: scale(0.98);
}

.btn-refresh {
    padding: 12px 16px;
    white-space: nowrap;
}

.captcha-tip {
    display: block;
    margin-top: 6px;
    color: #5a8aaa;
    font-size: 0.82rem;
}

.product-desc-text {
    color: var(--tech-text);
    line-height: 1.7;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.92rem;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--tech-input-bg);
    background-image: none;
    padding-right: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    cursor: pointer;
    color: var(--tech-text);
}

/* 下拉框外层：箭头用伪元素，避免 background 平铺盖住文字 */
.select-wrap {
    position: relative;
    width: 100%;
}

.select-wrap::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--tech-cyan);
    pointer-events: none;
    z-index: 1;
}

select.form-control option {
    padding: 10px;
    white-space: normal;
    background: #0a1420;
    color: var(--tech-text);
}

.product-price-tag {
    margin-top: 6px;
    font-size: 0.88rem;
    color: var(--tech-cyan);
    font-weight: 600;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.payment-option {
    padding: 16px 12px;
    border: 1px solid var(--tech-input-border);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    background: rgba(4, 12, 24, 0.85);
    min-height: var(--touch-min);
    user-select: none;
}

.payment-option:hover {
    border-color: var(--tech-cyan);
    box-shadow: 0 0 12px rgba(0, 200, 255, 0.2);
}

.payment-option:active {
    transform: scale(0.98);
}

.payment-option.selected {
    border-color: var(--tech-cyan);
    background: rgba(0, 212, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15), 0 0 16px rgba(0, 200, 255, 0.2);
}

.payment-icon {
    font-size: 2rem;
    margin-bottom: 6px;
}

.payment-option span {
    display: block;
    font-weight: 600;
    color: var(--tech-text);
    font-size: 0.95rem;
}

/* 可折叠充值说明 */
.charge-notice {
    margin-top: 20px;
    padding: 14px 16px;
    background: rgba(4, 12, 24, 0.6);
    border-radius: 8px;
    border-left: 3px solid var(--tech-cyan);
    border: 1px solid var(--tech-input-border);
    border-left: 3px solid var(--tech-cyan);
}

.charge-notice summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--tech-text);
    list-style: none;
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
}

.charge-notice summary::-webkit-details-marker {
    display: none;
}

.charge-notice summary::before {
    content: '▸';
    margin-right: 8px;
    transition: transform 0.2s ease;
}

.charge-notice[open] summary::before {
    transform: rotate(90deg);
}

.charge-notice ul {
    list-style-position: inside;
    color: var(--tech-label);
    margin-top: 10px;
}

.charge-notice li {
    margin-bottom: 6px;
    line-height: 1.55;
    font-size: 0.9rem;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--tech-label);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(2, 6, 12, 0.75);
    animation: fadeIn 0.25s ease;
    padding: max(12px, var(--safe-top)) max(12px, var(--safe-right)) max(12px, var(--safe-bottom)) max(12px, var(--safe-left));
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--tech-bg-panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--tech-border);
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0, 100, 200, 0.2);
    animation: slideIn 0.25s ease;
    -webkit-overflow-scrolling: touch;
}

.modal-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--tech-input-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--tech-bg-panel);
    z-index: 1;
}

.modal-header h3 {
    margin: 0;
    color: var(--tech-text);
    font-size: 1.05rem;
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: var(--tech-label);
    cursor: pointer;
    line-height: 1;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: var(--tech-cyan);
}

.modal-body {
    padding: 16px 18px;
}

.modal-body p {
    margin-bottom: 10px;
    line-height: 1.6;
    color: var(--tech-text);
    font-size: 0.95rem;
}

.modal-body .highlight {
    color: var(--danger-color);
    font-weight: 600;
}

.modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--tech-input-border);
    text-align: right;
}

.modal-footer .btn {
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ========== 桌面网页（宽屏） ========== */
@media (min-width: 769px) {
    body {
        padding: 32px 20px;
    }

    .header {
        margin-bottom: 28px;
    }

    .charge-form {
        padding: 32px 28px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .input-group {
        flex-direction: row;
    }

    .input-group .btn-primary {
        width: auto;
        min-width: 110px;
    }

    .captcha-group {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
    }

    .captcha-input {
        flex: 0 1 180px;
        max-width: 200px;
    }

    .captcha-img {
        width: auto;
        height: 48px;
    }

    .btn-refresh {
        width: auto;
    }

    .payment-methods {
        gap: 16px;
    }

    .modal-footer .btn {
        width: auto;
        min-width: 120px;
    }
}

/* ========== 手机竖屏 ========== */
@media (max-width: 768px) {
    body {
        padding: max(10px, var(--safe-top)) 10px max(14px, var(--safe-bottom));
    }

    .header {
        margin-bottom: 14px;
    }

    .charge-form {
        padding: 16px 14px;
        border-radius: 12px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group .btn-primary {
        width: 100%;
    }

    .payment-methods {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .payment-option {
        padding: 14px 10px;
    }

    .captcha-group {
        flex-direction: column;
        align-items: stretch;
    }

    .captcha-input {
        flex: 1 1 auto;
        width: 100%;
    }

    .captcha-img {
        width: 100%;
        max-width: 100%;
        height: 52px;
    }

    .btn-refresh {
        width: 100%;
    }

    .product-desc-box {
        max-height: 120px;
    }
}

/* ========== 手机横屏 / 矮视口（仅小屏，不影响桌面网页） ========== */
@media (max-width: 768px) and (max-height: 520px),
       (max-width: 768px) and (orientation: landscape) and (max-height: 600px) {
    body {
        padding: 6px 10px;
    }

    .header {
        margin-bottom: 8px;
    }

    .header h1 {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .header .subtitle {
        display: none;
    }

    .charge-form {
        padding: 12px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .form-group label {
        margin-bottom: 4px;
        font-size: 0.88rem;
    }

    .payment-methods {
        grid-template-columns: 1fr 1fr;
    }

    .payment-icon {
        font-size: 1.5rem;
        margin-bottom: 2px;
    }

    .charge-notice {
        margin-top: 10px;
        padding: 10px 12px;
    }
}

/* ========== 游戏内嵌模式（WebView / iframe） ========== */
body.is-embed {
    background: transparent;
    background-image: none;
    padding: 0;
    min-height: auto;
    overflow: hidden;
}

body.is-embed .container {
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

body.is-embed .header {
    margin-bottom: 0;
    padding: 10px 12px 8px;
    background: transparent;
    border-radius: 0;
}

body.is-embed .header h1 {
    font-size: 1.05rem;
    letter-spacing: 1px;
}

body.is-embed .header .subtitle {
    display: none;
}

body.is-embed .charge-form {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100dvh - 48px);
    max-height: calc(100vh - 48px);
    border-radius: 12px;
    padding: 12px;
    margin: 0;
}

/* 嵌入 + 横屏：更紧凑 */
body.is-embed.is-landscape .header h1 {
    font-size: 0.95rem;
}

body.is-embed.is-landscape .charge-form {
    padding: 10px;
}

body.is-embed.is-landscape .form-group {
    margin-bottom: 8px;
}

body.is-embed.is-landscape .payment-methods {
    grid-template-columns: 1fr 1fr;
}

body.is-embed.is-landscape .input-group {
    flex-direction: row;
}

body.is-embed.is-landscape .input-group .btn-primary {
    width: auto;
    min-width: 96px;
}

body.is-embed.is-landscape .captcha-group {
    flex-direction: row;
    flex-wrap: wrap;
}

body.is-embed.is-landscape .captcha-img {
    width: auto;
    flex: 0 0 140px;
}

body.is-embed.is-landscape .btn-refresh {
    width: auto;
}

/* 嵌入模式下隐藏大标题（游戏自带标题栏） */
body.is-embed.hide-header .header {
    display: none;
}

body.is-embed.hide-header .charge-form {
    border-radius: 12px;
    max-height: 100dvh;
}

/* 超窄屏（小 WebView） */
@media (max-width: 380px) {
    .payment-methods {
        grid-template-columns: 1fr;
    }

    body.is-embed .payment-methods {
        grid-template-columns: 1fr 1fr;
    }
}

/* 充值页客服入口 */
.support-entry {
    margin: 0 0 18px;
}

.support-entry a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 12px 16px;
    border: 1px solid var(--tech-input-border);
    border-radius: 8px;
    background: rgba(4, 12, 24, 0.6);
    color: var(--tech-text);
    text-decoration: none;
}

.support-entry a:hover,
.support-entry a:focus-visible {
    border-color: var(--tech-cyan);
    box-shadow: 0 0 16px rgba(0, 200, 255, 0.14);
}

.support-entry span {
    color: var(--tech-label);
    font-size: 0.9rem;
}

.support-entry strong {
    color: var(--tech-cyan);
    white-space: nowrap;
    font-size: 0.95rem;
}