/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 标题样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 10px;
}

header p {
    color: #7f8c8d;
    font-size: 16px;
}

/* 搜索区域样式 */
.search-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.search-container {
    margin-bottom: 20px;
}

.search-row {
    display: flex;
    gap: 8px;
}

#searchInput {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    border-color: #3498db;
}

#searchScope {
    padding: 12px 12px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    outline: none;
    background-color: #fff;
    transition: border-color 0.3s ease;
    cursor: pointer;
    min-width: 150px;
}

#searchScope:focus {
    border-color: #3498db;
}

#searchBtn {
    padding: 12px 24px;
    font-size: 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#searchBtn:hover {
    background-color: #2980b9;
}

/* 统计区域样式 */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.stat-list {
    list-style: none;
}

.stat-list li {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.stat-item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-item a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remove-btn {
    margin-left: 10px;
    padding: 4px 8px;
    font-size: 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    opacity: 0.7;
}

.remove-btn:hover {
    background-color: #c0392b;
    opacity: 1;
}

.stat-list a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.stat-count {
    background-color: #ecf0f1;
    color: #7f8c8d;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
}

/* 结果区域样式 */
.results-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.results-header h3 {
    color: #2c3e50;
    font-size: 18px;
}

#resultCount {
    color: #7f8c8d;
    font-size: 14px;
}

#resultsList {
    list-style: none;
}

.result-item {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.result-item:hover {
    background-color: #f9f9f9;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item a {
    color: #3498db;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.result-item a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.result-info {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 5px;
}

.result-fields {
    color: #95a5a6;
    font-size: 13px;
}

/* 加载状态样式 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #7f8c8d;
}

/* 空结果样式 */
.empty-results {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    #searchInput {
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    #searchBtn {
        border-radius: 4px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: fadeIn 0.3s ease;
}

.stat-card {
    animation: fadeIn 0.3s ease;
}

/* 浮窗样式 */
.modal-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none; /* 允许点击穿透到背景 */
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(1px);
    pointer-events: auto; /* 只让遮罩层可点击 */
}

.modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    max-height: 90vh;
    pointer-events: auto; /* 浮窗内容可点击 */
    z-index: 10000; /* 确保浮窗在最上层 */
}



.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #3498db;
    color: white;
    border-radius: 8px 8px 0 0;
    user-select: none;
    cursor: move;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: 8px;
}

.modal-btn {
    background-color: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.modal-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-btn-icon {
    font-size: 14px;
    line-height: 1;
}

.modal-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 版权信息样式 */
.footer {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    margin-top: 30px;
    text-align: center;
    font-size: 14px;
    width: 100%;
    position: relative;
    bottom: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-item {
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.footer-item:hover {
    opacity: 1;
}

/* 高亮样式 */
.highlight {
    background-color: #fff200;
    color: #333;
    font-weight: 500;
    padding: 2px 4px;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.highlight:hover {
    background-color: #ffd700;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}