:root {
    --primary: #2563eb;
    --secondary: #06b6d4;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --dark: #1f2937;
    --cloud-light: #f3f4f6;
    --cloud-medium: #e5e7eb;
    --cloud-dark: #d1d5db;
    --purple: #8b5cf6;
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: url('https://acg.yaohud.cn/dm/adaptive.php') center/cover no-repeat fixed;
    color: var(--dark);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    z-index: -5;
}

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

@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
}

@media (min-width: 1920px) {
    .container {
        max-width: 1800px;
    }
}

/* ========== 背景装饰 ========== */
.bg-decoration {
    position: fixed;
    inset: 0;
    z-index: -10;
    overflow: hidden;
    pointer-events: none;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(5rem);
    animation: float 20s ease-in-out infinite;
}

.bg-circle-1 {
    top: -10rem;
    right: -10rem;
    width: 30rem;
    height: 30rem;
    background: rgba(37, 99, 235, 0.08);
}

.bg-circle-2 {
    top: 33%;
    left: -5rem;
    width: 22rem;
    height: 22rem;
    background: rgba(16, 185, 129, 0.06);
    animation-delay: -5s;
}

.bg-circle-3 {
    bottom: 0;
    right: 25%;
    width: 25rem;
    height: 25rem;
    background: rgba(245, 158, 11, 0.05);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -20px) scale(1.05); }
    50% { transform: translate(-10px, 10px) scale(0.95); }
    75% { transform: translate(-20px, -10px) scale(1.02); }
}

/* ========== 玻璃效果 ========== */
.glass-effect {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.gradient-bg {
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

.gradient-bg:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
}

#showAllBtn {
    background: var(--gradient-success);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

#showAllBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
}

/* ========== 图标样式 ========== */
.stat-card i {
    font-size: 1.25rem;
}

/* ========== 卡片样式 ========== */
.stat-card {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.stat-card .text-3xl {
    min-height: 2.75rem;
    line-height: 1.3;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card:nth-child(1)::before { background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%); }
.stat-card:nth-child(2)::before { background: linear-gradient(135deg, #f87171 0%, #db2777 100%); }
.stat-card:nth-child(3)::before { background: linear-gradient(135deg, #4ade80 0%, #059669 100%); }
.stat-card:nth-child(4)::before { background: linear-gradient(135deg, #f97316 0%, #ca8a04 100%); }
.stat-card:nth-child(5)::before { background: linear-gradient(135deg, #818cf8 0%, #7c3aed 100%); }

.stat-card:hover,
.card-hover:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-8px) scale(1.02);
}

.card-hover {
    transition: all 0.3s ease;
}

/* ========== 动画 ========== */
.pulse-animation {
    animation: pulse 2s infinite;
}

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

/* ========== 按钮 ========== */
.mobile-detail-btn {
    background: rgba(22, 93, 255, 0.1);
    color: var(--primary);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.3s;
}

.mobile-detail-btn:hover {
    background: rgba(22, 93, 255, 0.2);
}

.detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af !important;
    border: 1px solid #93c5fd;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
    min-width: auto;
    justify-content: center;
}

.detail-btn:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
    border-color: #60a5fa;
    color: #1e3a8a !important;
}

.detail-btn:active {
    background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 100%);
}

/* ========== 图表 ========== */
.chart-container {
    width: 100% !important;
    height: 350px !important;
    max-height: 350px !important;
    overflow: visible !important;
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
}

.chart-top-title {
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: var(--dark);
    z-index: 10;
    margin: 0;
    padding: 0;
}

.chart-container canvas {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    border-radius: 8px;
}

canvas#attackChart {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ========== 模态框 ========== */
#detailModal {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    overflow: hidden;
}

#detailModal.flex {
    opacity: 1;
    visibility: visible;
}

#detailModal .bg-white {
    max-height: 90vh !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#modalContent {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto !important;
    scroll-behavior: smooth;
    flex: 1;
    min-height: 0;
    padding: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #f1f1f1;
}

#modalContent::-webkit-scrollbar {
    width: 6px;
}

#modalContent::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#modalContent::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

#modalContent::-webkit-scrollbar-thumb:hover {
    background: #0e42c4;
}

.modal-close-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: pointer;
    transition: background-color 0.3s;
}

