/**
 * 微光小站 - 主样式表
 */

/* ==================== 变量定义 ==================== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --card-shadow: 0 2px 10px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
}

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background: #f5f5f5;
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* ==================== 顶部导航 ==================== */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .navbar {
    padding: 0.8rem 0;
}

.site-header .navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.25rem;
    color: #fff !important;
}

.site-header .navbar-brand img {
    border-radius: 8px;
}

.site-header .nav-link {
    color: rgba(255,255,255,0.85) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 5px;
    transition: var(--transition);
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.15);
}

.site-header .form-control {
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
}

/* ==================== 公告栏 ==================== */
.announcement-bar {
    background: #fff3cd;
    border-bottom: 1px solid #ffc107;
    padding: 8px 0;
}

.announcement-content {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #856404;
}

.announcement-content i {
    color: #ffc107;
}

/* ==================== 主内容区 ==================== */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 20px 0;
}

/* ==================== 区块标题 ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid var(--primary-color);
}

.section-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.section-header h4 i {
    color: var(--primary-color);
    margin-right: 8px;
}

/* ==================== 网站卡片 ==================== */
.site-card {
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.site-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    color: inherit;
}

.site-card.hot-card {
    border: 2px solid #ffd700;
    background: linear-gradient(135deg, #fff 0%, #fffef0 100%);
}

.site-card .site-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
}

.site-card .site-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.site-card .site-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-card .site-desc {
    font-size: 12px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.site-card .site-stats {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.site-card.small-card {
    padding: 10px;
}

.site-card.small-card .site-icon {
    width: 32px;
    height: 32px;
}

.site-card.small-card .site-name {
    font-size: 14px;
}

/* ==================== 详情页 ==================== */
.detail-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--card-shadow);
}

.detail-favicon {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    object-fit: contain;
}

.detail-tags .badge {
    font-weight: normal;
}

/* ==================== 热门榜单 ==================== */
.hot-list-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    color: inherit;
}

.hot-list-item:last-child {
    border-bottom: none;
}

.hot-list-item:hover {
    background: #f8f9fa;
}

.hot-rank {
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    background: #e9ecef;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
}

.hot-rank.top {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
}

.hot-icon {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    margin-right: 10px;
}

.hot-info {
    flex: 1;
}

.hot-name {
    font-weight: 500;
    font-size: 14px;
}

/* ==================== 分类区块 ==================== */
.category-block {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.category-block .section-header {
    border-radius: 0;
}

/* 侧边栏分类图标间距 */
.list-group-item i {
    margin-right: 8px;
}

/* ==================== 页脚 ==================== */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 50px;
}

.footer-brand {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* ==================== 二维码 ==================== */
.qrcode-container {
    display: inline-block;
    text-align: center;
}

.site-qrcode {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ICP备案信息样式 */
.text-xs {
    font-size: 11px;
}

.ml-1 {
    margin-left: 4px;
}

/* ==================== 广告位 ==================== */
.ad-content {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.ad-content img {
    max-width: 100%;
    height: auto;
}

.ad-banner {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

.ad-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.ad-banner a {
    text-decoration: none;
}

/* ==================== 响应式 ==================== */
@media (max-width: 992px) {
    .site-header .navbar-brand span {
        display: none;
    }
    
    .main-content {
        padding: 15px 0;
    }
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .site-card {
        padding: 12px;
    }
    
    .site-card .site-icon {
        width: 40px;
        height: 40px;
    }
    
    .detail-card {
        padding: 15px;
    }
    
    .detail-favicon {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 576px) {
    .site-card .site-desc {
        display: none;
    }
    
    .hot-section .col-6 {
        width: 50%;
    }
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-card {
    animation: fadeIn 0.3s ease;
}

/* ==================== 工具类 ==================== */
.text-decoration-none:hover {
    text-decoration: none !important;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}
