/* ============================================
   金币充值系统 · 全站样式
   PHP 5.4 兼容 · 全端自适应
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #4f46e5;
    --primary-dark: #1e3a8a;
    --wechat: #09bb07;
    --alipay: #1677ff;
    --danger: #dc2626;
    --success: #10b981;
    --warning: #f59e0b;
    --gold: #f59e0b;
    --bg: linear-gradient(135deg, #f5f7fb 0%, #e8ecf5 100%);
    --radius: 16px;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(30,58,138,0.08);
    --shadow-lg: 0 20px 50px rgba(30,58,138,0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    color: #1f2937;
    padding: 40px 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

.container { max-width: 560px; margin: 0 auto; }

/* ============================================
   Hero 顶部
   ============================================ */
.hero { text-align: center; margin-bottom: 28px; }
.hero-icon {
    font-size: 52px;
    margin-bottom: 10px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}
.hero h1 {
    font-size: 30px;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}
.hero .subtitle {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 0;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ============================================
   Card 卡片
   ============================================ */
.card {
    background: #fff;
    border-radius: 22px;
    padding: 36px 32px;
    box-shadow: var(--shadow-lg), 0 2px 8px rgba(0,0,0,0.04);
    animation: cardIn .4s ease;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   表单
   ============================================ */
.field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}
.min-hint {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 6px;
}

.big-input {
    width: 100%;
    height: 56px;
    padding: 0 20px;
    font-size: 17px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
    outline: none;
    transition: all .2s;
    margin-bottom: 18px;
    font-family: inherit;
    color: #1f2937;
}
.big-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79,70,229,0.12);
    transform: scale(1.01);
}
.big-input::placeholder { color: #cbd5e1; }

/* ============================================
   按钮
   ============================================ */
.btn {
    display: inline-block;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all .2s;
    font-family: inherit;
    line-height: 1.4;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 8px 20px rgba(79,70,229,0.3);
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(79,70,229,0.4);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left .6s;
}
.btn-primary:hover::after { left: 100%; }

.btn-lg { height: 58px; font-size: 17px; border-radius: 14px; }

.btn-ghost {
    background: transparent;
    border: 2px solid #e5e7eb;
    color: #4b5563;
    padding: 10px 20px;
    font-size: 14px;
}
.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f5f3ff;
}
.btn-ghost:active { transform: scale(0.97); }

/* ============================================
   支付方式卡片
   ============================================ */
.pay-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}
.pay-method {
    position: relative;
    padding: 20px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    user-select: none;
}
.pay-method:hover {
    border-color: #c7d2fe;
    transform: translateY(-2px);
}
.pay-method input { display: none; }
.pay-method .pay-icon { margin-bottom: 8px; }
.pay-method .pay-name {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
}
.pay-method .pay-check {
    position: absolute;
    top: 8px; right: 10px;
    width: 22px; height: 22px;
    line-height: 22px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.5);
    transition: all .2s;
}
.pay-method.active .pay-check { opacity: 1; transform: scale(1); }

.pay-method.wechat.active {
    border-color: var(--wechat);
    background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
    box-shadow: 0 8px 22px rgba(9,187,7,0.15);
}
.pay-method.wechat.active .pay-check { background: var(--wechat); }
.pay-method.wechat.active .pay-name { color: var(--wechat); }

.pay-method.alipay.active {
    border-color: var(--alipay);
    background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
    box-shadow: 0 8px 22px rgba(22,119,255,0.15);
}
.pay-method.alipay.active .pay-check { background: var(--alipay); }
.pay-method.alipay.active .pay-name { color: var(--alipay); }

/* ============================================
   金额选择区
   ============================================ */
.amount-picker { margin-bottom: 6px; }

