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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #030303;
    color: rgba(255, 255, 255, 0.87);
    min-height: 100vh;
    letter-spacing: -0.02em;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.header {
    margin-bottom: 40px;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.header h1 {
    font-size: 42px;
    font-weight: 600;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #FFFFFF 0%, #A1A1AA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 16px;
    color: #A1A1AA;
    font-weight: 400;
}

.controls {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    align-items: center;
    flex-wrap: wrap;
}

.date-picker {
    background: #0A0A0A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.87);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.date-picker:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.date-picker:focus {
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.tabs {
    display: flex;
    gap: 8px;
    background: #0A0A0A;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.tabs::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

.tab {
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #A1A1AA;
    border: none;
    background: transparent;
    position: relative;
    z-index: 1;
}

.tab:hover {
    color: rgba(255, 255, 255, 0.87);
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    background: rgba(99, 102, 241, 0.15);
    color: #FFFFFF;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.card {
    background: #0A0A0A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #0A0A0A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.2s ease;
    position: relative;
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 13px;
    color: #A1A1AA;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #FFFFFF;
}

.stat-value.highlight {
    background: linear-gradient(135deg, #6366F1, #A855F7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: rgba(99, 102, 241, 0.1);
}

th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.87);
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.stock-code {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    font-size: 13px;
    color: #6366F1;
    font-weight: 500;
}

.stock-name {
    font-weight: 500;
}

.reason-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 6px;
    font-size: 12px;
    color: #A855F7;
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.period-tag {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    font-size: 12px;
    color: #A1A1AA;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #A1A1AA;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error {
    text-align: center;
    padding: 40px;
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    margin: 20px 0;
}

.empty {
    text-align: center;
    padding: 60px 20px;
    color: #A1A1AA;
}

.refresh-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    border: none;
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

.refresh-btn:active {
    transform: translateY(0);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.badge-sh {
    background: rgba(99, 102, 241, 0.2);
    color: #6366F1;
}

.badge-sz {
    background: rgba(168, 85, 247, 0.2);
    color: #A855F7;
}

.badge-bj {
    background: rgba(236, 72, 153, 0.2);
    color: #EC4899;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 32px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        flex: 1;
        min-width: calc(50% - 4px);
    }

    th, td {
        padding: 12px 14px;
        font-size: 13px;
    }

    .reason-tag {
        max-width: 200px;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.rules-section {
    margin-top: 50px;
    margin-bottom: 40px;
}

.rules-box {
    padding: 30px;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
}

.rules-box h3 {
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rules-box h3::before {
    content: '📋';
}

.rules-box ul {
    list-style: none;
    padding: 0;
}

.rules-box li {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.rules-box li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #6366F1;
    font-weight: bold;
}

.rules-box li strong {
    color: #A855F7;
    font-weight: 600;
}

.footer {
    padding: 40px 20px;
    background: #0A0A0A;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-copyright {
    font-size: 14px;
    color: #A1A1AA;
    margin-bottom: 12px;
}

.footer-copyright a {
    color: #6366F1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-copyright a:hover {
    color: #8B5CF6;
}

.footer-disclaimer {
    font-size: 12px;
    color: rgba(161, 161, 170, 0.7);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .rules-section {
        margin-top: 40px;
    }

    .rules-box {
        padding: 20px 15px;
    }

    .rules-box li {
        font-size: 12px;
    }

    .footer {
        padding: 30px 15px;
    }
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', monospace;
}

.rank-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rank-silver {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    color: #000;
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
}

.rank-bronze {
    background: linear-gradient(135deg, #CD7F32, #B87333);
    color: #000;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
}

.rank-normal {
    background: rgba(99, 102, 241, 0.15);
    color: #6366F1;
}

.pct-up {
    color: #EF4444;
    font-weight: 500;
}

.pct-down {
    color: #10B981;
    font-weight: 500;
}

.industry-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    font-size: 12px;
    color: #A1A1AA;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .rank-badge {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .industry-tag {
        max-width: 80px;
        font-size: 11px;
    }
}
