/* ========================================
   AIHub 公共样式
   与 Tailwind CSS 分离，避免污染
   ======================================== */

/* ---------- 卡片悬停效果 ---------- */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* ---------- 标签页样式 ---------- */
.tab-active {
    background-color: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

.tab-inactive {
    background-color: #ffffff;
    color: #6b7280;
}

.tab-inactive:hover {
    background-color: #f3f4f6;
}

/* ---------- 头部渐变背景 ---------- */
.list-hero-gradient {
    background: linear-gradient(180deg, #eff6ff 0%, #f7f9fb 100%);
}

/* ---------- 新闻列表分隔线 ---------- */
.news-list > div {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1.5rem;
}

.news-list > div:last-child {
    border-bottom: none;
}

/* ---------- 文章内容视图 ---------- */
.news-view {
    padding: 2rem 1.5rem;
}

.news-view-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.news-view-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #6b7280;
}

.news-view-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.news-view-meta-item svg {
    width: 1rem;
    height: 1rem;
}

.news-view-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: #eff6ff;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 9999px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.news-view-tag:hover {
    background-color: #dbeafe;
}

/* 文章内容正文 */
.news-view-body h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.news-view-body h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.news-view-body h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.news-view-body p {
    font-size: 1rem;
    line-height: 1.75;
    color: #374151;
    margin-bottom: 1rem;
}

.news-view-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.news-view-body figure {
    margin: 1.5rem 0;
    text-align: center;
}

.news-view-body figure img {
    margin: 0 auto;
}

.news-view-body figure figcaption {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.news-view-body blockquote {
    border-left: 4px solid #3b82f6;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    background-color: #f8fafc;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #334155;
}

.news-view-body ul,
.news-view-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.news-view-body li {
    font-size: 1rem;
    line-height: 1.75;
    color: #374151;
    margin-bottom: 0.375rem;
}

.news-view-body strong {
    font-weight: 600;
    color: #111827;
}

.news-view-body a {
    color: #2563eb;
    text-decoration: underline;
}

/* ---------- 互动操作栏 ---------- */
.news-view-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.news-view-actions-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    color: #6b7280;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.news-view-actions-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background-color: #eff6ff;
}

.news-view-actions-btn svg {
    width: 1rem;
    height: 1rem;
}

.news-view-share {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-view-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    transition: all 0.2s;
}

.news-view-share-btn:hover {
    background: #3b82f6;
    color: white;
}

.news-view-share-btn svg {
    width: 1rem;
    height: 1rem;
}

/* ---------- 面包屑导航 ---------- */
.breadcrumb-nav a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* ---------- 复制链接按钮成功状态 ---------- */
.copy-link-btn.copied {
    border-color: #10b981 !important;
    color: #10b981 !important;
    background-color: #ecfdf5 !important;
}

/* ---------- 右侧栏卡片无边框 ---------- */
.sidebar-card {
    border: none !important;
}

/* ---------- 文本截断（确保省略号） ---------- */
.text-truncate {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* ---------- 描述文字省略号 ---------- */
.desc-ellipsis {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* ---------- 描述文字截断（确保省略号） ---------- */
.text-ellipsis-line {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* ========================================
   分页组件样式 (Tailwind 风格)
   ======================================== */
ul.page-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0.25rem !important;
}

ul.page-nav li {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

ul.page-nav li a,
ul.page-nav li span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 2.5rem !important;
    height: 2.5rem !important;
    padding: 0 0.75rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    border-radius: 0.5rem !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

/* 默认链接样式 */
ul.page-nav li a {
    color: #374151 !important;
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
}

ul.page-nav li a:hover {
    color: #2563eb !important;
    background-color: #eff6ff !important;
    border-color: #bfdbfe !important;
}

/* 当前激活页 */
ul.page-nav li.active a,
ul.page-nav li.active span {
    color: #ffffff !important;
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    font-weight: 600 !important;
}

ul.page-nav li.active a:hover {
    color: #ffffff !important;
    background-color: #1d4ed8 !important;
}

/* 禁用状态（上一页/下一页不可用） */
ul.page-nav li.disabled a,
ul.page-nav li.disabled span {
    color: #d1d5db !important;
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    cursor: not-allowed !important;
}

/* 省略号 */
ul.page-nav li.page_dot span {
    color: #9ca3af !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 0.25rem !important;
    min-width: auto !important;
    height: auto !important;
    font-size: 1rem !important;
    cursor: default !important;
}

/* 首末页数字 */
ul.page-nav li.page_end a,
ul.page-nav li.page_end span {
    font-weight: 500 !important;
}

/* 上一页/下一页按钮 */
ul.page-nav li.page_prev a,
ul.page-nav li.page_next a {
    padding: 0 1rem !important;
    font-size: 0.875rem !important;
    letter-spacing: 0.025em !important;
}

ul.page-nav li.page_prev a:hover,
ul.page-nav li.page_next a:hover {
    background-color: #eff6ff !important;
}

ul.page-nav li.page_prev.disabled a,
ul.page-nav li.page_next.disabled a {
    opacity: 0.5 !important;
}