.amount-input-wrap {
    display: flex;
    align-items: center;
    height: 66px;
    padding: 0 20px;
    border: 2px solid var(--primary);
    border-radius: 16px;
    background: linear-gradient(180deg, #f8faff 0%, #fff 100%);
    box-shadow: 0 6px 20px rgba(79,70,229,0.12);
    transition: all .2s;
    margin-bottom: 12px;
}
.amount-input-wrap:focus-within {
    box-shadow: 0 8px 24px rgba(79,70,229,0.22);
    transform: translateY(-1px);
}
.amount-prefix {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin-right: 8px;
}
.amount-input-wrap input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-dark);
    background: transparent;
    min-width: 0;
    font-family: inherit;
}
.amount-input-wrap input::placeholder {
    color: #cbd5e1;
    font-weight: 500;
    font-size: 16px;
}
.amount-suffix {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
    white-space: nowrap;
    padding: 5px 12px;
    background: #fffbeb;
    border-radius: 20px;
    margin-left: 10px;
}

/* 快捷金额 */
.quick-amounts {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}
.qa-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 64px;
    padding: 8px 4px;
    border: 2px solid #e5e7eb;
    background: #fff;
    border-radius: 14px;
    cursor: pointer;
    transition: all .18s;
    font-family: inherit;
}
.qa-btn:hover {
    border-color: #c7d2fe;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79,70,229,0.1);
}
.qa-btn.active {
    border-color: var(--primary);
    background: linear-gradient(180deg, #eef2ff 0%, #fff 100%);
    box-shadow: 0 8px 20px rgba(79,70,229,0.18);
}
.qa-btn.active .qa-amount { color: var(--primary); }
.qa-btn:active { transform: scale(0.97); }

.qa-amount {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.1;
}
.qa-amount small {
    font-size: 12px;
    font-weight: 500;
    margin-left: 2px;
}
.qa-coins {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 3px;
    font-weight: 500;
}
.qa-gift {
    font-size: 11px;
    color: var(--gold);
    margin-top: 3px;
    font-weight: 700;
    background: #fffbeb;
    padding: 1px 8px;
    border-radius: 8px;
}
.qa-best {
    position: absolute;
    top: -8px; right: -6px;
    background: linear-gradient(135deg, #f59e0b, #dc2626);
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(220,38,38,0.3);
    z-index: 2;
}

/* 金额汇总 */
.amount-summary {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #a7f3d0;
    border-radius: 14px;
    padding: 16px 20px;
    margin-top: 4px;
    animation: summaryIn .3s;
}
@keyframes summaryIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.summary-label {
    font-size: 14px;
    color: #065f46;
    font-weight: 600;
}
.summary-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--success);
}
.summary-gift {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dashed #a7f3d0;
    font-size: 13px;
    color: var(--gold);
    font-weight: 700;
}
.summary-gift #giftCoins { font-size: 15px; }
.summary-next {
    margin-top: 10px;
    font-size: 12px;
    color: #047857;
    text-align: center;
    background: #fff;
    padding: 8px 12px;
    border-radius: 10px;
}
.summary-next strong { color: var(--danger); }

/* ============================================
   提示框
   ============================================ */
.notice {
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    margin: 18px 0;
    border-left: 5px solid;
}
.notice.warning {
    background: #fef3c7;
    border-color: var(--warning);
    color: #92400e;
}
.notice.danger {
    background: #fee2e2;
    border-color: var(--danger);
    color: #991b1b;
}
.notice.success {
    background: #d1fae5;
    border-color: var(--success);
    color: #065f46;
}
.notice.info {
    background: #dbeafe;
    border-color: var(--alipay);
    color: #1e40af;
}
.notice.primary-tip {
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border-color: var(--primary);
    color: #3730a3;
    text-align: center;
    font-size: 15px;
    line-height: 1.7;
    padding: 18px 20px;
}
.notice.primary-tip strong { color: var(--primary); font-size: 16px; }

