* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #ff6b35;
    --primary-dark: #e55a2b;
    --primary-light: #ff8c5a;
    --secondary: #2ec4b6;
    --bg: #f5f6fa;
    --card: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --text-muted: #b2bec3;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --radius-sm: 12px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    padding-bottom: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 20px 16px 60px;
    color: #fff;
    position: relative;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.balance-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    text-align: right;
    min-width: 110px;
}

.balance-label {
    display: block;
    font-size: 12px;
    opacity: 0.9;
}

.balance-amount {
    display: block;
    font-size: 18px;
    font-weight: 700;
    margin-top: 2px;
}

/* Main */
.main {
    padding: 0 16px;
    margin-top: -40px;
}

/* Stats */
.stats-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px 16px;
    display: flex;
    justify-content: space-around;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.stat-item:nth-child(2) .stat-value {
    color: var(--secondary);
}

.stat-item:nth-child(3) .stat-value {
    color: var(--warning);
}

/* Ad Card */
.ad-section {
    margin-bottom: 16px;
}

.ad-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.ad-card::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.ad-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.ad-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.ad-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 16px;
}

.reward-badge {
    display: inline-flex;
    align-items: baseline;
    background: linear-gradient(135deg, #fff3e6 0%, #ffe8d4 100%);
    padding: 8px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.reward-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.reward-unit {
    font-size: 13px;
    color: var(--text-light);
    margin-left: 4px;
}

.watch-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

.watch-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
}

.watch-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-icon {
    font-size: 12px;
}

.ad-tip {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* History */
.history-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: var(--danger);
    background: rgba(214, 48, 49, 0.08);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.history-item:last-child {
    border-bottom: none;
}

.history-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #fff3e6, #ffe8d4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.history-details {
    display: flex;
    flex-direction: column;
}

.history-title {
    font-size: 14px;
    font-weight: 500;
}

.history-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.history-reward {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

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

.loading-text {
    font-size: 14px;
}

/* Reward Toast */
.reward-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: #fff;
    border-radius: 20px;
    padding: 30px 40px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reward-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.toast-icon {
    font-size: 48px;
}

.toast-title {
    font-size: 16px;
    color: var(--text-light);
}

.toast-amount {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin-top: 4px;
}

/* Error Toast */
.error-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(45, 52, 54, 0.95);
    color: #fff;
    border-radius: 30px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.error-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.error-icon {
    font-size: 16px;
}

/* Scrollbar */
.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 360px) {
    .app {
        max-width: 100%;
    }

    .watch-btn {
        padding: 14px 36px;
        font-size: 15px;
    }

    .reward-toast {
        padding: 24px 28px;
    }

    .toast-icon {
        font-size: 36px;
    }

    .toast-amount {
        font-size: 22px;
    }
}

/* ==================== 提现按钮 ==================== */
.withdraw-btn {
    display: block;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 4px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.withdraw-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.35);
}

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

/* ==================== 提现弹窗 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    padding: 20px;
}

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

.modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f5f5f5;
    color: var(--text);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
}

/* 提现信息区 */
.withdraw-info {
    text-align: center;
    background: linear-gradient(135deg, #fff8f4 0%, #fff0e8 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.withdraw-label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.withdraw-amount-big {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 14px;
    font-size: 16px;
    color: var(--text-light);
    font-weight: 600;
}

.form-group input[type="number"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 14px 12px 30px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input[type="text"] {
    padding-left: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.quick-amounts {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.quick-amount {
    flex: 1;
    background: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-amount:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 提现方式 */
.method-options {
    display: flex;
    gap: 8px;
}

.method-option {
    flex: 1;
    cursor: pointer;
}

.method-option input[type="radio"] {
    display: none;
}

.method-option span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 2px solid #eee;
    border-radius: 12px;
    transition: all 0.2s;
}

.method-option input[type="radio"]:checked + span {
    border-color: var(--primary);
    background: linear-gradient(135deg, #fff8f4 0%, #fff0e8 100%);
}

.method-icon {
    font-size: 24px;
}

.method-name {
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
}

/* 提现提示 */
.withdraw-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fff9e6;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 8px;
    font-size: 12px;
    color: #b28900;
    line-height: 1.5;
}

.tip-icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* 按钮 */
.btn-secondary {
    flex: 1;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #eee;
}

.btn-primary {
    flex: 2;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 提现记录区域 */
.withdraw-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-top: 16px;
}

.withdraw-list {
    max-height: 200px;
    overflow-y: auto;
}

.withdraw-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.withdraw-item:last-child {
    border-bottom: none;
}

.withdraw-info-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.withdraw-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #e6f4ff, #d4eaff);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.withdraw-details {
    display: flex;
    flex-direction: column;
}

.withdraw-title {
    font-size: 14px;
    font-weight: 500;
}

.withdraw-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.withdraw-status {
    font-size: 12px;
    color: var(--success);
    font-weight: 600;
}

.withdraw-amount-item {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

/* ==================== 验证提示 ==================== */
.verify-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #e6f4ff;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 8px;
    font-size: 12px;
    color: #1677ff;
    line-height: 1.5;
}

/* ==================== 二维码验证弹窗 ==================== */
.verify-title {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.verify-title span {
    color: var(--primary);
    font-weight: 700;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.qr-box {
    position: relative;
    width: 200px;
    height: 200px;
    border: 2px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.qr-box canvas {
    display: block;
    cursor: pointer;
    transition: transform 0.2s;
}

.qr-box canvas:hover {
    transform: scale(1.02);
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 193, 96, 0.92);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    animation: fadeIn 0.3s ease;
}

.qr-overlay.show {
    display: flex;
}

.qr-checkmark {
    font-size: 60px;
    font-weight: 300;
    animation: checkmark 0.5s ease;
}

.qr-success-text {
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes checkmark {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.qr-timer {
    font-size: 13px;
    color: var(--text-muted);
}

.qr-timer span {
    font-weight: 600;
    color: var(--primary);
}

.qr-actions {
    margin-top: 4px;
}

.qr-actions .btn-secondary {
    padding: 8px 20px;
    font-size: 13px;
    flex: none;
}

.verify-alt {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: var(--primary-light);
}

/* ==================== 结算中心 ==================== */
.settlement-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-top: 16px;
}

.settlement-card {
    margin-top: 12px;
}

.settlement-alert {
    display: flex;
    gap: 12px;
    background: linear-gradient(135deg, #fff7e6 0%, #ffe8cc 100%);
    border: 1px solid #ffd591;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.alert-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-content strong {
    display: block;
    color: #d46b08;
    font-size: 14px;
    margin-bottom: 4px;
}

.alert-content p {
    color: #8c5a00;
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
}

.settlement-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.step-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.step-num {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.step-info {
    flex: 1;
}

.step-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.step-desc {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.5;
}

.settlement-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.settlement-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.settlement-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.settlement-btn.secondary {
    background: #f5f5f5;
    color: var(--text);
    box-shadow: none;
}

.settlement-btn.secondary:hover {
    background: #eee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.settlement-notice {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 14px 16px;
}

.settlement-notice p {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.settlement-notice ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settlement-notice li {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.8;
    padding-left: 16px;
    position: relative;
}

.settlement-notice li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 600;
}