/* AI 主题样式 - 参考每日简报风格 */

/* ========== 列表页样式 ========== */
.topics-page,
.topics-tag-page {
    padding: 40px 20px;
    min-height: 60vh;
}

.topics-page .page-header,
.topics-tag-page .page-header {
    margin-bottom: 40px;
    position: relative;
    text-align: center;
}

/* 页面头部内容布局 */
.topics-page .header-content,
.topics-tag-page .header-content {
    display: inline-block;
    position: relative;
}

.topics-page .page-header .header-left,
.topics-tag-page .page-header .header-left {
    display: block;
}

.topics-page .page-title,
.topics-tag-page .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
}

.tag-icon {
    color: #6366f1;
}

.topics-page .page-subtitle,
.topics-tag-page .page-subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin: 0;
}

/* 副标题行三列布局 - 居中副标题，右侧操作按钮 */
.page-subtitle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.subtitle-spacer {
    flex: 1;
}

.page-subtitle-row .page-subtitle {
    flex: 0 0 auto;
    text-align: center;
    margin: 0;
}

.subtitle-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    min-width: 100px;
}

/* RSS 订阅按钮 */
.rss-subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    background: #f59e0b;
    color: white;
    text-decoration: none;
    border-radius: 18px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.rss-subscribe-btn:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.rss-subscribe-btn svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* 详情页标题行 */
.detail-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.detail-title-row .detail-title {
    margin: 0;
}

.detail-title-row .rss-subscribe-btn {
    font-size: 0.85rem;
    padding: 0.35rem 0.85rem;
    flex-shrink: 0;
}

.topics-page .main-container,
.topics-tag-page .main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

.topics-list {
    display: grid;
    gap: 1.25rem;
}

/* 主题卡片 */
.topic-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.topic-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.topic-date {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.topic-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: #111827;
}

.topic-summary {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #fafafa;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.6;
}

.topic-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.keyword-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    color: #6366f1;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s;
}

.keyword-tag:hover {
    background: #6366f1;
    color: white;
}

.topic-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.topic-stats {
    color: #9ca3af;
    font-size: 0.85rem;
}

.topic-read-more {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.topic-read-more:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* 空状态 */
.topics-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 3rem 2rem;
    color: #9ca3af;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 详情页样式 ========== */
.topics-detail-page {
    min-height: 60vh;
    padding: 2rem 0;
}

.detail-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.detail-main {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.detail-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.back-link {
    display: inline-block;
    color: #6366f1;
    text-decoration: none;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

.detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: #111827;
}

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

.detail-count {
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
}

/* 主题详情卡片 */
.topics-detail-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.topic-detail-card {
    padding: 1.5rem;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.topic-detail-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: #111827;
}

.topic-detail-summary {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.75;
    color: #4b5563;
}

.topic-detail-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

/* 主题相关新闻 - 与简报样式统一 */
.topic-detail-card .topic-section-links {
    padding-top: 0.6rem;
    margin-top: 0.6rem;
    border-top: 1px solid #f3f4f6;
}

.topic-detail-card .related-reading-heading {
    font-size: 0.7rem;
    color: #9ca3af;
    margin: 0 0 0.4rem 0;
    font-weight: 500;
}

.topic-detail-card .related-reading-heading strong {
    font-weight: 500;
}

.topic-detail-card .related-reading-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.topic-detail-card .related-reading-item {
    display: block;
}

.topic-detail-card .related-reading-link {
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.0;
}

.topic-detail-card .related-reading-link:hover {
    color: #6366f1;
}

/* 内联标签样式 */

/* 主题锚点链接样式 */
a.topic-anchor {
    color: #000;
    text-decoration: none;
    scroll-margin-top: 2rem;
    font-size: 1.5rem;
}

a.topic-anchor:hover {
    color: #000;
    text-decoration: none;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

.keyword-tag-inline {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    color: #6366f1;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.keyword-tag-inline:hover {
    background: #6366f1;
    color: white;
}

/* ========== Topics 页面特别优化 ========== */
/* 增加主题区域的间距 */
.daily-detail-page .topic-section {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
}

.daily-detail-page .topic-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 标题区域增加间距 */
.daily-detail-page .topic-section-title {
    margin-bottom: 1.25rem;
}

.daily-detail-page .topic-section-title h2 {
    font-size: 1.25rem;
    line-height: 1.5;
}

/* 内容区域增加间距 */
.daily-detail-page .topic-section-content {
    margin-bottom: 1rem;
}

.daily-detail-page .topic-text {
    margin-bottom: 0.75rem;
    line-height: 1.75;
}

.daily-detail-page .topic-text:last-child {
    margin-bottom: 0;
}

/* 分隔线样式优化 */
.daily-detail-page hr {
    margin: 2.5rem 0;
    opacity: 0.6;
}

/* 相关阅读区域增加间距 */
.daily-detail-page .topic-section-links {
    padding-top: 1rem;
    margin-top: 1rem;
}

.daily-detail-page .related-reading-heading {
    font-size: 0.75rem;
    margin-bottom: 0.6rem;
}

.daily-detail-page .related-reading-list {
    gap: 0.5rem;
}

.daily-detail-page .related-reading-link {
    font-size: 0.8rem;
    line-height: 1.2;
}

/* 日期导航 */
.date-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0 0;
    margin-top: 2rem;
    border-top: 1px solid #f3f4f6;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-btn:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.nav-btn.next-btn {
    margin-left: auto;
}

/* ========== 侧边栏 ========== */
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-info {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #111827;
}

.sidebar-content {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.6;
}

.sidebar-content p {
    margin-bottom: 0.75rem;
}

.sidebar-content p:last-child {
    margin-bottom: 0;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .detail-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* 列表页移动端 */
    .topics-page,
    .topics-tag-page {
        padding: 20px 15px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .topics-page .page-title,
    .topics-tag-page .page-title {
        font-size: 1.75rem;
    }

    .topics-page .page-subtitle,
    .topics-tag-page .page-subtitle {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    .topics-page .page-header,
    .topics-tag-page .page-header {
        margin-bottom: 30px;
    }

    .topics-page .page-header .rss-subscribe-btn,
    .topics-tag-page .page-header .rss-subscribe-btn {
        align-self: flex-end;
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }

    .topic-card {
        padding: 1.25rem;
    }

    .topic-title {
        font-size: 1.1rem;
    }

    .topic-summary {
        font-size: 0.85rem;
    }

    .topic-keywords {
        font-size: 0.85rem;
    }

    /* RSS 按钮响应式 */
    .page-subtitle-row {
        max-width: 100%;
        gap: 0.75rem;
    }

    .row-left {
        display: none;
    }

    .rss-subscribe-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
        white-space: nowrap;
    }

    .detail-title-row {
        flex-wrap: wrap;
    }

    .detail-title-row .rss-subscribe-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
    }

    /* 移动端其他样式 */
    .topics-page .page-title,
    .topics-tag-page .page-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .topics-page .page-subtitle,
    .topics-tag-page .page-subtitle {
        font-size: 0.95rem;
    }

    /* 详情页移动端 */
    .detail-main {
        padding: 1.5rem;
    }

    .detail-title {
        font-size: 1.5rem;
    }

    /* 移动端隐藏侧边栏 */
    .sidebar-info {
        display: none;
    }

    .topic-detail-title {
        font-size: 1.05rem;
    }

    .topic-detail-summary {
        font-size: 0.85rem;
    }

    .date-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }

    .nav-btn {
        width: 100%;
        text-align: center;
    }

    .nav-btn.next-btn {
        margin-left: 0;
    }
}
