/* ====== 重置与基础 ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 游戏主题配色 */
    --bg-dark: #0a0e17;
    --bg-darker: #060911;
    --bg-card: #121828;
    --primary: #00d4ff;
    --primary-dark: #00a8cc;
    --secondary: #9d4edd;
    --accent: #ff6b6b;
    --success: #4ade80;
    --warning: #fbbf24;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --border: #2d3748;
    --shadow: rgba(0, 212, 255, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px 15px;
    background-attachment: fixed;
}

/* ====== 容器与布局 ====== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid var(--border);
    padding: 25px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
        border-radius: var(--radius);
    }
}

/* ====== 页眉 ====== */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 10px rgba(0, 212, 255, 0.2);
    position: relative;
    display: inline-block;
}

h1::after {
    content: '🎮';
    margin-left: 10px;
    font-size: 2rem;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
}

/* ====== 搜索表单 ====== */
.search-form {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 16px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.search-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--shadow);
    background: rgba(255, 255, 255, 0.08);
}

.search-form button[type="submit"] {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.search-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.search-form .clear-btn {
    padding: 14px 24px;
    background: rgba(255, 107, 107, 0.1);
    color: var(--accent);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.search-form .clear-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form input[type="text"],
    .search-form button[type="submit"],
    .search-form .clear-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ====== 统计信息 ====== */
.stats {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(157, 78, 221, 0.05));
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 15px;
}

.highlight {
    font-weight: 700;
    color: var(--primary);
    background: rgba(0, 212, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 1.1em;
}

.filter-tag {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-tag.type {
    background: rgba(157, 78, 221, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(157, 78, 221, 0.3);
}

.filter-tag.level {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

/* ====== 筛选导航 ====== */
.filter-nav {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 35px;
    border: 1px solid var(--border);
    position: relative;
}

.filter-nav h3 {
    color: var(--text);
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-nav h3::before {
    content: '🎯';
    font-size: 1.5rem;
}

.type-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.type-section {
    margin-bottom: 15px;
}

.type-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    padding: 12px 24px;
    cursor: pointer;
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.type-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.level-links {
    display: none;
    margin-left: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

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

.level-link {
    display: inline-block;
    padding: 8px 18px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary);
    border-radius: var(--radius);
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(0, 212, 255, 0.2);
    font-weight: 500;
}

.level-link:hover,
.level-link.active {
    background: var(--primary);
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.filter-nav .clear-all {
    position: absolute;
    top: 25px;
    right: 25px;
    padding: 10px 20px;
    background: rgba(255, 107, 107, 0.1);
    color: var(--accent);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-nav .clear-all:hover {
    background: rgba(255, 107, 107, 0.2);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .type-tabs {
        flex-direction: column;
    }
    
    .type-btn {
        width: 100%;
        justify-content: center;
    }
    
    .level-links {
        margin-left: 0;
    }
    
    .filter-nav .clear-all {
        position: static;
        margin-top: 20px;
        justify-content: center;
    }
}

/* ====== 表格 ====== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.01);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(157, 78, 221, 0.1));
}

thead th {
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    position: relative;
    white-space: nowrap;
}

thead th::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

thead th:hover::after {
    width: 100%;
}

tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(5px);
}

tbody td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* 特定列样式 */
td:first-child { /* ID列 */
    color: var(--text-light);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

td:nth-child(3) { /* 经验值列 */
    color: var(--success);
    font-weight: 600;
    text-align: center;
}

td:nth-child(5) { /* 尺寸列 */
    color: var(--text-light);
    font-family: 'Courier New', monospace;
}

td:nth-child(6) { /* 等级列 */
    color: var(--warning);
    font-weight: 700;
    text-align: center;
    position: relative;
}

td:nth-child(6)::before {
    content: 'Lv.';
    font-size: 0.8em;
    color: var(--text-light);
    margin-right: 2px;
}

td:nth-child(7) { /* Type列 */
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary);
    font-weight: 600;
}

/* 未知名称样式 */
.unknown {
    color: var(--text-light);
    font-style: italic;
}

.subtitle {
    color: var(--text-light);
    font-size: 0.85em;
    margin-top: 4px;
    display: block;
    font-style: italic;
}

/* 操作按钮 */
.btn-detail {
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--secondary), rgba(157, 78, 221, 0.8));
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

.btn-detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(157, 78, 221, 0.3);
}

/* 响应式表格 */
@media (max-width: 768px) {
    .table-container {
        border-radius: var(--radius);
    }
    
    table {
        min-width: 600px;
    }
    
    tbody td {
        padding: 12px 10px;
    }
    
    .btn-detail {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ====== 分页 ====== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    border: 1px solid var(--border);
    min-width: 44px;
    text-align: center;
    font-weight: 500;
}

.pagination a:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.pagination a.active {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

/* ====== 无结果提示 ====== */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-results h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text);
}

.no-results p {
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.no-results a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed var(--primary);
}

/* ====== 移动端优化 ====== */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px 10px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .search-form input[type="text"] {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .search-form button[type="submit"],
    .search-form .clear-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .stats {
        padding: 15px;
        font-size: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .filter-nav {
        padding: 20px 15px;
    }
    
    .type-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .level-link {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .pagination a {
        padding: 8px 12px;
        min-width: 36px;
        font-size: 14px;
    }
}

/* ====== 加载动画 ====== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* ====== 滚动条样式 ====== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
}