/* dh1 导航主题 - 自定义CSS样式 */
/* 现代简洁导航风格 */

/* ==================== 基础重置 ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f9fafb;
    min-height: 100vh;
    color: #111827;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ==================== 布局容器 ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* ==================== 头部样式 ==================== */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #f3f4f6;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.3);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: #6b7280;
    display: none;
}

@media (min-width: 640px) {
    .logo-subtitle {
        display: block;
    }
}

/* 统计信息 */
.stats {
    display: none;
    align-items: center;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .stats {
        display: flex;
    }
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #eff6ff;
    border-radius: 9999px;
}

.stat-item svg {
    width: 20px;
    height: 20px;
    color: #2563eb;
}

.stat-item.verified {
    background: #f0fdf4;
}

.stat-item.verified svg {
    color: #16a34a;
}

.stat-text {
    font-size: 0.875rem;
    color: #374151;
}

.stat-text strong {
    color: #2563eb;
    font-weight: 600;
}

.stat-item.verified .stat-text strong {
    color: #16a34a;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: block;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.mobile-menu-btn:hover {
    background: #f3f4f6;
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
    color: #4b5563;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* 移动端菜单 */
.mobile-menu {
    display: none;
    border-top: 1px solid #f3f4f6;
    background: white;
    padding: 1rem;
}

.mobile-menu.active {
    display: block;
}

.mobile-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.mobile-stat span:first-child {
    color: #6b7280;
}

.mobile-stat strong {
    font-weight: 600;
}

.mobile-stat.primary strong {
    color: #2563eb;
}

.mobile-stat.success strong {
    color: #16a34a;
}

/* ==================== 搜索区域 ==================== */
.search-section {
    background: linear-gradient(to bottom, white, #f9fafb);
    border-bottom: 1px solid #f3f4f6;
    padding: 2rem 0;
}

.search-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .search-title {
        font-size: 2.25rem;
    }
}

.search-title .gradient {
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-subtitle {
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
}

/* 搜索框 */
.search-box {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 3.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    background: white;
    font-size: 1rem;
    color: #111827;
    transition: all 0.3s;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    color: #9ca3af;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem;
    border-radius: 9999px;
    transition: background 0.2s;
}

.search-clear:hover {
    background: #f3f4f6;
}

.search-clear svg {
    width: 20px;
    height: 20px;
    color: #9ca3af;
}

.search-clear.hidden {
    display: none;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.tab-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    transition: all 0.2s;
}

.tab-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.tab-btn.active {
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.tab-count {
    margin-left: 0.375rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    border-radius: 9999px;
    background: #f3f4f6;
}

.tab-btn.active .tab-count {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== 主内容区域 ==================== */
.main {
    flex: 1;
    padding: 2.5rem 0;
}

/* 搜索结果提示 */
.search-result {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 0.75rem;
}

.search-result.hidden {
    display: none;
}

.search-result p {
    color: #1e40af;
    font-size: 0.875rem;
}

.search-result .highlight {
    font-weight: 600;
}

/* 行业分组 */
.industry-section {
    margin-bottom: 3rem;
}

.industry-section.hidden {
    display: none;
}

.industry-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.industry-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.industry-icon svg {
    width: 20px;
    height: 20px;
    color: #2563eb;
}

.industry-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.industry-count {
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
}

/* ==================== 站点网格 ==================== */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .sites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .sites-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .sites-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==================== 站点卡片（极简版） ==================== */
.site-card {
    display: block;
    background: white;
    border: 1px solid #f3f4f6;
    border-radius: 0.5rem;
    padding: 0.875rem;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(10px);
}

.site-card.loaded {
    opacity: 1;
    transform: translateY(0);
}

.site-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.15);
    border-color: #dbeafe;
}

.site-card.hidden {
    display: none;
}

.site-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.site-card:hover .site-name {
    color: #2563eb;
}

.site-description {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.25em;
}

.site-description.empty {
    color: #9ca3af;
}

/* ==================== 懒加载占位符 ==================== */
.site-card.placeholder {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    height: 120px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==================== 页脚 ==================== */
.footer {
    background: white;
    border-top: 1px solid #f3f4f6;
    padding: 3rem 0 2rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.footer-section h4 {
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section h4 svg {
    width: 20px;
    height: 20px;
    color: #2563eb;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
    transition: all 0.2s;
}

.footer-link:hover {
    background: #eff6ff;
    border-color: #dbeafe;
    color: #2563eb;
}

.footer-link svg {
    width: 16px;
    height: 16px;
}

/* 统计数据 */
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #eff6ff;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
}

.stat-card.verified {
    background: #f0fdf4;
}

.stat-card-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: #dbeafe;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card.verified .stat-icon {
    background: #dcfce7;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
    color: #2563eb;
}

.stat-card.verified .stat-icon svg {
    color: #16a34a;
}

.stat-label {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2563eb;
}

.stat-card.verified .stat-value {
    color: #16a34a;
}

/* 版权栏 */
.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid #f3f4f6;
}

.footer-bottom-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-copyright {
    color: #4b5563;
    font-size: 0.875rem;
}

.footer-meta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.footer-meta a {
    color: #6b7280;
    transition: color 0.2s;
}

.footer-meta a:hover {
    color: #2563eb;
}

/* ==================== 返回顶部按钮 ==================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 40;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.back-to-top:hover svg {
    color: white;
}

.back-to-top svg {
    width: 20px;
    height: 20px;
    color: #6b7280;
    transition: color 0.2s;
}

/* ==================== 加载更多按钮 ==================== */
.load-more {
    text-align: center;
    padding: 2rem 0;
}

.load-more-btn {
    padding: 0.75rem 2rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: #f9fafb;
    border-color: #2563eb;
    color: #2563eb;
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 无结果提示 ==================== */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: #d1d5db;
}

.no-results h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: #6b7280;
}

/* ==================== Alpine.js 隐藏属性 ==================== */
[x-cloak] {
    display: none !important;
}