/* 抽奖前台样式 - 完全匹配Untitled参考样式 */

/* 页面背景 */
.knn-lottery-page {
    padding: 32px 16px;
    background: transparent !important;
}

.knn-lottery-container {
    max-width: 1200px;
    margin: 0 auto;
    background: transparent !important;
}

/* 主体网格布局 */
.lottery-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .lottery-grid-layout {
        grid-template-columns: 2fr 1fr;
    }
}

/* 左侧主区域 */
.lottery-main-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 16px;
}

/* 标题 */
.lottery-header {
    margin-bottom: 24px;
}

.lottery-title-box {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #ef4444 100%);
    color: white;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.35);
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.lottery-title-box i {
    font-size: 28px;
}

.lottery-desc {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-top: 12px;
    padding: 0 20px;
}

/* 抽奖面板外框 */
.lottery-panel-wrapper {
    position: relative;
    padding: 16px;
}

/* 外层光晕效果 */
.lottery-panel-wrapper::before {
    content: '';
    position: absolute;
    inset: -16px;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.2), rgba(249, 115, 22, 0.2), rgba(239, 68, 68, 0.2));
    border-radius: 64px;
    filter: blur(20px);
    z-index: -1;
}

/* 抽奖面板 */
.lottery-panel {
    position: relative;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #4f46e5 100%) !important;
    padding: 32px;
    border-radius: 48px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: none !important;
}

/* 内层装饰边框 */
.panel-inner-border {
    position: absolute;
    inset: 24px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-radius: 40px;
    pointer-events: none;
}

/* 四角装饰 */
.corner-decoration {
    position: absolute;
    width: 32px;
    height: 32px;
    border-color: #fbbf24;
    border-style: solid;
    z-index: 10;
}

.corner-tl { top: 24px; left: 24px; border-width: 4px 0 0 4px; border-radius: 12px 0 0 0; }
.corner-tr { top: 24px; right: 24px; border-width: 4px 4px 0 0; border-radius: 0 12px 0 0; }
.corner-bl { bottom: 24px; left: 24px; border-width: 0 0 4px 4px; border-radius: 0 0 0 12px; }
.corner-br { bottom: 24px; right: 24px; border-width: 0 4px 4px 0; border-radius: 0 0 12px 0; }

/* 九宫格 */
.lottery-grid {
    display: grid;
    grid-template-columns: repeat(3, 140px);
    grid-template-rows: repeat(3, 140px);
    gap: 16px;
    position: relative;
}

/* 奖品格子 */
.prize-cell {
    position: relative;
    background: white;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    transition: all 0.2s ease;
    border: 4px solid rgba(255, 255, 255, 0.5);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.prize-cell-bg {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background: linear-gradient(135deg, currentColor, transparent);
}

.prize-cell.active {
    border-color: #fbbf24;
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.6), 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.prize-cell.active .prize-cell-bg {
    opacity: 0.2;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.prize-cell.active::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #fbbf24);
    border-radius: 28px;
    z-index: -1;
    filter: blur(8px);
    opacity: 0.6;
}

.prize-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.prize-icon-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 20px;
    max-height: none !important;
}

.prize-text {
    font-weight: 700;
    color: #1f2937;
    font-size: 15px;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* 中间抽奖按钮 */
.lottery-start-btn {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #ef4444 100%);
    border-radius: 24px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 40px rgba(239, 68, 68, 0.4), inset 0 -4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
}

.lottery-start-btn:hover:not(:disabled) {
    transform: scale(1.03);
    box-shadow: 0 16px 50px rgba(239, 68, 68, 0.5);
}

.lottery-start-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.lottery-start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lottery-start-btn.spinning .btn-content i {
    animation: btnIconSpin 1s linear infinite;
}

@keyframes btnIconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    animation: shine 2s infinite;
}

@keyframes shine {
    100% { transform: translateX(100%); }
}

.btn-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.btn-content i {
    font-size: 28px;
    margin-bottom: 4px;
    display: block;
}

