/* ==================== CSS Variables ==================== */
:root {
    /* Slate Colors */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* Primary Colors */
    --red-500: #ef4444;
    --red-600: #dc2626;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --yellow-300: #fde047;
    --yellow-400: #facc15;
    --yellow-500: #eab308;

    /* Status Colors */
    --emerald-600: #059669;
    --teal-600: #0d9488;
    --violet-600: #7c3aed;
    --purple-600: #9333ea;
    --indigo-100: #e0e7ff;
    --indigo-600: #4f46e5;

    /* Semantic */
    --background: #f8fafc;
    --foreground: #0f172a;
    --border: #e2e8f0;
    --card-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* ==================== Global Reset ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: var(--slate-50);
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
    background-image: radial-gradient(var(--slate-300) 1px, transparent 1px);
    background-size: 24px 24px;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 384px;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(254, 226, 226, 0.5), transparent);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* Selection */
::selection {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

/* ==================== Loading Screen ==================== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--slate-200);
    border-top-color: var(--red-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: 1rem;
    color: var(--slate-500);
    font-size: 0.875rem;
}

/* ==================== Main Container ==================== */
.main-app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.container {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==================== Navbar ==================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 1rem;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-logo {
    background: linear-gradient(135deg, var(--red-600), var(--blue-700));
    padding: 0.5rem;
    border-radius: 0.75rem;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
    transform: rotate(3deg);
    transition: transform 0.2s;
    font-size: 22px;
}

.navbar-logo:hover {
    transform: rotate(0deg);
}

.navbar-title-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.navbar-title {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
    color: var(--slate-900);
    line-height: 1;
}

.navbar-title .highlight {
    color: var(--red-600);
}

.navbar-subtitle {
    font-size: 10px;
    color: var(--slate-400);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Desktop Nav */
.nav-items {
    display: none;
    gap: 0.5rem;
    align-items: center;
}

.nav-item {
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 700;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
}

.nav-item svg {
    width: 16px;
    height: 16px;
}

.nav-item.active {
    background: var(--slate-900);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.2);
}

.nav-item:not(.active) {
    color: var(--slate-500);
}

.nav-item:not(.active):hover {
    background: var(--slate-100);
    color: var(--slate-700);
}

@media (min-width: 768px) {
    .nav-items {
        display: flex;
    }
}

/* Mobile Bottom Nav */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--slate-200);
    z-index: 50;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 64px;
    width: 100%;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 0.25rem;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--slate-400);
}

.mobile-nav-item.active {
    color: var(--red-600);
}

.mobile-nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.mobile-nav-item.active svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.5;
}

.mobile-nav-item span {
    font-size: 10px;
    font-weight: 700;
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
}

/* ==================== Main Content ==================== */
.main-content {
    position: relative;
    z-index: 10;
    max-width: 1152px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 64px);
}

@media (max-width: 767px) {
    .main-content {
        margin-bottom: 64px;
    }
}

/* ==================== Tab System ==================== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== Hero Banner (Ticket Style) ==================== */
.hero-banner {
    position: relative;
    background: linear-gradient(to right, var(--red-600), var(--red-500), var(--blue-600));
    border-radius: 1.5rem;
    padding: 1px;
    box-shadow: var(--shadow-xl), 0 0 30px rgba(220, 38, 38, 0.2);
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><rect width="20" height="20" fill="white" opacity="0.1"/></svg>');
    opacity: 0.1;
}

.hero-banner-blur-1 {
    position: absolute;
    right: -40px;
    top: -40px;
    width: 256px;
    height: 256px;
    background: var(--blue-500);
    border-radius: 50%;
    mix-blend-mode: multiply;
    filter: blur(48px);
    opacity: 0.5;
    animation: pulse 3s ease-in-out infinite;
}

.hero-banner-blur-2 {
    position: absolute;
    left: -40px;
    bottom: -40px;
    width: 256px;
    height: 256px;
    background: var(--yellow-400);
    border-radius: 50%;
    mix-blend-mode: overlay;
    filter: blur(48px);
    opacity: 0.3;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.7; }
}

.hero-banner-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border-radius: 1.25rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 10;
    color: white;
}