.note-name {
    display: inline-block;
    font-size: 26px;
    font-weight: 800;
    color: var(--danger);
    letter-spacing: 2px;
    margin: 6px 0;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    background: #fff;
    border: 1px solid var(--warning);
    color: #b45309;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}
.copy-btn:hover { background: var(--warning); color: #fff; }
.copy-btn:active { transform: scale(0.96); }

/* ============================================
   支付页
   ============================================ */
.pay-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}
.coins-hint {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}
.coins-hint strong {
    color: var(--gold);
    font-size: 16px;
    font-weight: 800;
}
.gift-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    background: #fef3c7;
    color: #b45309;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}
.countdown {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 14px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all .3s;
}

.qr-box { text-align: center; margin: 20px 0; }
.qr-box img {
    width: 250px;
    height: 250px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    object-fit: contain;
    background: #fff;
    transition: transform .3s;
}
.qr-box img:hover { transform: scale(1.03); }

/* ============================================
   状态条
   ============================================ */
.status {
    text-align: center;
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    background: #f3f4f6;
    color: #6b7280;
    margin-top: 18px;
    transition: all .3s;
}
.status.done {
    background: #d1fae5;
    color: #065f46;
    animation: successPop .5s ease;
}
.status.cancel { background: #fee2e2; color: #991b1b; }
@keyframes successPop {
    0%   { transform: scale(0.9); }
    50%  { transform: scale(1.04); }
    100% { transform: scale(1); }
}

/* ============================================
   上传区
   ============================================ */
.upload-box {
    background: #f9fafb;
    border-radius: 14px;
    padding: 18px;
    margin-top: 18px;
    border: 1px dashed #d1d5db;
    transition: all .25s;
}
.upload-box.uploaded {
    background: #f0fdf4;
    border-color: var(--success);
}
.upload-title {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
    text-align: center;
}
.upload-sub { color: #9ca3af; font-weight: 400; font-size: 12px; }

.upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.upload-thumb {
    position: relative;
    padding-top: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f4f6;
}
.upload-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}
.upload-del {
    position: absolute;
    top: 4px; right: 4px;
    width: 22px; height: 22px;
    line-height: 20px;
    text-align: center;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    z-index: 2;
    transition: all .2s;
}
.upload-del:hover { background: var(--danger); }

.upload-add {
    position: relative;
    padding-top: 100%;
    border: 2px dashed #c7d2fe;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all .2s;
}
.upload-add:hover { border-color: var(--primary); background: #f5f3ff; }
.upload-add-icon {
    position: absolute;
    top: 50%; left: 0;
    transform: translateY(-50%);
    width: 100%;
    text-align: center;
    font-size: 26px;
    color: var(--primary);
    font-weight: 300;
    margin-top: -12px;
}
.upload-add-text {
    position: absolute;
    bottom: 14px;
    left: 0; right: 0;
    text-align: center;
    font-size: 12px;
    color: #6b7280;
}
.upload-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--primary);
    background: #fff;
}
.upload-tip {
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 10px;
}

/* ============================================
   QQ 客服
   ============================================ */
.qq-tip {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #e0f2fe, #dbeafe);
    border: 1px solid #93c5fd;
    border-radius: 14px;
    padding: 16px 18px;
    margin-top: 18px;
}
.qq-tip-icon { font-size: 30px; flex-shrink: 0; }
.qq-tip-title { font-size: 14px; font-weight: 700; color: #1e40af; margin-bottom: 4px; }
.qq-tip-text { font-size: 13px; color: #1e40af; line-height: 1.6; }
.qq-num {
    display: inline-block;
    padding: 2px 10px;
    background: #fff;
    border-radius: 6px;
    font-weight: 700;
    color: #1d4ed8;
    cursor: pointer;
    transition: all .15s;
}
.qq-num:hover { background: #1d4ed8; color: #fff; }

/* ============================================
   底部提示框
   ============================================ */
.tip-box {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #d1fae5;
    border-radius: 14px;
    padding: 18px;
    margin-top: 18px;
    text-align: center;
}
.tip-box .tip-icon { font-size: 22px; margin-bottom: 6px; }
.tip-box .tip-text { font-size: 13px; color: #065f46; line-height: 1.6; }

/* ============================================
   订单卡片（查询页）
   ============================================ */
.result { margin-top: 24px; }
.order-card {
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 12px;
    border-left: 5px solid #e5e7eb;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform .15s;
}
.order-card:hover { transform: translateY(-2px); }
.order-card.pending { border-left-color: var(--warning); background: #fffbeb; }
.order-card.done    { border-left-color: var(--success); background: #f0fdf4; }
.order-card.cancel  { border-left-color: #9ca3af; background: #f9fafb; opacity: 0.75; }

.order-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.order-user { font-size: 17px; font-weight: 700; color: var(--primary-dark); }
.order-amount { font-size: 20px; font-weight: 800; color: var(--danger); }

.order-coins {
    font-size: 13px;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 8px;
}
.gift-inline {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    background: #fef3c7;
    color: #b45309;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.order-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}
.order-card.pending .status-text { color: #92400e; }
.order-card.done .status-text    { color: #065f46; }
.order-card.cancel .status-text  { color: #6b7280; }
.status-icon { font-size: 18px; }

.order-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #9ca3af;
}
.order-shot-tag {
    margin-top: 8px;
    font-size: 12px;
    color: #065f46;
    font-weight: 600;
}

.pay-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}
.pay-tag.wechat { background: #d1fae5; color: var(--wechat); }
.pay-tag.alipay { background: #dbeafe; color: var(--alipay); }

/* ============================================
   空状态
   ============================================ */
.empty { text-align: center; padding: 40px 20px; }
.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}
.empty p { font-size: 16px; color: #6b7280; margin-bottom: 6px; }
.empty small { color: #9ca3af; }

/* ============================================
   返回链接
   ============================================ */
.back-link {
    display: block;
    text-align: center;
    margin-top: 24px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
}
.back-link:hover { text-decoration: underline; }

/* ============================================
   实时到账
   ============================================ */
.recent {
    background: #fff;
    border-radius: 18px;
    padding: 18px 22px;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
    max-height: 420px;
    overflow: hidden;
    position: relative;
}
.recent-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 14px;
}
.recent-dot {
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16,185,129,0.6);
    animation: pulse 1.6s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.6); }
    70%  { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.recent-count {
    margin-left: auto;
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
}
.recent-list {
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}
.recent-list::-webkit-scrollbar { width: 4px; }
.recent-list::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 6px;
    transition: all .2s;
}
.recent-item:hover { background: #f0fdf4; transform: translateX(2px); }
.recent-left { display: flex; align-items: center; gap: 10px; }
.recent-avatar {
    width: 32px; height: 32px;
    line-height: 32px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.recent-user { font-size: 13px; color: #374151; font-weight: 600; }
.recent-right { text-align: right; }
.recent-amount {
    display: block;
    color: var(--success);
    font-weight: 800;
    font-size: 14px;
}
.recent-time {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

/* ============================================
   悬浮结算条（移动端）
   ============================================ */
.float-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    padding: 12px 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    display: none;
    z-index: 99;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.float-bar.show { display: flex; }
.float-info { font-size: 13px; color: #6b7280; }
.float-info strong { color: var(--gold); font-size: 18px; font-weight: 800; }
.float-bar button {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

/* ============================================
   Toast 提示
   ============================================ */
.toast {
    position: fixed;
    top: 40px; left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.82);
    color: #fff;
    padding: 10px 22px;
    border-radius: 22px;
    font-size: 14px;
    z-index: 9999;
    animation: toastIn .3s;
    transition: opacity .3s;
}
.toast-success { background: linear-gradient(135deg, var(--success), #059669); }
.toast-error   { background: linear-gradient(135deg, var(--danger), #b91c1c); }
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -12px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================
   灯箱
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 30px;
    cursor: zoom-out;
    animation: fadeIn .2s;
}
.lightbox.show { display: flex; }
.lightbox img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================
   登录页
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}
.login-card {
    background: #fff;
    border-radius: 22px;
    padding: 48px 40px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg), 0 2px 8px rgba(0,0,0,0.04);
    text-align: center;
    animation: cardIn .4s ease;
}
.login-logo {
    font-size: 56px;
    margin-bottom: 12px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}
.login-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}
.login-sub {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 28px;
}
.login-card form { text-align: left; }
.login-tip {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #9ca3af;
}

/* ============================================
   后台布局
   ============================================ */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.admin-header h1 { font-size: 26px; color: var(--primary-dark); }
.admin-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-user {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: #eef2ff;
    color: var(--primary);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

/* 开关栏 */
.switch-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}
.switch-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    padding: 18px 22px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}
.switch-icon { font-size: 26px; flex-shrink: 0; }
.switch-item > div { flex: 1; }
.switch-label { font-weight: 700; color: #374151; font-size: 14px; }
.switch-hint { font-size: 12px; color: #9ca3af; margin-top: 2px; }

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 30px;
    border-radius: 20px;
    transition: all .25s;
    flex-shrink: 0;
    text-decoration: none;
}
.switch.on  { background: linear-gradient(135deg, var(--success), #059669); }
.switch.off { background: #d1d5db; }
.switch-dot {
    position: absolute;
    top: 3px;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all .25s;
}
.switch.on .switch-dot  { left: 25px; }
.switch.off .switch-dot { left: 3px; }

/* 统计卡 */
.stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stat {
    background: #fff;
    border-radius: 14px;
    padding: 18px 10px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform .15s;
}
.stat:hover { transform: translateY(-2px); }
.stat .num { font-size: 24px; font-weight: 800; color: var(--primary-dark); }
.stat .txt { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-tabs, .filter-pay {
    display: flex;
    gap: 4px;
    background: #fff;
    padding: 4px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}
.filter-tabs a, .filter-pay a {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    transition: all .15s;
}
.filter-tabs a:hover, .filter-pay a:hover { color: var(--primary); }
.filter-tabs a.active, .filter-pay a.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}
.filter-search { display: flex; gap: 6px; margin-left: auto; }
.filter-search input {
    padding: 8px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    width: 160px;
    font-family: inherit;
}
.filter-search input:focus { border-color: var(--primary); }

/* ============================================
   后台表格
   ============================================ */
.table-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; text-align: left; font-size: 14px; }
th {
    background: #f9fafb;
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
tr { border-bottom: 1px solid #f3f4f6; transition: background .15s; }
tr:hover { background: #f9fafb; }
tr.pending { background: #fffbeb; }
tr.done { background: #f0fdf4; }
tr.cancel { color: #9ca3af; }

.uname {
    cursor: pointer;
    color: var(--primary-dark);
    transition: color .15s;
}
.uname:hover { color: var(--primary); }

.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.tag-pending { background: #fef3c7; color: #92400e; }
.tag-done { background: #d1fae5; color: #065f46; }
.tag-cancel { background: #f3f4f6; color: #6b7280; }

.thumb-list { display: flex; gap: 4px; }
.thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    cursor: zoom-in;
    border: 2px solid #f3f4f6;
    transition: all .15s;
}
.thumb:hover { border-color: var(--primary); transform: scale(1.05); }

.actions { white-space: nowrap; }
.actions form { display: inline; }
.actions button {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    margin-right: 4px;
    transition: all .15s;
    font-weight: 600;
    font-family: inherit;
}
.actions .ok { background: var(--success); color: #fff; }
.actions .ok:hover { background: #059669; }
.actions .no { background: #f3f4f6; color: #6b7280; }
.actions .no:hover { background: #e5e7eb; }
.actions button:active { transform: scale(0.95); }

/* ============================================
   后台设置卡
   ============================================ */
.setting-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.setting-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    list-style: none;
    padding: 4px 0;
}
.setting-summary::-webkit-details-marker { display: none; }
.setting-icon { font-size: 24px; }
.setting-summary .summary-hint {
    margin-left: auto;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
}
details[open] .summary-hint { display: none; }

.quick-setting-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}
.quick-setting-grid input {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    font-size: 15px;
    text-align: center;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    outline: none;
    transition: all .2s;
    font-weight: 600;
    color: var(--primary-dark);
    font-family: inherit;
}
.quick-setting-grid input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.quick-setting-grid input::placeholder { color: #d1d5db; font-weight: 400; }

.setting-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 16px;
}
.setting-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    outline: none;
    transition: all .2s;
    font-family: inherit;
    color: #1f2937;
}
.setting-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

/* 赠送规则 */
.gift-grid {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 8px;
}
.gift-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 12px;
    color: #92400e;
    font-weight: 600;
    padding: 0 4px 8px;
    border-bottom: 1px dashed #fcd34d;
    margin-bottom: 10px;
}
.gift-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}
.gift-row input {
    height: 42px !important;
    font-size: 14px !important;
    background: #fff !important;
}

/* 迷你开关 */
.setting-toggles {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}
.mini-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.mini-switch input { display: none; }
.mini-switch-dot {
    position: relative;
    width: 40px;
    height: 22px;
    background: #d1d5db;
    border-radius: 20px;
    transition: all .25s;
    flex-shrink: 0;
}
.mini-switch-dot::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: all .25s;
}
.mini-switch input:checked + .mini-switch-dot {
    background: linear-gradient(135deg, var(--success), #059669);
}
.mini-switch input:checked + .mini-switch-dot::after { left: 20px; }
.mini-switch-label { font-size: 14px; color: #374151; }

/* ============================================
   收款码设置
   ============================================ */
.qr-setting-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}
.qr-setting-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}
.qr-setting-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
}
.qr-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
}
.qr-dot.wechat { background: var(--wechat); }
.qr-dot.alipay { background: var(--alipay); }

.qr-preview {
    width: 180px;
    height: 180px;
    margin: 0 auto 14px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #d1d5db;
}
.qr-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.qr-empty {
    color: #9ca3af;
    font-size: 13px;
}
.qr-btn-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.qr-btn-row .btn {
    font-size: 13px;
    padding: 8px 14px;
    margin: 0;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 900px) {
    .stats { grid-template-columns: repeat(3, 1fr); }
    .switch-bar { grid-template-columns: 1fr; }
    .quick-setting-grid { grid-template-columns: repeat(4, 1fr); }
    .qr-setting-grid { grid-template-columns: 1fr 1fr; }
    .setting-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    body { padding: 20px 12px 80px; }
    .container { max-width: 100%; }

    .card { padding: 28px 20px; border-radius: 18px; }
    .hero h1 { font-size: 24px; }
    .hero-icon { font-size: 42px; }
    .login-card { padding: 36px 24px; }
    .login-logo { font-size: 44px; }
    .login-title { font-size: 22px; }

    .big-input { height: 52px; font-size: 16px; padding: 0 16px; }
    .btn-lg { height: 54px; font-size: 16px; }

    .pay-method { padding: 16px 10px; }
    .pay-method .pay-icon svg { width: 30px; height: 30px; }
    .pay-method .pay-name { font-size: 14px; }

    .amount-input-wrap { height: 60px; padding: 0 16px; }
    .amount-input-wrap input { font-size: 20px; }
    .amount-prefix { font-size: 22px; }
    .amount-suffix { font-size: 12px; padding: 4px 10px; }

    .quick-amounts { grid-template-columns: repeat(3, 1fr) !important; gap: 6px; }
    .qa-btn { height: 58px; padding: 6px 2px; }
    .qa-amount { font-size: 14px; }
    .qa-amount small { font-size: 11px; }
    .qa-coins, .qa-gift { font-size: 10px; padding: 1px 6px; }
    .qa-best { font-size: 9px; padding: 1px 6px; top: -6px; right: -4px; }

    .summary-value { font-size: 20px; }
    .summary-label { font-size: 13px; }

    .qr-box img { width: 220px; height: 220px; }

    .upload-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }

    .recent { padding: 14px 16px; border-radius: 14px; }
    .recent-item { padding: 8px 10px; }
    .recent-avatar { width: 28px; height: 28px; line-height: 28px; font-size: 13px; }

    .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat { padding: 14px 8px; border-radius: 12px; }
    .stat .num { font-size: 20px; }
    .stat .txt { font-size: 11px; }

    .switch-item { padding: 14px 16px; }
    .switch-icon { font-size: 22px; }

    .setting-card { padding: 18px 16px; }
    .quick-setting-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .quick-setting-grid input { height: 42px; font-size: 14px; }
    .setting-row { grid-template-columns: 1fr; gap: 10px; }

    .qr-setting-grid { grid-template-columns: 1fr; gap: 14px; }
    .qr-preview { width: 160px; height: 160px; }

    .filter-bar { gap: 8px; }
    .filter-tabs, .filter-pay { flex-wrap: wrap; }
    .filter-tabs a, .filter-pay a { padding: 6px 12px; font-size: 12px; }
    .filter-search { width: 100%; margin-left: 0; }
    .filter-search input { flex: 1; width: auto; }

    th, td { padding: 10px 8px; font-size: 13px; }
    .thumb { width: 38px; height: 38px; }

    .admin-header h1 { font-size: 22px; }
    .admin-actions { gap: 6px; }
    .admin-actions .btn-ghost { padding: 8px 12px; font-size: 12px; }
    .admin-user { padding: 6px 10px; font-size: 12px; }
}

/* ============================================
   打印优化（后台导出）
   ============================================ */
@media print {
    body { background: #fff; padding: 0; }
    .switch-bar, .filter-bar, .admin-actions, .actions,
    .setting-card, .stats { display: none !important; }
    .table-card { box-shadow: none; border: 1px solid #e5e7eb; }
    .thumb-list { display: none; }
}

/* ===== 收款码区域增强 ===== */
.qr-wrap {
    position: relative;
    display: inline-block;
    cursor: zoom-in;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: transform .2s, box-shadow .2s;
}
.qr-wrap:active { transform: scale(0.98); }
.qr-wrap:hover { box-shadow: 0 14px 40px rgba(79,70,229,0.15); }
.qr-wrap img {
    display: block;
    width: 250px;
    height: 250px;
    object-fit: contain;
    background: #fff;
    border-radius: 18px;
    -webkit-touch-callout: default;
    -webkit-user-select: none;
    user-select: none;
}
.qr-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: #fff;
    font-size: 12px;
    text-align: center;
    padding: 24px 10px 10px;
    pointer-events: none;
    opacity: 0.9;
}
.qr-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
    flex-wrap: wrap;
}
.qr-actions .btn {
    font-size: 13px;
    padding: 8px 16px;
}

/* ===== Lightbox 增强 ===== */
.lightbox-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 95vw;
    max-height: 95vh;
}
.lightbox-inner img {
    max-width: 420px;
    max-height: 60vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    -webkit-touch-callout: default;
    -webkit-user-select: none;
    user-select: none;
    background: #fff;
}

/* 手机端保持大一点 */
@media (max-width: 640px) {
    .lightbox-inner img {
        max-width: 90vw;
        max-height: 70vh;
    }
}
.lightbox-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.lightbox-actions .btn {
    padding: 10px 22px;
    font-size: 14px;
    border-radius: 10px;
}
.lightbox-hint {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-align: center;
}