/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #87CEEB;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-logo img {
    width: 40px;
    height: 40px;
    margin-right: 20px;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #007bff;
}

/* 登录按钮样式 */
.nav-menu a.login-btn {
    background-color: #66aae9; /* 浅蓝色背景 */
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-menu a.login-btn:hover {
    background-color: #295ce7; /* 悬停时稍深的蓝色 */
    color: #e6eaee;
}

/* 用户下拉菜单样式 */
.user-dropdown {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.user-info:hover {
    background-color: #f8f9fa;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.username {
    font-weight: 500;
    color: #333;
}

.dropdown-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.user-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.user-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s ease;
    border-radius: 0;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

/* 主要内容区域 */
.main-content {
    margin-top: 60px;
    min-height: calc(100vh - 120px);
}

/* 消息提示样式 */
.flash-messages {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.alert {
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 页脚样式 */
.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

/* 表单样式 */
.form-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-submit:hover {
    background-color: #0056b3;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 10px 20px;
    }
    
    .nav-menu {
        margin-top: 10px;
        gap: 1rem;
    }
    
    .main-content {
        margin-top: 100px;
    }
}

/* 导航栏搜索样式 */
.nav-search {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-form {
    position: relative;
    width: 100%;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background: #fff;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: #333;
}

.search-input::placeholder {
    color: #6c757d;
}

.search-btn {
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    color: #007bff;
}

/* 搜索结果下拉框 */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
}

.search-loading {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-item:hover {
    background-color: #f8f9fa;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: contain;
    background: #f8f9fa;
}

.search-item-info {
    flex: 1;
}

.search-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.search-item-desc {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.3;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

/* 响应式设计更新 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 10px 20px;
        gap: 10px;
    }
    
    .nav-search {
        order: 2;
        margin: 0;
        max-width: 100%;
        width: 100%;
    }
    
    .nav-menu {
        order: 3;
        margin-top: 0;
        gap: 1rem;
    }
    
    .main-content {
        margin-top: 140px;
    }
}

@media (max-width: 480px) {
    .nav-search {
        margin: 10px 0;
    }
    
    .search-input {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

/* 搜索类型选择器 */
.search-type-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    background: white;
    font-size: 14px;
    outline: none;
}

.search-input {
    border-radius: 0;
    border-left: none;
}

.search-btn {
    border-radius: 0 4px 4px 0;
}

/* 搜索结果分组 */
.search-section {
    margin-bottom: 15px;
}

.search-section h4 {
    margin: 0 0 8px 0;
    padding: 8px 12px;
    background: #f5f5f5;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 页面图标 */
.page-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

/* 关键词高亮 */
.highlight {
    background: #fff3cd;
    color: #856404;
    padding: 1px 2px;
    border-radius: 2px;
}

/* 增强的搜索样式 */
.search-type-select {
    padding: 10px 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: #333;
    border-right: 1px solid #e9ecef;
    min-width: 80px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: #333;
}

.search-btn {
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 搜索结果增强样式 */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

/* 搜索项样式 */
.search-item {
    padding: 16px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.search-item:hover,
.search-item.selected {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    flex-shrink: 0;
}

.search-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.search-item-content {
    flex: 1;
    min-width: 0;
}

.search-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.3;
}

.search-item-desc {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    /* -webkit-line-clamp: 2; */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-item-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-tag {
    font-size: 10px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
}

.search-item-details {
    font-size: 11px;
    color: #28a745;
    margin-top: 2px;
}

.search-item-breadcrumb {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

.breadcrumb-separator {
    margin: 0 4px;
    color: #dee2e6;
}

.search-item-action {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 16px;
}

/* 搜索分组样式 */
.search-section {
    margin-bottom: 8px;
}

.search-section h4 {
    margin: 0;
    padding: 12px 16px 8px;
    background: linear-gradient(90deg, #f8f9fa 0%, #fff 100%);
    font-size: 12px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-icon {
    font-size: 14px;
}

/* 特殊状态样式 */
.search-loading {
    padding: 24px;
    text-align: center;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-error {
    padding: 24px;
    text-align: center;
    color: #dc3545;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.error-icon {
    font-size: 24px;
}

.search-no-results {
    padding: 32px 24px;
    text-align: center;
    color: #6c757d;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-results-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.no-results-desc {
    font-size: 14px;
    margin-bottom: 16px;
}

.no-results-suggestions {
    text-align: left;
    max-width: 300px;
    margin: 0 auto;
}

.no-results-suggestions p {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.no-results-suggestions ul {
    list-style: none;
    padding: 0;
}

.no-results-suggestions li {
    padding: 4px 0;
    font-size: 13px;
    position: relative;
    padding-left: 16px;
}

.no-results-suggestions li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: #007bff;
}

/* 查看更多样式 */
.search-more {
    padding: 12px 16px;
    border-top: 1px solid #f1f3f4;
    background: linear-gradient(90deg, #f8f9fa 0%, #fff 100%);
}

.search-more-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #007bff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.search-more-link:hover {
    color: #0056b3;
    text-decoration: none;
}

.more-icon {
    font-size: 14px;
}

/* 搜索建议和历史样式 */
.suggestion-item,
.history-item {
    padding: 12px 16px;
}

.suggestion-icon,
.history-icon {
    font-size: 16px;
}

.remove-history {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.remove-history:hover {
    background-color: #f8d7da;
}

.remove-icon {
    font-size: 12px;
}

/* 关键词高亮增强 */
.highlight {
    background: linear-gradient(120deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* 图标样式 */
.page-icon,
.element-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon {
    transition: transform 0.2s ease;
}

.search-item:hover .action-icon {
    transform: scale(1.1);
}

/* 响应式设计增强 */
@media (max-width: 768px) {
    .search-results {
        max-height: 400px;
        border-radius: 0 0 8px 8px;
    }
    
    .search-item {
        padding: 12px;
    }
    
    .search-item-icon {
        width: 32px;
        height: 32px;
    }
    
    .search-section h4 {
        padding: 10px 12px 6px;
        font-size: 11px;
    }
    
    .no-results-icon {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .search-input-group {
        border-radius: 20px;
    }
    
    .search-type-select {
        min-width: 60px;
        font-size: 12px;
    }
    
    .search-input {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .search-results {
        border-radius: 0 0 6px 6px;
    }
}

/* 滚动条样式 */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}