* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f6f7fb;
    color: #1f2937;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.page-shell {
    min-height: 100vh;
    padding: 48px 16px 72px;
    background:
        radial-gradient(circle at top left, rgba(76, 112, 255, 0.14), transparent 24%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.1), transparent 18%),
        #f6f7fb;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #6d28d9);
    transform: rotate(45deg);
    box-shadow: 0 16px 30px rgba(59, 130, 246, 0.25);
}

.brand-text {
    font-size: 40px;
    font-weight: 700;
    color: #111827;
}

.page-subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 40px;
}

.card {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    border-radius: 28px;
    padding: 32px;
    backdrop-filter: blur(14px);
}

.card-sm {
    max-width: 560px;
}

.stepper {
    width: 100%;
    max-width: 760px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.step-dot {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 1px solid #e5e7eb;
    color: #94a3b8;
    background: #fff;
}

.step.active .step-dot,
.step.done .step-dot {
    color: #fff;
    border-color: #5865f2;
    background: #5865f2;
    box-shadow: 0 0 0 6px rgba(88, 101, 242, 0.14);
}

.step.pending .step-dot {
    color: #fff;
    background: #f59e0b;
    border-color: #f59e0b;
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.14);
}

.step.pending .step-label {
    color: #f59e0b;
    font-weight: 600;
}

.step.completed .step-dot {
    color: #fff;
    background: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.step.completed .step-label {
    color: #22c55e;
    font-weight: 600;
}

.step.exception .step-dot {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.12);
}

.step-label {
    font-size: 13px;
    color: #94a3b8;
}

.step.active .step-label,
.step.done .step-label {
    color: #5865f2;
    font-weight: 600;
}

.step.exception .step-label {
    color: #dc2626;
    font-weight: 600;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #5865f2;
    margin-bottom: 24px;
    max-width: 120px;
}

.step-line.line-exception {
    background: #dc2626;
}

.step-line.line-inactive {
    background: #e5e7eb;
}

.form-grid {
    display: grid;
    gap: 22px;
}

.field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #374151;
}

.input,
.textarea,
.select {
    width: 100%;
    border: 1px solid #d7dce5;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 15px;
    background: #fff;
    color: #111827;
    outline: none;
    transition: .2s ease;
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: #5865f2;
    box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.13);
}

.btn {
    border: 0;
    border-radius: 16px;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: .2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #5865f2, #4f46e5);
    box-shadow: 0 18px 30px rgba(79, 70, 229, 0.2);
}

.btn-secondary {
    color: #4b5563;
    background: #eef2ff;
}

.btn-danger {
    color: #fff;
    background: #ef4444;
}

.btn-success {
    color: #fff;
    background: #10b981;
}

.btn-full {
    width: 100%;
}

.inline-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.alert {
    width: 100%;
    max-width: 760px;
    margin: 0 auto 18px;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 14px;
}

.alert-error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.alert-success {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.muted {
    color: #6b7280;
    font-size: 13px;
}

.query-link {
    text-align: center;
    margin-top: 22px;
    color: #64748b;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table tr + tr td {
    border-top: 1px solid #edf2f7;
}

.detail-table td {
    padding: 16px 0;
    font-size: 15px;
}

.detail-table td:first-child {
    color: #94a3b8;
    width: 120px;
}

.detail-table td:last-child {
    text-align: right;
    color: #1f2937;
    font-weight: 600;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 18px;
}

.guide-list {
    display: grid;
    gap: 16px;
}

.guide-item {
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 18px;
    background: #fff;
}

.guide-item h3 {
    margin: 0 0 10px;
    font-size: 17px;
}

.guide-item p {
    margin: 0;
    line-height: 1.7;
    color: #4b5563;
    white-space: pre-wrap;
}

.guide-image {
    margin-top: 14px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    max-width: 480px;
}

.guide-image img {
    cursor: pointer;
}

.checkbox-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border-radius: 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.checkbox-row input {
    margin-top: 3px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-pending_recharge,
.status-processing {
    background: #eef2ff;
    color: #4f46e5;
}

.status-completed {
    background: #ecfdf5;
    color: #059669;
}

.status-exception {
    background: #fef2f2;
    color: #dc2626;
}

.exception-box {
    margin-top: 20px;
    border-radius: 18px;
    padding: 18px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: #111827;
    color: #e5e7eb;
    padding: 28px 20px;
}

.admin-brand {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
}

.admin-nav {
    display: grid;
    gap: 10px;
}

.admin-nav a {
    padding: 12px 16px;
    border-radius: 14px;
    color: #cbd5e1;
}

.admin-nav a.active,
.admin-nav a:hover {
    background: rgba(99, 102, 241, 0.16);
    color: #fff;
}

.admin-main {
    flex: 1;
    padding: 28px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.06);
}

.stat-label {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
}

.panel {
    background: #fff;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.06);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.toolbar form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 12px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.table th {
    color: #64748b;
    font-weight: 700;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 26px;
    padding: 34px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 10px;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 22px;
    padding: 28px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.modal-box h3 {
    margin: 0 0 18px;
    font-size: 18px;
}

.modal-box .form-grid {
    gap: 14px;
}

.modal-info {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #4b5563;
}

.modal-info span {
    color: #111827;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

.btn.btn-loading {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
    color: transparent;
}

.btn.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

.thumb-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
}

.thumb-img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}

.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}

.lightbox-overlay.open {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 75vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 36px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    z-index: 1001;
}

.lightbox-close:hover {
    opacity: 0.7;
}

.lightbox-controls {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

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

.code-block {
    padding: 16px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 16px;
    white-space: pre-wrap;
    font-family: Consolas, monospace;
    font-size: 13px;
}

@media (max-width: 960px) {
    .admin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-shell {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding-top: 32px;
    }

    .brand-text {
        font-size: 30px;
    }

    .card {
        padding: 22px;
        border-radius: 22px;
    }

    .stepper {
        gap: 8px;
    }

    .step {
        min-width: 64px;
    }

    .step-dot {
        width: 40px;
        height: 40px;
    }

    .step-line {
        max-width: 40px;
    }

    .detail-table td {
        display: block;
        width: 100%;
        text-align: left;
        padding: 8px 0;
    }

    .detail-table td:last-child {
        text-align: left;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-main {
        padding: 18px;
    }
}
