* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    background-attachment: fixed;
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

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

/* 标题和作者链接样式 */
.title-container {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
}

.author-link {
    position: absolute;
    right: -180px;
    bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 18px;;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.author-link:hover {
    color: #ffcc66;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 2.8rem;
    margin: 0 50px 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    position: relative;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 15px 20px 15px 45px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    outline: none;
}

.search-icon {
    position: absolute;
    left: calc(50% - 230px);
    top: 15px;
    color: #666;
}

/* 标签样式 */
.main-tabs, .category-tabs, .ranking-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
}

.category-tabs, .ranking-tabs {
    margin: 20px 0;
}

.main-tab, .category-tab, .ranking-tab {
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    border: 2px solid transparent;
}

.category-tab, .ranking-tab {
    padding: 10px 20px;
    border-width: 1px;
    border-radius: 6px;
}

.ranking-tab {
    border: none;
}

.main-tab:hover, .category-tab:hover, .ranking-tab:hover {
    background: rgba(255, 255, 255, 0.25);
}

.main-tab.active, .category-tab.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: #ff9900;
    box-shadow: 0 0 15px rgba(255, 153, 0, 0.5);
}

.ranking-tab.active {
    background: rgba(255, 153, 0, 0.3);
}

/* 网格布局 */
.weapons-grid, .gadgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* 卡片通用样式 */
.weapon-card, .gadget-card {
    background: linear-gradient(145deg, #2c3e50, #1a2530);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.weapon-card {
    cursor: pointer;
}

.weapon-card:hover, .gadget-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4);
}

.weapon-card.selected {
    border: 2px solid #ff9900;
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.7);
}

.compare-checkbox {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 20px;
    height: 20px;
    z-index: 10;
}

/* 卡片头部 */
.card-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.weapon-name, .gadget-name {
    font-size: 1.6rem;
    margin-bottom: 5px;
    color: #ff9900;
}

.weapon-type, .gadget-type {
    font-size: 1rem;
    opacity: 0.8;
}

.gadget-build {
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(255, 153, 0, 0.3);
    color: #fff;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 5px;
}

/* 卡片主体 */
.card-body {
    padding: 20px;
}

.weapon-stats, .gadget-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.7;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: bold;
}

/* 近战伤害特殊样式 */
.melee-damage {
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: #ff9900;
    padding: 15px 0;
}

.melee-damage-info {
    font-size: 0.9rem;
    color: #ccc;
    margin-top: 5px;
}

/* 排名表格样式 */
.ranking-section {
    margin: 40px 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 25px;
}

.ranking-section.two-columns {
    display: flex !important;
    flex-direction: row !important;
    gap: 32px;
}

.ranking-column {
    flex: 1 1 0;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table th, .ranking-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-table th {
    background: rgba(255, 153, 0, 0.2);
    font-weight: bold;
}

.ranking-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

.ranking-table tr:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ranking-table .melee-weapon {
    opacity: 0.6;
    background: rgba(255, 153, 0, 0.1);
}

.ranking-table .melee-weapon td {
    font-style: italic;
}

.rank-number {
    font-weight: bold;
    text-align: center;
    width: 50px;
}

.rank-1 {
    color: gold;
    font-size: 1.2em;
}

.rank-2 {
    color: silver;
}

.rank-3 {
    color: #cd7f32; /* Bronze */
}

.ttk-value {
    font-weight: bold;
}

/* 比较功能样式 */
.compare-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    padding: 15px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.compare-btn {
    padding: 12px 25px;
    background: #ff9900;
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.compare-btn:hover {
    background: #ffaa33;
}

.compare-btn:disabled {
    background: #666;
    cursor: not-allowed;
}

.selected-count {
    font-size: 1.1rem;
    font-weight: bold;
}

.compare-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 1200px;
    max-height: 85vh;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 12px;
    z-index: 200;
    padding: 30px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.7);
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.compare-table th, .compare-table td {
    padding: 10px 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.compare-table th {
    background: rgba(255, 153, 0, 0.2);
    font-weight: bold;
    position: sticky;
    top: 0;
}

.compare-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

.best-value {
    background: rgba(0, 255, 0, 0.15);
    font-weight: bold;
}

.worst-value {
    background: rgba(255, 0, 0, 0.15);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99;
    display: none;
}

.overlay.active {
    display: block;
}

.no-results {
    text-align: center;
    grid-column: 1 / -1;
    padding: 40px;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .title-container {
        display: block;
        text-align: center;
    }
    
    .author-link {
        position: static;
        display: block;
        margin-top: 5px;
        right: auto;
        bottom: auto;
    }
    
    .weapons-grid, .gadgets-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2.2rem;
        margin: 0 20px 10px;
    }
    
    .search-input {
        padding: 12px 15px 12px 40px;
    }
    
    .search-icon {
        left: calc(50% - 165px);
    }
    
    .compare-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .compare-table {
        font-size: 0.8rem;
    }
    
    .compare-table th, .compare-table td {
        padding: 8px 6px;
    }
    
    .ranking-section.two-columns {
        flex-direction: column !important;
    }

}