.btn-text-line1,
.btn-text-line2 {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}

.btn-price {
    font-size: 12px;
    margin-top: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* 底部提示 */
.lottery-footer-tips {
    margin-top: 24px;
}

.tips-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.tips-box i {
    color: #f59e0b;
    font-size: 20px;
}

.tips-box span {
    color: #6b7280;
    font-size: 14px;
}

.tips-box strong {
    color: #d97706;
    font-weight: 700;
}

/* 右侧侧边栏 */
.lottery-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 700px;
}

/* 卡片样式 */
.sidebar-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.card-title i {
    color: #3b82f6;
    font-size: 20px;
}

/* 账户统计 */
.account-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 20px;
    border-radius: 16px;
}

.stat-row .stat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
}

.stat-row .stat-value {
    font-size: 22px;
}

.stat-balance {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}

.stat-points {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.stat-points .stat-label i {
    color: #22c55e;
}

.stat-points .stat-value {
    color: #22c55e;
}

.stat-wins {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.stat-balance .stat-label i {
    color: #f97316;
}

.stat-wins .stat-label i {
    color: #3b82f6;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
}

.stat-balance .stat-value {
    color: #f97316;
}

.stat-wins .stat-value {
    color: #3b82f6;
}

/* 中奖记录 */
.records-card {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.records-card .card-title {
    flex-shrink: 0;
    margin-bottom: 16px;
    padding-bottom: 12px;
}

.records-list {
    flex: 1;
    overflow-y: auto;
    margin: 0 -8px;
    padding: 0 8px;
    min-height: 0;
}

.records-empty {
    text-align: center;
    color: #9ca3af;
    padding: 60px 0;
    font-size: 14px;
}

.record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.record-item:hover {
    background: #f3f4f6;
}

.record-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.record-avatar .avatar-mini {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: block;
}

.record-avatar .avatar-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.record-avatar .fa-user {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 16px;
}

.record-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.record-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.record-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.record-prize {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #f97316;
    font-weight: 600;
}

.record-prize i {
    font-size: 11px;
}

.record-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #9ca3af;
}

.record-time i {
    font-size: 10px;
}

/* 弹窗 - 强制相对于视口居中定位 */
.knn-modal,
.knn-modal-portal,
body .knn-modal,
body .knn-modal-portal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    margin: 0 !important;
    padding: 0 !important;
}

.knn-modal.show,
.knn-modal-portal.show,
body .knn-modal.show,
body .knn-modal-portal.show,
.knn-modal.show:not(.hide),
.knn-modal-portal.show:not(.hide) {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: flex !important;
}

.knn-modal .modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: -1;
}

.knn-modal-content {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

.knn-modal.show .knn-modal-content {
    transform: scale(1);
}

.knn-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.knn-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.knn-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #9ca3af;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s ease;
    line-height: 1;
}

.knn-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.knn-modal-body {
    padding: 24px;
}

.knn-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
}