.hero-banner-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-banner-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.hero-badge-tag {
    background: var(--yellow-400);
    color: #78350f;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
}

.hero-badge-countdown {
    color: #fecaca;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    opacity: 0.9;
}

.hero-title {
    font-size: 2rem;
    font-weight: 900;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-title-gradient {
    background: linear-gradient(to right, #fef3c7, #fef08a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    color: #dbeafe;
    font-size: 0.875rem;
    font-weight: 500;
}

.hero-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-meta-item svg {
    width: 15px;
    height: 15px;
    color: var(--yellow-300);
}

.hero-date-badge {
    background: white;
    color: var(--red-600);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    transform: rotate(2deg);
    border-bottom: 4px solid rgba(220, 38, 38, 0.1);
}

.hero-date-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .hero-banner-content {
        padding: 2rem;
    }

    .hero-banner-grid {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .hero-title {
        font-size: 2.25rem;
    }
}

/* ==================== Info Card ==================== */
.info-card {
    background: white;
    border-left: 4px solid var(--blue-500);
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-card-icon {
    background: #dbeafe;
    padding: 0.5rem;
    border-radius: 9999px;
    color: var(--blue-600);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.info-card-icon svg {
    width: 20px;
    height: 20px;
}

.info-card-content {
    font-size: 0.875rem;
    color: var(--slate-600);
    line-height: 1.6;
}

.info-card-title {
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.info-card-content .highlight-red {
    font-weight: 700;
    color: var(--red-500);
}

.info-card-content .highlight-blue {
    font-weight: 700;
    color: var(--blue-500);
}

/* ==================== Model Cards Grid ==================== */
.models-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 1024px) {
    .models-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== Model Prediction Card ==================== */
.model-card {
    position: relative;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--slate-200);
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.model-card:hover {
    transform: translateY(-4px);
}

/* Model Header */
.model-card-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.model-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 128px;
    height: 128px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: -64px;
    margin-top: -64px;
    filter: blur(32px);
}

/* Model Colors */
.model-header-gpt {
    background: linear-gradient(to right, var(--emerald-600), var(--teal-600));
    color: white;
}

.model-header-claude {
    background: linear-gradient(to right, var(--violet-600), var(--purple-600));
    color: white;
}

.model-header-deepseek {
    background: linear-gradient(to right, var(--blue-600), #0891b2);
    color: white;
}

.model-header-gemini {
    background: linear-gradient(to right, #ea580c, #dc2626);
    color: white;
}

.model-card-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 10;
}

.model-icon-box {
    padding: 0.375rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: var(--shadow-sm);
}

.model-icon-box svg {
    width: 20px;
    height: 20px;
}

.model-name-wrapper h3 {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.025em;
}

.model-id {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Courier New', monospace;
}

.model-card-ticket-icon {
    color: rgba(255, 255, 255, 0.2);
    transform: rotate(-12deg);
    position: absolute;
    right: 1rem;
    stroke-width: 1;
}

.model-card-ticket-icon svg {
    width: 48px;
    height: 48px;
}

/* Model Content */
.model-card-content {
    padding: 0.5rem 1.25rem 1rem;
}

.strategy-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Strategy Row */
.strategy-row {
    position: relative;
    padding: 1rem 0;
}

.strategy-row:first-child {
    padding-top: 0.5rem;
}

.strategy-row:last-child {
    padding-bottom: 0;
}

.strategy-row:last-child .strategy-separator {
    display: none;
}

.strategy-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.strategy-label-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.strategy-group-badge {
    background: var(--slate-100);
    color: var(--slate-600);
    font-size: 10px;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--slate-200);
}

.strategy-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--slate-800);
    background: linear-gradient(to right, var(--slate-100), transparent);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

/* Balls Display */
.strategy-balls {
    display: flex;
    gap: 0.5rem;
    padding-left: 0.25rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.strategy-balls::-webkit-scrollbar {
    height: 4px;
}

.ball-divider {
    width: 1px;
    height: 32px;
    background: var(--slate-200);
    margin: 0 0.25rem;
    align-self: center;
}

/* Lottery Ball */
.lottery-ball {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.lottery-ball.size-sm {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.lottery-ball.size-md {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
}

.lottery-ball.size-lg {
    width: 48px;
    height: 48px;
    font-size: 1.125rem;
}

.lottery-ball::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 6px;
    width: 40%;
    height: 30%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 50%;
    filter: blur(1px);
}

.lottery-ball span {
    position: relative;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.lottery-ball.red {
    background: linear-gradient(135deg, var(--red-500), var(--red-600), #991b1b);
    color: white;
}

.lottery-ball.blue {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600), #1e40af);
    color: white;
}

.lottery-ball.hit {
    ring: 2px solid var(--yellow-400);
    ring-offset: 2px;
    scale: 1.1;
    z-index: 10;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(250, 204, 21, 0.6);
}

/* Strategy Description */
.strategy-description {
    color: var(--slate-500);
    font-size: 0.75rem;
    line-height: 1.6;
    background: rgba(248, 250, 252, 0.5);
    padding: 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--slate-100);
    transition: background-color 0.2s;
}

.strategy-row:hover .strategy-description {
    background: var(--slate-50);
}

/* Ticket Separator */
.strategy-separator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-bottom: 2px dashed var(--slate-200);
    width: 100%;
    transform: scaleX(1.06);
    transform-origin: center;
}

.strategy-separator::before,
.strategy-separator::after {
    content: '';
    position: absolute;
    bottom: -6px;
    width: 16px;
    height: 16px;
    background: var(--slate-50);
    border-radius: 50%;
    z-index: 10;
}

.strategy-separator::before {
    left: -20px;
    border-right: 1px solid var(--slate-300);
}

.strategy-separator::after {
    right: -20px;
    border-left: 1px solid var(--slate-300);
}

/* ==================== Section Headers ==================== */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-icon {
    background: var(--indigo-100);
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: var(--indigo-600);
}

.section-icon svg {
    width: 24px;
    height: 24px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--slate-900);
    letter-spacing: -0.025em;
}

/* ==================== History View ==================== */
.history-section {
    margin-bottom: 2.5rem;
}

/* Accuracy Card */
.accuracy-card {
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: box-shadow 0.3s;
}

.accuracy-card:hover {
    box-shadow: var(--shadow-lg);
}

.accuracy-card-header {
    background: var(--slate-900);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--slate-800);
    position: relative;
    overflow: hidden;
}

.accuracy-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 100%;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.1), transparent);
    transform: skewX(12deg);
}

