/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 36px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

/* 游戏标题区域 */
.game-title-section {
    text-align: center;
    margin-bottom: 32px;
    padding: 28px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
    position: relative;
    overflow: hidden;
}

.game-title-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20%, 20%); }
}

.game-title {
    font-size: 2.5em;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
}

.game-subtitle {
    font-size: 1.05em;
    opacity: 0.85;
    position: relative;
}

/* 顶部横幅 */
.top-banner {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(161, 140, 209, 0.25);
}

.banner-content {
    display: flex;
    align-items: center;
    color: #4a3070;
    font-size: 0.95em;
}

.banner-icon {
    font-size: 1.4em;
    margin-right: 14px;
}

.banner-text {
    line-height: 1.6;
}

/* 卡号搜索区域 */
.card-search-section {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 18px 22px;
    background: rgba(102, 126, 234, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.12);
    border-radius: 14px;
}

.card-search-section label {
    font-weight: 600;
    color: #5a6acf;
    white-space: nowrap;
    font-size: 0.95em;
}

.card-search-section input {
    flex: 1;
    padding: 11px 16px;
    border: 2px solid #e2e6f0;
    border-radius: 10px;
    font-size: 0.95em;
    transition: all 0.3s;
    background: white;
}

.card-search-section input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* 筛选区域 */
.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 24px;
    padding: 18px 22px;
    background: rgba(102, 126, 234, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.12);
    border-radius: 14px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: #5a6acf;
    white-space: nowrap;
    font-size: 0.95em;
}

.filter-group select,
.filter-group input {
    padding: 10px 14px;
    border: 2px solid #e2e6f0;
    border-radius: 10px;
    font-size: 0.9em;
    transition: all 0.3s;
    background: white;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.filter-group input[type="number"] {
    width: 140px;
}

/* 已选择的角色区域 */
.selected-characters {
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid rgba(255, 152, 0, 0.2);
    border-radius: 14px;
}

.selected-characters h3 {
    color: #e65100;
    margin-bottom: 14px;
    font-size: 1.2em;
    font-weight: 700;
}

.selected-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px;
}

.empty-message {
    color: #999;
    font-style: italic;
    opacity: 0.8;
}

.selected-card {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.selected-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.selected-card img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
}

.selected-card span {
    margin-top: 5px;
    font-size: 0.8em;
    color: #555;
    font-weight: 500;
}

.remove-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef5350;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(239, 83, 80, 0.4);
}

.remove-badge:hover {
    background: #c62828;
    transform: scale(1.15);
}

/* 搜索按钮 */
.search-btn {
    padding: 14px 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 18px rgba(102, 126, 234, 0.35);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

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

.main-search-btn {
    display: block;
    width: 100%;
    margin-bottom: 28px;
    padding: 18px;
    font-size: 1.25em;
    letter-spacing: 2px;
}

/* 角色选择区域 */
.character-selection-section {
    margin-bottom: 30px;
}

.character-selection-section h2 {
    color: #5a6acf;
    margin-bottom: 18px;
    font-size: 1.6em;
    text-align: center;
    font-weight: 800;
}

.star-category {
    width: 100%;
    clear: both;
    margin-bottom: 20px;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 14px;
    padding: 10px;
    width: 100%;
}

.character-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 10px;
    background: white;
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.character-card:hover {
    transform: translateY(-4px);
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
    background: linear-gradient(135deg, rgba(102,126,234,0.05), rgba(118,75,162,0.05));
}

.character-card:active {
    transform: scale(0.95);
}

.character-card img {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 8px;
}

.character-card span {
    font-size: 0.88em;
    font-weight: 600;
    color: #444;
    text-align: center;
}

/* 搜索结果区域 */
.results-section {
    margin-top: 30px;
    padding-top: 28px;
    border-top: 2px solid rgba(102, 126, 234, 0.2);
}

.results-section h2 {
    color: #5a6acf;
    margin-bottom: 18px;
    font-size: 1.6em;
    text-align: center;
    font-weight: 800;
}

.results-count {
    text-align: center;
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
    padding: 14px;
    background: rgba(102, 126, 234, 0.06);
    border-radius: 12px;
    font-weight: 500;
}

/* 结果网格：一排一个账号 */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 结果卡片：横向布局 */
.result-card {
    display: flex;
    align-items: stretch;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    animation: slideIn 0.4s ease-out;
    overflow: hidden;
}

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

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.result-card-left {
    flex: 0 0 200px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.result-card-right {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    overflow-x: auto;
}

.result-card-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-id {
    font-size: 1.1em;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.82em;
    transition: all 0.2s;
    align-self: flex-start;
}

.copy-btn:hover {
    background: white;
    color: #667eea;
}

.result-info {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.info-tag {
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}

.character-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.character-thumbnail {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px;
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

.thumbnail-images {
    display: flex;
    gap: 4px;
}

.character-thumbnail img {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.character-thumbnail span {
    font-size: 0.72em;
    margin-top: 4px;
    opacity: 0.9;
    white-space: nowrap;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 28px;
    padding: 18px;
}

.pagination-btn {
    padding: 11px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.pagination-info {
    font-size: 1em;
    color: #5a6acf;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

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

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 16px;
        border-radius: 16px;
    }

    .game-title {
        font-size: 1.6em;
    }

    .characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }

    .character-card img {
        width: 58px;
        height: 58px;
    }

    .filter-section {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group input[type="number"] {
        width: 100%;
    }

    .card-search-section {
        flex-direction: column;
        align-items: stretch;
    }

    /* 移动端结果卡片改为纵向 */
    .result-card {
        flex-direction: column;
    }

    .result-card-left {
        flex: none;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        padding: 14px 16px;
    }

    .result-card-right {
        padding: 14px 16px;
    }

    .character-thumbnail img {
        width: 36px;
        height: 36px;
    }
}

/* 语言切换 */
.lang-switch {
    text-align: right;
    margin-bottom: 8px;
}

.lang-switch a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    padding: 4px 12px;
    border: 1px solid #667eea;
    border-radius: 16px;
    transition: all 0.2s;
}

.lang-switch a:hover {
    background: #667eea;
    color: #fff;
}

/* 加载进度条 */
.loading-bar {
    position: relative;
    width: 100%;
    height: 28px;
    background: rgba(102, 126, 234, 0.15);
    border-radius: 14px;
    margin: 12px 0;
    overflow: hidden;
}
.loading-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 14px;
    transition: width 0.3s ease;
}
.loading-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: #333;
    white-space: nowrap;
}
