/* 必应风格主题样式 - 极致SEO优化，无外部依赖 */

body.by-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #004499;
    text-decoration: underline;
}

/* 顶部导航栏 */
.by-topbar {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.by-topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.by-topbar-left {
    display: flex;
    align-items: center;
}

.by-logo-text {
    font-size: 20px;
    font-weight: 600;
    color: #0066cc;
    margin-right: 20px;
}

.by-logo-text:hover {
    text-decoration: none;
}

.by-topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.by-nav-link {
    color: #666;
    font-size: 13px;
    padding: 4px 8px;
}

.by-nav-link:hover {
    color: #0066cc;
    text-decoration: none;
}

.by-nav-divider {
    color: #ddd;
    margin: 0 5px;
}

/* 搜索栏 */
.by-search-bar {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
}

.by-search-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.by-search-box {
    display: flex;
    max-width: 650px;
    margin: 0 auto 12px;
    border: 2px solid #0066cc;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,102,204,0.1);
}

.by-search-input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    font-size: 16px;
    outline: none;
    background: #fff;
}

.by-search-btn {
    padding: 14px 28px;
    background: #0066cc;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.by-search-btn:hover {
    background: #0052a3;
}

.by-search-tabs {
    text-align: center;
    margin-top: 10px;
}

.by-tab {
    display: inline-block;
    padding: 6px 16px;
    margin: 0 5px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}

.by-tab.active {
    background: #0066cc;
    color: #fff;
}

.by-tab:hover {
    background: #f0f0f0;
}

.by-tab.active:hover {
    background: #0052a3;
}

/* 主布局 */
.by-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.by-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* 左侧主内容区 */
.by-main-content {
    flex: 1;
    min-width: 0;
}

/* 右侧边栏 */
.by-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* 通用区块标题 */
.by-section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #0066cc;
}

/* 发现模块 - 卡片网格（瀑布流布局） */
.by-discover-section {
    margin-bottom: 30px;
}

.by-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

/* 响应式：小屏幕改为2列 */
@media (max-width: 1200px) {
    .by-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .by-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* 新闻卡片 */
.by-news-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.by-news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.by-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #333;
    text-decoration: none;
}

.by-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
    flex-shrink: 0;
}

.by-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.by-news-card:hover .by-card-image img {
    transform: scale(1.05);
}

/* 卡片内容区域自适应 */
.by-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.by-card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.by-card-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 12px 0;
    color: #333;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.by-card-link:hover .by-card-title {
    color: #0066cc;
}

.by-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
    margin-top: auto;
    padding-top: 8px;
}

.by-card-source {
    color: #666;
}

.by-card-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.by-card-likes {
    color: #666;
}

.by-card-hot {
    background: #ff4444;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

/* 文章区域 */
.by-article-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.by-ad-block {
    margin-bottom: 25px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.by-article-title {
    font-size: 32px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #333;
    line-height: 1.4;
}

.by-article-summary {
    font-size: 18px;
    color: #666;
    margin: 0 0 25px 0;
    line-height: 1.8;
    padding: 20px;
    background: #f9f9f9;
    border-left: 4px solid #0066cc;
    border-radius: 4px;
}

.by-article-body {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.by-article-body.is-spider {
    display: block;
}

.by-article-body.is-user {
    display: block;
}

.by-article-body p {
    margin: 0 0 18px 0;
}

.by-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 20px 0;
}

/* 相关推荐 */
.by-related-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.by-related-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.by-related-item {
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
    transition: background 0.2s;
}

.by-related-item:hover {
    background: #f0f0f0;
}

.by-related-item a {
    color: #333;
    font-size: 15px;
    line-height: 1.6;
}

.by-related-item a:hover {
    color: #0066cc;
    text-decoration: none;
}

/* 右侧边栏小工具 */
.by-widget {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.by-widget-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.by-widget-more {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: #0066cc;
}

.by-widget-more:hover {
    text-decoration: underline;
}

/* 股票模块 */
.by-stock-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.by-stock-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.by-stock-item:last-child {
    border-bottom: none;
}

.by-stock-name {
    color: #333;
}

.by-stock-price {
    color: #00aa00;
    font-weight: 500;
}

/* 天气模块 */
.by-weather-info {
    text-align: center;
}

.by-weather-temp {
    font-size: 36px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.by-weather-desc {
    font-size: 15px;
    color: #666;
    margin-bottom: 8px;
}

.by-weather-location {
    font-size: 13px;
    color: #999;
}

/* 热榜 */
.by-hotlist-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.by-hotlist-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    min-height: 44px;
}

.by-hotlist-item:last-child {
    border-bottom: none;
}

.by-hotlist-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-right: 12px;
    flex-shrink: 0;
    line-height: 1;
}

.by-hotlist-item:nth-child(1) .by-hotlist-rank,
.by-hotlist-item:nth-child(2) .by-hotlist-rank,
.by-hotlist-item:nth-child(3) .by-hotlist-rank {
    background: #ff4444;
    color: #fff;
}

.by-hotlist-link {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    padding-top: 4px;
    word-break: break-word;
    display: block;
}

.by-hotlist-link:hover {
    color: #0066cc;
    text-decoration: none;
}

/* 图片画廊网格（用于 public_article.php） */
.by-gallery {
    margin-bottom: 30px;
}

.by-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.by-gallery-item {
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 3/4;
    background: #f0f0f0;
    transition: transform 0.3s, box-shadow 0.3s;
}

.by-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.by-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.by-gallery-item:hover img {
    transform: scale(1.05);
}

/* 图片资讯网格 */
.by-images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.by-image-item {
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 1;
    background: #f0f0f0;
    transition: transform 0.3s;
}

.by-image-item:hover {
    transform: scale(1.03);
}

.by-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.by-image-item:hover img {
    transform: scale(1.1);
}

/* 页脚 */
.by-footer {
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    padding: 25px 0;
    margin-top: 50px;
}

.by-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .by-layout {
        flex-direction: column;
    }
    
    .by-sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .by-page {
        padding: 15px;
    }
    
    .by-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .by-article-section {
        padding: 20px;
    }
    
    .by-article-title {
        font-size: 24px;
    }
    
    .by-topbar-right {
        display: none;
    }
    
    .by-search-box {
        max-width: 100%;
    }
    
    .by-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
