/* ========== AI快讯聚合页 ========== */
.kuaixun-page {
    margin: 0;
    padding: 0;
    background: #f5f6f8;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #1f2937;
}

/* 顶部 */
.kx-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* 左侧 logo + 站名 */
.kx-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kx-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    overflow: visible;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
    flex-shrink: 0;
    position: relative;
}

.kx-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

/* logo 右上角气泡 */
.kx-logo-bubble {
    position: absolute;
    top: -10px;
    right: -28px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    z-index: 2;
    line-height: 1.3;
}

.kx-logo-bubble::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 4px 5px 4px 0;
    border-color: transparent #6366f1 transparent transparent;
}

.kx-site-name {
    font-size: 14px;
    font-weight: 700;
    color: #666;
    letter-spacing: 0.5px;
}

/* 分隔竖线 */
.kx-divider {
    width: 1px;
    height: 28px;
    background: #e5e7eb;
    margin: 0 16px;
    flex-shrink: 0;
}

/* 板块标题 + 副标题 */
.kx-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.kx-section-sub {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 400;
}

.kx-back {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 16px;
    background: #f3f4f6;
    border-radius: 999px;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.kx-back:hover {
    background: #eef2ff;
    color: #6366f1;
}

/* 顶部搜索框 */
.kx-search {
    margin-left: 24px;
    display: flex;
    align-items: center;
    height: 36px;
    width: 260px;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 0 14px;
    gap: 8px;
    transition: background 0.2s, box-shadow 0.2s;
}

.kx-search:focus-within {
    background: #fff;
    box-shadow: 0 0 0 2px #eef2ff, 0 2px 8px rgba(99, 102, 241, 0.15);
}

.kx-search-icon {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    flex-shrink: 0;
}

.kx-search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    color: #374151;
    height: 100%;
    font-family: inherit;
}

.kx-search-input::placeholder {
    color: #9ca3af;
}

/* 主体两栏 */
.kx-body {
    display: flex;
    height: calc(100vh - 64px);
    overflow: hidden;
}

/* 左侧站点列表 */
.kx-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #fff;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    padding: 14px 10px;
    z-index: 10;
}

.kx-sidebar::-webkit-scrollbar {
    width: 4px;
}
.kx-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

/* 一级分类标题：16px 加深 */
.kx-group-title {
    font-size: 16px;
    color: #1f2937;
    padding: 14px 10px 8px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* 二级栏目项：错位缩进 */
.kx-site-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px 9px 22px;  /* 左侧 22px 制造相对一级标题的错位 */
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    position: relative;
    transition: background 0.15s, color 0.15s, padding-left 0.15s;
    user-select: none;
}

.kx-site-item:hover {
    background: #f9fafb;
    color: #111827;
    padding-left: 26px;
}

.kx-site-item.active {
    background: #eef2ff;
    color: #6366f1;
    font-weight: 600;
}

.kx-site-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 0 2px 2px 0;
}

.kx-favicon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #f3f4f6;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 700;
}

.kx-favicon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kx-site-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 外链 SVG 图标 */
.kx-ext-icon {
    color: #d1d5db;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.kx-site-item:hover .kx-ext-icon {
    color: #9ca3af;
}

.kx-site-item.active .kx-ext-icon {
    color: #8b5cf6;
}

/* 右侧 iframe 区 */
.kx-main {
    flex: 1;
    min-width: 0;
    position: relative;
    background: #fff;
}

.kx-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #fff;
}

/* iframe 加载失败/被拦截提示 */
.kx-fallback {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    color: #6b7280;
    text-align: center;
    padding: 20px;
}

.kx-fallback.show {
    display: flex;
}

.kx-fallback-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #eef2ff;
    color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}

.kx-fallback-title {
    font-size: 15px;
    color: #374151;
    font-weight: 600;
    margin-bottom: 6px;
}

.kx-fallback-desc {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 16px;
    line-height: 1.6;
    max-width: 320px;
}

.kx-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 18px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.kx-open-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

/* 响应式 */
@media (max-width: 768px) {
    .kx-sidebar {
        width: 180px;
    }
    .kx-site-name, .kx-section-sub {
        display: none;
    }
    .kx-divider {
        margin: 0 10px;
    }
}
