/* ==========================================================
   插件样式独立沙箱隔离机制 (Scoped CSS Isolation & Reset)
   彻底抵消外部主题对插件内部文字、盒模型、表格和按钮样式的渗透
   ========================================================== */
#zodiac-app,
#zodiac-app *,
#zl-global-float,
#zl-global-float * {
    box-sizing: border-box !important;
    -webkit-font-smoothing: antialiased;
}

#zodiac-app a,
#zl-global-float a {
    text-decoration: none !important;
    box-shadow: none !important;
}

.zl-container {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    padding: 24px;
    max-width: 640px;
    margin: 30px auto;
    box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.07), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
}
.zl-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 12px;
}
.zl-live-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #059669;
    background: #ecfdf5;
    padding: 3px 10px;
    border-radius: 9999px;
    margin-bottom: 4px;
}
.zl-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    animation: zl-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes zl-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .4; transform: scale(1.3); }
}
.zl-period {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}
.zl-head-right { display: flex; gap: 18px; }
.zl-stat-item { display: flex; flex-direction: column; align-items: flex-end; }
.zl-stat-title { font-size: 11px; color: #94a3b8; text-transform: uppercase; }
.zl-stat-val { font-size: 16px; font-weight: 700; color: #334155; }
.zl-stat-val.text-red { color: #f43f5e; }
.zl-last-banner {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 10px 16px;
    margin: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e2e8f0;
}
.zl-last-label { font-size: 13px; color: #64748b; display: flex; align-items: center; gap: 6px; }
.zl-last-award { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; color: #0f172a; }
.zl-last-num { font-size: 12px; color: #f43f5e; background: #ffe4e6; padding: 2px 7px; border-radius: 6px; }
.zl-user-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 13px; color: #64748b; }
.zl-points-badge { background: #fffbeb; color: #b45309; padding: 4px 12px; border-radius: 9999px; font-weight: 600; border: 1px solid #fef3c7; }
.zl-points-badge strong { color: #d97706; font-size: 15px; }
.zl-login-link { color: #6366f1; text-decoration: none; font-weight: 600; }
.zl-cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
@media (max-width: 480px) { .zl-cards-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
.zl-card-btn {
    position: relative;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.22s ease;
}
.zl-card-btn:hover { border-color: #a5b4fc; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.08); }
.zl-card-btn.selected { background: #eff6ff; border-color: #3b82f6; box-shadow: 0 0 0 2px #93c5fd; transform: translateY(-2px); }
.zl-card-num { position: absolute; top: 6px; left: 8px; font-size: 11px; font-weight: 700; color: #94a3b8; }
.zl-card-btn.selected .zl-card-num { color: #3b82f6; }
.zl-card-emoji { font-size: 32px; line-height: 1.2; margin: 6px 0 4px; }
.zl-card-text { font-size: 14px; font-weight: 600; color: #334155; }
.zl-card-btn.selected .zl-card-text { color: #1e3a8a; }
.zl-check-icon { position: absolute; top: 6px; right: 8px; width: 16px; height: 16px; border-radius: 50%; background: #3b82f6; color: #fff; font-size: 10px; line-height: 16px; display: none; }
.zl-card-btn.selected .zl-check-icon { display: block; }
.zl-bet-panel { background: #f8fafc; border-radius: 16px; padding: 18px; border: 1px solid #e2e8f0; }
.zl-panel-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.zl-input-wrap { display: flex; align-items: center; gap: 10px; }
.zl-input-wrap label { font-size: 13px; font-weight: 600; color: #475569; }
.zl-input-wrap input { width: 90px; padding: 8px 12px; border: 1.5px solid #cbd5e1; border-radius: 10px; font-size: 14px; font-weight: 700; color: #0f172a; outline: none; }
.zl-input-wrap input:focus { border-color: #6366f1; }
.zl-quick-chips { display: flex; gap: 6px; }
.zl-chip { background: #ffffff; border: 1px solid #cbd5e1; color: #475569; border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.zl-chip:hover { background: #f1f5f9; border-color: #94a3b8; }
.zl-panel-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px dashed #e2e8f0; }
.zl-calc-info { font-size: 14px; color: #64748b; }
.zl-text-highlight { color: #3b82f6; font-weight: 700; }
.zl-text-bold { color: #f43f5e; font-weight: 800; font-size: 16px; }
.zl-submit-button { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #ffffff; border: none; border-radius: 10px; padding: 10px 26px; font-size: 15px; font-weight: 700; cursor: pointer; }
.zl-submit-button:disabled { opacity: 0.5; cursor: not-allowed; }
.zl-toast-msg { margin-top: 14px; padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; display: none; }
.zl-toast-msg.success { display: block; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.zl-toast-msg.error { display: block; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.zl-my-bets-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid #f1f5f9; }
.zl-section-title { font-size: 14px; font-weight: 700; color: #475569; margin-bottom: 10px; }
.zl-chips-list { display: flex; flex-wrap: wrap; gap: 8px; }
.zl-my-bet-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 6px 12px; font-size: 13px; font-weight: 500; color: #334155; display: inline-flex; align-items: center; gap: 6px; }
.zl-item-badge { background: #e0f2fe; color: #0369a1; padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 700; }

/* 下注记录按钮与弹窗 Modal 样式 */
.zl-history-btn {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.zl-history-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.zl-modal {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: zl-fadeIn 0.2s ease;
}
@keyframes zl-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.zl-modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 680px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.zl-modal-header {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.zl-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}
.zl-modal-close {
    font-size: 22px;
    font-weight: bold;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
}
.zl-modal-close:hover {
    color: #ef4444;
}
.zl-modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}
.zl-modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}
.zl-modal-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
}
.zl-modal-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}
.zl-modal-table .tag-won { color: #e11d48; font-weight: 700; background: #fef2f2; padding: 2px 6px; border-radius: 4px; }
.zl-modal-table .tag-lost { color: #64748b; }
.zl-modal-table .tag-pending { color: #2563eb; }

/* ==========================================================
   10 种前台主题风格定义 (Zodiac Lottery 10 Themes)
   ========================================================== */

/* 1. 极简默认 (Modern Blue) - 默认 */
.zl-container.zl-theme-default {
    --zl-primary: #2563eb;
    --zl-primary-hover: #1d4ed8;
    --zl-accent: #f43f5e;
    --zl-text: #1e293b;
    --zl-border: #e2e8f0;
    --zl-card-bg: #ffffff;
    --zl-selected-bg: #eff6ff;
    --zl-selected-border: #3b82f6;
}

/* 2. 暗夜黑金 (Dark Gold) */
.zl-container.zl-theme-darkgold {
    --zl-primary: #f59e0b;
    --zl-primary-hover: #d97706;
    --zl-accent: #fbbf24;
    --zl-text: #f8fafc;
    --zl-border: #334155;
    --zl-card-bg: #1e293b;
    --zl-selected-bg: #334155;
    --zl-selected-border: #f59e0b;
    background-color: #0f172a !important;
    color: #f8fafc !important;
}
.zl-container.zl-theme-darkgold .zl-head,
.zl-container.zl-theme-darkgold .zl-user-bar,
.zl-container.zl-theme-darkgold .zl-my-bets-section,
.zl-container.zl-theme-darkgold .zl-last-banner {
    border-color: #334155 !important;
    color: #cbd5e1 !important;
    background: rgba(30, 41, 59, 0.6) !important;
}
.zl-container.zl-theme-darkgold .zl-period,
.zl-container.zl-theme-darkgold .zl-last-award {
    color: #f8fafc !important;
}
.zl-container.zl-theme-darkgold .zl-card-text {
    color: #f1f5f9 !important;
}

/* 3. 赛博朋克 (Cyberpunk Neon) */
.zl-container.zl-theme-cyberpunk {
    --zl-primary: #06b6d4;
    --zl-primary-hover: #0891b2;
    --zl-accent: #f43f5e;
    --zl-text: #e2e8f0;
    --zl-border: #0e7490;
    --zl-card-bg: #090d16;
    --zl-selected-bg: #164e63;
    --zl-selected-border: #06b6d4;
    background-color: #030712 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.2) !important;
    border: 1px solid #0891b2 !important;
}
.zl-container.zl-theme-cyberpunk .zl-card-btn {
    border-color: #155e75 !important;
}
.zl-container.zl-theme-cyberpunk .zl-card-text {
    color: #22d3ee !important;
}

/* 4. 国潮朱红 (Chinese Red) */
.zl-container.zl-theme-chinesered {
    --zl-primary: #dc2626;
    --zl-primary-hover: #b91c1c;
    --zl-accent: #f59e0b;
    --zl-text: #1f2937;
    --zl-border: #fecaca;
    --zl-card-bg: #fffbeb;
    --zl-selected-bg: #fee2e2;
    --zl-selected-border: #dc2626;
}
.zl-container.zl-theme-chinesered .zl-live-tag {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

/* 5. 清新薄荷 (Fresh Mint) */
.zl-container.zl-theme-freshmint {
    --zl-primary: #059669;
    --zl-primary-hover: #047857;
    --zl-accent: #10b981;
    --zl-text: #064e3b;
    --zl-border: #a7f3d0;
    --zl-card-bg: #f0fdf4;
    --zl-selected-bg: #d1fae5;
    --zl-selected-border: #059669;
}

/* 6. 浪漫樱花 (Sakura Pink) */
.zl-container.zl-theme-sakura {
    --zl-primary: #db2777;
    --zl-primary-hover: #be185d;
    --zl-accent: #f43f5e;
    --zl-text: #831843;
    --zl-border: #fbcfe8;
    --zl-card-bg: #fff1f2;
    --zl-selected-bg: #fce7f3;
    --zl-selected-border: #db2777;
}

/* 7. 深邃星空 (Deep Space) */
.zl-container.zl-theme-deepspace {
    --zl-primary: #6366f1;
    --zl-primary-hover: #4f46e5;
    --zl-accent: #a855f7;
    --zl-text: #e0e7ff;
    --zl-border: #4338ca;
    --zl-card-bg: #1e1b4b;
    --zl-selected-bg: #312e81;
    --zl-selected-border: #818cf8;
    background-color: #0f0c29 !important;
    color: #e0e7ff !important;
}
.zl-container.zl-theme-deepspace .zl-card-text {
    color: #c7d2fe !important;
}

/* 8. 沉稳商务 (Business Slate) */
.zl-container.zl-theme-slate {
    --zl-primary: #475569;
    --zl-primary-hover: #334155;
    --zl-accent: #0284c7;
    --zl-text: #0f172a;
    --zl-border: #cbd5e1;
    --zl-card-bg: #f8fafc;
    --zl-selected-bg: #e2e8f0;
    --zl-selected-border: #475569;
}

/* 9. 活力橙黄 (Vibrant Orange) */
.zl-container.zl-theme-orange {
    --zl-primary: #ea580c;
    --zl-primary-hover: #c2410c;
    --zl-accent: #f59e0b;
    --zl-text: #7c2d12;
    --zl-border: #fed7aa;
    --zl-card-bg: #fff7ed;
    --zl-selected-bg: #ffedd5;
    --zl-selected-border: #ea580c;
}

/* 10. 薰衣草紫 (Lavender Purple) */
.zl-container.zl-theme-lavender {
    --zl-primary: #7e22ce;
    --zl-primary-hover: #6b21a8;
    --zl-accent: #a855f7;
    --zl-text: #581c87;
    --zl-border: #e9d5ff;
    --zl-card-bg: #faf5ff;
    --zl-selected-bg: #f3e8ff;
    --zl-selected-border: #7e22ce;
}

/* 将主题色应用到按钮与高亮元素 */
.zl-container [data-num].selected {
    border-color: var(--zl-selected-border, #3b82f6) !important;
    background: var(--zl-selected-bg, #eff6ff) !important;
}
.zl-container .zl-submit-button {
    background: linear-gradient(135deg, var(--zl-primary, #2563eb), var(--zl-primary-hover, #1d4ed8)) !important;
}
.zl-container .zl-text-highlight {
    color: var(--zl-primary, #2563eb) !important;
}

/* 全局右下角悬浮提示小组件样式 */
.zl-global-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99998;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#zl-float-toggle-btn {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 9999px;
    padding: 8px 16px 8px 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
#zl-float-toggle-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.2);
    border-color: #3b82f6;
}
.zl-float-icon { font-size: 24px; line-height: 1; }
.zl-float-info { display: flex; flex-direction: column; }
.zl-float-title { font-size: 13px; font-weight: 700; color: #0f172a; }
.zl-float-sub { font-size: 11px; color: #64748b; font-family: monospace; }
#zl-float-panel {
    position: absolute;
    bottom: 65px;
    right: 0;
    width: 280px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15);
    overflow: hidden;
    animation: zl-float-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes zl-float-pop {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.zl-float-header {
    background: #f8fafc;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}
#zl-float-close {
    font-size: 18px;
    cursor: pointer;
    color: #94a3b8;
}
#zl-float-close:hover { color: #ef4444; }
.zl-float-body { padding: 16px; }
.zl-float-action-btn {
    display: block;
    text-align: center;
    background: #2563eb;
    color: #ffffff;
    padding: 8px 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.zl-float-action-btn:hover { background: #1d4ed8; color: #ffffff; }
