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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.nav-btn.active,
.nav-btn:hover {
    background: #667eea;
    color: white;
}

/* 主要内容区域 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-title {
    text-align: center;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 搜索容器样式 - 去掉背景 */
.search-container {
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
}

#search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: #333;
}

#search-input::placeholder {
    color: rgba(102, 126, 234, 0.7);
}

#search-input:focus {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.search-button {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.clear-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.clear-button:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #666;
}

.search-results-info {
    text-align: center;
    color: white;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

/* 标签页内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 角色网格布局 */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* 角色卡片样式 */
.character-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.character-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.character-card.highlight {
    border: 2px solid #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.character-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #667eea;
    position: relative;
}

.character-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.character-race {
    color: #667eea;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* NPC卡片特殊样式 */
.npc-card::before {
    background: linear-gradient(90deg, #ff6b6b, #ee5a24);
}

.npc-card .character-avatar {
    border-color: #ff6b6b;
}

.npc-card .character-race {
    color: #ff6b6b;
}

/* 空状态样式 - 确保居中 */
.empty-state {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(5px);
    margin: 2rem auto;
    max-width: 500px;
    grid-column: 1 / -1;
}

/* 当网格中只有空状态时，确保它占据整个网格 */
.character-grid .empty-state {
    grid-column: 1 / -1;
    justify-self: center;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.close:hover {
    color: #667eea;
    background: white;
}

.character-detail {
    display: flex;
    padding: 2rem;
    gap: 2rem;
}

.character-detail .character-avatar {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    border: 6px solid #667eea;
}

.character-info {
    flex: 1;
}

.character-info h2 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
}

.info-section {
    margin-bottom: 1.5rem;
}

.info-section h3 {
    color: #667eea;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid #667eea;
    padding-left: 0.5rem;
}

.info-section p,
.info-section div {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* 好朋友和食物列表样式 */
.friends-list,
.food-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.friend-item,
.food-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    min-width: 80px;
}

.friend-item:hover,
.food-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.friend-avatar,
.food-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
    border: 2px solid #667eea;
}

.food-image {
    border-radius: 8px;
}

.friend-name,
.food-name {
    font-size: 0.85rem;
    color: #333;
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
}

/* 旧的标签样式保留作为备用 */
.friend-tag,
.food-tag {
    background: #f0f0f0;
    color: #667eea;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    border: 1px solid #667eea;
}

/* NPC特殊样式 */
.npc-card {
    border-left: 4px solid #764ba2;
}

.npc-card .character-avatar {
    border-color: #764ba2;
}

.npc-card .character-race {
    color: #764ba2;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .character-detail {
        flex-direction: column;
        padding: 1rem;
    }
    
    .character-detail .character-avatar {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }
    
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .friends-list,
    .food-list {
        gap: 0.8rem;
    }
    
    .friend-item,
    .food-item {
        min-width: 70px;
        padding: 0.6rem;
    }
    
    .friend-avatar,
    .food-image {
        width: 40px;
        height: 40px;
    }
    
    .friend-name,
    .food-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .character-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    margin: 2rem 0;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

/* 空状态样式 */
.empty-state {
    text-align: center;
    color: white;
    font-size: 1.1rem;
    margin: 3rem 0;
    opacity: 0.8;
}