/* 支付弹窗 - 参考 PaymentModal.tsx */
.payment-modal-content {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.knn-modal.show .payment-modal-content {
    transform: scale(1);
}

/* 支付弹窗头部 */
.payment-modal-header {
    position: relative;
    background: linear-gradient(135deg, #3b82f6, #4f46e5);
    padding: 24px;
    color: white;
}

.payment-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.payment-modal-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.payment-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.payment-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 支付弹窗内容 */
.payment-modal-body {
    padding: 24px;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 支付卡片 */
.payment-card {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.payment-card:hover {
    border-color: #d1d5db;
    background: #f9fafb;
    transform: scale(1.02);
}

.payment-card:active {
    transform: scale(0.98);
}

.payment-card.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.payment-card.disabled {
    border-color: #e5e7eb;
    background: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

.payment-card.disabled:hover {
    transform: none;
}

.payment-card-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.payment-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.balance-icon {
    background: linear-gradient(135deg, #fb923c, #f97316);
}

.online-icon {
    background: linear-gradient(135deg, #4ade80, #10b981);
}

.points-icon {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.payment-icon.selected {
    background: #3b82f6;
}

.payment-info {
    flex: 1;
}

.payment-name {
    font-weight: 700;
    color: #1f2937;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.selected-badge {
    background: #3b82f6;
    color: white;
}

.select-badge {
    background: #10b981;
    color: white;
}

.payment-desc {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.balance-amount {
    color: #f97316;
    font-weight: 700;
}

.balance-amount.insufficient {
    color: #ef4444;
}

.payment-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}

/* 在线支付选项 */
.online-options {
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.online-method {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.online-method:hover {
    border-color: #d1d5db;
    background: #f9fafb;
    transform: scale(1.01);
}

.online-method.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.online-method-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.alipay-icon {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.wechat-icon {
    background: linear-gradient(135deg, #4ade80, #22c55e);
}

.online-method-name {
    flex: 1;
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.check-icon {
    font-size: 12px;
    background: #3b82f6;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 支付弹窗底部 */
.payment-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: 2px solid #d1d5db;
    background: white;
    color: #374151;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-confirm {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #4f46e5);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-confirm:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-confirm:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

/* 结果弹窗 */
.result-modal-content {
    text-align: center;
    padding: 40px 32px;
}

.result-icon-box {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: white;
    animation: resultPop 0.5s ease;
}

@keyframes resultPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.result-title {
    font-size: 26px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 12px;
}

.result-prize-name {
    font-size: 20px;
    color: #f97316;
    font-weight: 700;
    margin-bottom: 12px;
}

.result-desc {
    color: #6b7280;
    margin-bottom: 28px;
    font-size: 15px;
    line-height: 1.6;
}

/* 抽奖模块按钮 - 独特类名避免与主题冲突 */
.knn-lottery-btn {
    padding: 14px 40px;
    border-radius: 14px;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.knn-lottery-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #4f46e5);
    color: white;
}

.knn-lottery-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

/* Tailwind渐变工具类 */
.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.from-amber-400 { --tw-gradient-from: #fbbf24; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(251, 191, 36, 0)); }
.to-orange-500 { --tw-gradient-to: #f97316; }

.from-orange-400 { --tw-gradient-from: #fb923c; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(251, 146, 60, 0)); }
.to-red-500 { --tw-gradient-to: #ef4444; }

.from-yellow-400 { --tw-gradient-from: #facc15; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(250, 204, 21, 0)); }
.to-amber-500 { --tw-gradient-to: #f59e0b; }

.from-cyan-400 { --tw-gradient-from: #22d3ee; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(34, 211, 238, 0)); }
.to-blue-500 { --tw-gradient-to: #3b82f6; }

.from-emerald-400 { --tw-gradient-from: #34d399; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(52, 211, 153, 0)); }
.to-green-500 { --tw-gradient-to: #22c55e; }

.from-purple-400 { --tw-gradient-from: #c084fc; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(192, 132, 252, 0)); }
.to-pink-500 { --tw-gradient-to: #ec4899; }

.from-gray-300 { --tw-gradient-from: #d1d5db; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(209, 213, 219, 0)); }
.to-gray-400 { --tw-gradient-to: #9ca3af; }

/* 响应式 */
@media (max-width: 1024px) {
    .lottery-sidebar {
        height: auto;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .records-card {
        max-height: 400px;
    }
}

@media (max-width: 640px) {
    .knn-lottery-page {
        padding: 16px 0;
        width: 100%;
    }
    
    .knn-lottery-container {
        max-width: 100%;
        margin: 0;
        padding: 0 12px;
    }
    
    .lottery-title-box {
        font-size: 16px;
        padding: 10px 20px;
        border-radius: 12px;
    }
    
    .lottery-title-box i {
        font-size: 18px;
    }
    
    .lottery-panel-wrapper {
        padding: 4px;
        margin: 0 -4px;
    }
    
    .lottery-panel-wrapper::before {
        inset: -4px;
        border-radius: 32px;
    }
    
    .lottery-panel {
        padding: 12px;
        border-radius: 20px;
    }
    
    .panel-inner-border {
        inset: 12px;
        border-radius: 20px;
    }
    
    .lottery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 85px);
        gap: 6px;
        max-width: 100%;
    }
    
    .prize-cell {
        border-radius: 12px;
        padding: 8px;
    }
    
    .prize-icon-box {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .prize-icon-box img {
        width: 36px;
        height: 36px;
    }
    
    .prize-text {
        font-size: 11px;
    }
    
    .lottery-start-btn {
        border-radius: 12px;
    }
    
    .btn-content {
        gap: 2px;
    }
    
    .btn-content i {
        font-size: 16px;
        margin-bottom: 2px;
    }
    
    .btn-text-line1,
    .btn-text-line2 {
        font-size: 14px;
    }
    
    .btn-price {
        font-size: 9px;
        padding: 2px 6px;
        margin-top: 2px;
    }
    
    .corner-decoration {
        width: 16px;
        height: 16px;
    }
    
    .corner-tl { top: 12px; left: 12px; border-width: 3px 0 0 3px; }
    .corner-tr { top: 12px; right: 12px; border-width: 3px 3px 0 0; }
    .corner-bl { bottom: 12px; left: 12px; border-width: 0 0 3px 3px; }
    .corner-br { bottom: 12px; right: 12px; border-width: 0 3px 3px 0; }
    
    .tips-box {
        padding: 8px 14px;
        font-size: 12px;
        gap: 6px;
    }
    
    .tips-box i {
        font-size: 14px;
    }
    
    .sidebar-card {
        padding: 14px 12px;
        border-radius: 16px;
        margin: 0 -4px;
    }
    
    .card-title {
        font-size: 15px;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    
    .card-title i {
        font-size: 16px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .record-item {
        padding: 8px 10px;
        border-radius: 10px;
        margin-bottom: 6px;
    }
    
    .record-avatar,
    .record-avatar .avatar-mini,
    .record-avatar .fa-user {
        width: 36px;
        height: 36px;
    }
    
    .record-name {
        font-size: 13px;
    }
    
    .record-prize {
        font-size: 12px;
    }
    
    .record-time {
        font-size: 11px;
    }
}

/* 滚动条样式 */
.records-list::-webkit-scrollbar {
    width: 6px;
}

.records-list::-webkit-scrollbar-track {
    background: transparent;
}

.records-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.records-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 深色模式适配 */
.dark-theme .sidebar-card {
    background: #1f2937;
    border-color: #374151;
}

.dark-theme .card-title {
    color: #f3f4f6;
    border-color: #374151;
}

.dark-theme .stat-balance {
    background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
}

.dark-theme .stat-points {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
}

.dark-theme .stat-wins {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

.dark-theme .stat-label {
    color: #d1d5db;
}

.dark-theme .record-item {
    background: #374151;
}

.dark-theme .record-item:hover {
    background: #4b5563;
}

.dark-theme .record-name {
    color: #f3f4f6;
}

.dark-theme .record-time {
    color: #9ca3af;
}

.dark-theme .tips-box {
    background: #1f2937;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.dark-theme .tips-box span {
    color: #d1d5db;
}

.dark-theme .records-empty {
    color: #6b7280;
}

/* 九宫格深色模式 */
.dark-theme .lottery-panel-wrapper::before {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.3), rgba(79, 70, 229, 0.3));
}

.dark-theme .lottery-panel {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 50%, #312e81 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.dark-theme .panel-inner-border {
    border-color: rgba(255, 255, 255, 0.15);
}

.dark-theme .corner-decoration {
    border-color: #fbbf24;
}

.dark-theme .prize-cell {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
}

.dark-theme .prize-cell:hover {
    background: #ffffff;
}

.dark-theme .prize-text {
    color: #374151;
}

.dark-theme .lottery-start-btn {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dark-theme .lottery-title-box {
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.25);
}

.dark-theme .tips-box {
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(75, 85, 99, 0.5);
}