.accuracy-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 10;
}

.accuracy-trophy-icon {
    background: var(--yellow-500);
    padding: 0.375rem;
    border-radius: 0.5rem;
    color: var(--slate-900);
    box-shadow: 0 4px 10px rgba(234, 179, 8, 0.5);
}

.accuracy-trophy-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 3;
}

.accuracy-header-title {
    font-weight: 700;
    color: white;
    font-size: 1.125rem;
    line-height: 1;
}

.accuracy-header-subtitle {
    color: var(--slate-400);
    font-size: 0.75rem;
}

.accuracy-header-date {
    font-family: 'Courier New', monospace;
    color: var(--slate-400);
    font-size: 0.75rem;
    background: var(--slate-800);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Actual Result */
.actual-result-section {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(to bottom, var(--slate-50), white);
    border-bottom: 1px solid var(--slate-100);
}

.actual-result-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.actual-result-bar {
    width: 4px;
    height: 16px;
    background: var(--slate-900);
    border-radius: 9999px;
}

.actual-result-text {
    font-size: 0.75rem;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.actual-result-balls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Model Hits List */
.model-hits-list {
    padding: 1rem 1.5rem;
}

.model-hit-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.model-hit-item:last-child {
    margin-bottom: 0;
}

.model-hit-connector {
    position: absolute;
    left: 11px;
    top: 32px;
    bottom: -24px;
    width: 1px;
    background: var(--slate-100);
    z-index: 0;
}

.model-hit-item:last-child .model-hit-connector {
    display: none;
}

.model-hit-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
    z-index: 10;
}

.model-hit-number {
    margin-top: 0.25rem;
    min-width: 24px;
    height: 24px;
    border-radius: 9999px;
    background: white;
    border: 2px solid var(--indigo-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #818cf8;
}

.model-hit-content {
    flex: 1;
}

.model-hit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.model-hit-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--slate-800);
}