.modal-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    padding: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.pagination-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    border: none;
    background: var(--gradient-primary);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.pagination-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
    box-shadow: none;
    transform: none;
}

.page-number {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    border: none;
    background: white;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.page-number:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
}

.page-number.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.pagination-info {
    margin: 0 1rem;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .chart-container {
        height: 250px !important;
        max-height: 250px !important;
    }

    .chart-top-title {
        font-size: 12px;
        top: 0;
    }

    #chartSection .bg-white {
        padding: 1rem !important;
    }
}

/* ========== 表格美化 ========== */
.table-wrapper {
    border-radius: 1rem;
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 0;
    position: relative;
    display: block;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #f1f1f1;
}

.table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #0e42c4;
}

table {
    width: 100%;
    table-layout: auto;
    min-width: 1000px;
    border-collapse: collapse;
}

table th,
table td {
    white-space: nowrap;
}

table th:first-child,
table td:first-child {
    min-width: 100px;
}

table thead tr {
    background: var(--gradient-primary);
}

table thead th {
    color: white !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 0.6rem 0.4rem !important;
    text-align: center;
    background: var(--gradient-primary);
}

table thead th:last-child {
    position: sticky;
    right: 0;
    z-index: 10;
    background: var(--gradient-primary);
    text-align: center;
}

table tbody tr {
    transition: all 0.3s ease;
}

table tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

table tbody td {
    padding: 0.5rem 0.4rem !important;
    vertical-align: middle;
}

table tbody td:last-child {
    position: sticky;
    right: 0;
    background: inherit;
    z-index: 5;
    text-align: center;
}

table tbody tr:hover td:last-child {
    background: inherit;
}

@media (max-width: 640px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .text-3xl {
        font-size: 1.25rem !important;
    }

    .lg\\:grid-cols-5 {
        grid-template-columns: 1fr !important;
    }

    table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table th,
    table td {
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }

    table thead th:last-child {
        min-width: 80px;
        padding: 0.5rem !important;
    }

    table tbody td:last-child {
        min-width: 80px;
        padding: 0.5rem !important;
    }

    .detail-btn {
        padding: 0.2rem 0.5rem;
        font-size: 0.7rem;
    }

    .intercept-rates {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .intercept-rate-item {
        width: 100% !important;
    }

    .pagination {
        gap: 0.25rem;
    }

    .pagination-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .page-number {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }

    .pagination-info {
        margin: 0 0.5rem;
        font-size: 0.75rem;
    }

    #modalContent {
        max-height: calc(100vh - 120px) !important;
        padding: 1rem;
    }

    .flex.gap-3.justify-center.flex-wrap {
        flex-direction: column;
        align-items: center;
    }

    .flex.gap-3.justify-center.flex-wrap button {
        width: 100%;
        max-width: 280px;
    }



    footer .flex.flex-col.md\\:flex-row {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 220px !important;
        max-height: 220px !important;
    }

    #chartSection .bg-white {
        padding: 0.5rem !important;
        border-radius: 0.5rem !important;
    }

    .chart-top-title {
        font-size: 11px;
        top: 2px;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-card .text-3xl {
        font-size: 1.25rem !important;
    }

    #refreshStatus {
        font-size: 0.75rem;
    }

    #refreshStatus .px-4.py-2 {
        padding: 0.5rem 0.75rem !important;
    }
}

.attack-type-tag {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    margin: 0.1rem;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    font-size: 0.7rem;
    border-radius: 9999px;
    font-weight: 500;
    border: 1px solid #93c5fd;
    white-space: nowrap;
    line-height: 1.4;
}

.defense-type-tag {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    margin: 0.1rem;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    font-size: 0.7rem;
    border-radius: 9999px;
    font-weight: 500;
    border: 1px solid #86efac;
    white-space: nowrap;
    line-height: 1.4;
}

table tbody td:nth-child(3) {
    min-width: 100px;
    max-width: 180px;
    line-height: 1.6 !important;
}

table tbody td:nth-child(4) {
    min-width: 120px;
    max-width: 220px;
    line-height: 1.6 !important;
}

/* ========== PC端优化 ========== */
@media (min-width: 1024px) {
    .stat-card {
        padding: 2rem 2rem 2rem 1rem;
    }
    
    .stat-card .text-3xl {
        font-size: 1.5rem !important;
    }
    
    .stat-card i {
        font-size: 1.5rem;
    }
}