.high-hit-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 10px;
    font-weight: 700;
    background: #fef2f2;
    color: var(--red-600);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid #fee2e2;
}

.high-hit-badge svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
}

/* Prediction Groups in History */
.prediction-groups {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.prediction-group-row {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.prediction-group-row.winning {
    background: rgba(224, 231, 255, 0.5);
    border-color: var(--indigo-100);
    box-shadow: var(--shadow-sm);
}

.prediction-group-row:not(.winning) {
    background: var(--slate-50);
}

.prediction-group-row:not(.winning):hover {
    border-color: var(--slate-200);
}

.prediction-group-balls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.prediction-group-strategy {
    font-weight: 700;
    font-size: 10px;
    color: var(--slate-400);
    text-transform: uppercase;
    width: 64px;
    flex-shrink: 0;
}

.prediction-group-balls-list {
    display: flex;
    gap: 0.375rem;
}

.mini-ball {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 10px;
    transition: all 0.2s;
}

.mini-ball.hit {
    background: var(--red-500);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.mini-ball:not(.hit) {
    background: white;
    color: var(--slate-400);
    border: 1px solid var(--slate-100);
}

.mini-ball.blue.hit {
    background: var(--blue-600);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.prediction-group-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-left: 0.25rem;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.stat-value {
    font-weight: 800;
    font-size: 0.875rem;
}

.stat-value.has-hit {
    color: var(--red-600);
}

.stat-value.no-hit {
    color: var(--slate-300);
}

.stat-value.blue-hit {
    color: var(--blue-600);
}

.stat-label {
    font-size: 10px;
    color: var(--slate-400);
}

.stat-divider {
    width: 1px;
    height: 12px;
    background: var(--slate-200);
}

/* History Table */
.history-table-container {
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.history-table-scroll {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
}

.history-table thead {
    background: rgba(248, 250, 252, 0.8);
    border-bottom: 1px solid var(--slate-200);
}

.history-table th {
    padding: 1rem 1.5rem;
    font-weight: 700;
    color: var(--slate-600);
    white-space: nowrap;
}

.history-table tbody {
    divide-y: 1px solid var(--slate-100);
}

.history-table tr {
    transition: background-color 0.2s;
}

.history-table tbody tr:hover {
    background: var(--slate-50);
}

.history-table td {
    padding: 1rem 1.5rem;
}

.history-table .period-cell {
    font-weight: 700;
    color: var(--indigo-600);
}

.history-table tbody tr:hover .period-cell {
    color: var(--indigo-700);
}

.history-table .date-cell {
    color: var(--slate-500);
    font-family: 'Courier New', monospace;
}

.history-table .balls-cell {
    display: flex;
    gap: 0.375rem;
    transform: scale(0.9);
    transform-origin: left;
}

/* ==================== Chart Container ==================== */
.chart-container {
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.chart-icon {
    color: var(--red-500);
}

.chart-icon svg {
    width: 20px;
    height: 20px;
}

.chart-title-wrapper h3 {
    font-weight: 700;
    color: var(--slate-800);
    font-size: 1.125rem;
}

.chart-description {
    font-size: 0.75rem;
    color: var(--slate-400);
}

.chart-canvas {
    height: 350px;
    width: 100%;
}

/* ==================== Footer ==================== */
.footer {
    position: relative;
    z-index: 10;
    background: white;
    border-top: 1px solid var(--slate-200);
    padding: 2.5rem 0;
    margin-bottom: 64px;
}

@media (min-width: 768px) {
    .footer {
        margin-bottom: 0;
    }
}

.footer-content {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.footer-copyright {
    color: var(--slate-400);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.footer-disclaimer {
    font-size: 0.75rem;
    color: var(--slate-300);
}

/* ==================== Disclaimer Card ==================== */
.disclaimer-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--slate-400);
    font-size: 0.75rem;
    margin-top: 2rem;
    background: rgba(248, 250, 252, 0.5);
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.disclaimer-card svg {
    width: 14px;
    height: 14px;
}

/* ==================== Drawn Status Banner ==================== */
.drawn-status-banner {
    background: white;
    border-left: 4px solid #10b981;
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    grid-column: 1 / -1; /* 跨越所有列 */
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.drawn-status-icon {
    background: #d1fae5;
    padding: 0.5rem;
    border-radius: 9999px;
    color: #059669;
    flex-shrink: 0;
}

.drawn-status-icon svg {
    width: 20px;
    height: 20px;
}

.drawn-status-content {
    flex: 1;
}

.drawn-status-title {
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.drawn-status-subtitle {
    font-size: 0.875rem;
    color: var(--slate-600);
}

.drawn-status-balls {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    align-items: center;
}

.mini-result-ball {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.mini-result-ball.red {
    background: linear-gradient(135deg, var(--red-500), var(--red-600));
}

.mini-result-ball.blue {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
}

/* ==================== Model Card Enhancements ==================== */
.model-card-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 10;
}

.model-best-hit-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fbbf24;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #92400e;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 4px 8px rgba(251, 191, 36, 0.5);
    }
}

.model-best-hit-badge svg {
    width: 14px;
    height: 14px;
    color: #f59e0b;
}

/* ==================== Strategy Group Enhancements ==================== */
.strategy-group-badge.best {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #fbbf24;
    color: #92400e;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.strategy-hit-stats {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}

.hit-stat {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid;
}

.hit-stat.red {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.hit-stat.blue {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #2563eb;
}

.hit-stat.miss {
    background: var(--slate-100);
    border-color: var(--slate-300);
    color: var(--slate-500);
}

/* ==================== Analysis Page Enhancements ==================== */
/* Prize Rules Card */
.prize-rules-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    overflow: hidden;
}

.prize-rules-header {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #fbbf24;
}

.prize-rules-icon {
    background: white;
    padding: 0.5rem;
    border-radius: 9999px;
    color: #f59e0b;
    flex-shrink: 0;
}

.prize-rules-icon svg {
    width: 20px;
    height: 20px;
}

.prize-rules-header h3 {
    font-weight: 700;
    color: #92400e;
    font-size: 1.125rem;
}

.prize-rules-content {
    padding: 1.5rem;
}

.prize-rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.prize-rule-item {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

.prize-rule-item:hover {
    border-color: var(--blue-500);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.prize-level {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 0.5rem;
}

.prize-condition {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--blue-600);
    margin-bottom: 0.375rem;
}

.prize-desc {
    font-size: 0.75rem;
    color: var(--slate-600);
}

.prize-rules-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #dbeafe;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--blue-500);
}

.prize-rules-note svg {
    width: 18px;
    height: 18px;
    color: var(--blue-600);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.prize-rules-note span {
    font-size: 0.875rem;
    color: var(--slate-700);
    line-height: 1.5;
}

/* Statistics Cards Grid */
.stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.stat-card-icon.red {
    background: linear-gradient(135deg, var(--red-500), var(--red-600));
}

.stat-card-icon.blue {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
}

.stat-card-icon.purple {
    background: linear-gradient(135deg, #a855f7, #9333ea);
}

.stat-card-icon.yellow {
    background: linear-gradient(135deg, #facc15, #f59e0b);
}

.stat-card-content {
    flex: 1;
}

.stat-card-label {
    font-size: 0.75rem;
    color: var(--slate-500);
    margin-bottom: 0.25rem;
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--slate-900);
}

/* Analysis Charts Grid */
.analysis-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .analysis-charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .analysis-charts-grid .chart-container.full-width {
        grid-column: 1 / -1;
    }
}

/* ==================== Responsive Design ==================== */
@media (min-width: 640px) {
    .strategy-header {
        flex-direction: row;
        align-items: center;
    }

    .prediction-group-row {
        flex-direction: row;
        align-items: center;
    }

    .prediction-group-balls {
        margin-bottom: 0;
    }

    .prediction-group-stats {
        padding-left: 0;
    }
}

/* ==================== Utilities ==================== */
.hidden {
    display: none !important;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Icons - Using inline SVG data URLs for simplicity */
.icon-layout-dashboard {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/></svg>');
}
