/* ============================================================
 * RSS 订阅阅读器 rss-reader.css
 * 配色全部走 CSS 变量，自动适配黑夜模式
 * ============================================================ */

/* hidden 属性统一强制隐藏（避免被 display:flex 等覆盖） */
[hidden] { display: none !important; }

/* ---------- Hero ---------- */
.rs-hero {
    position: relative;
    background: var(--c-bg-card, #fff);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 20px;
    padding: 24px;
    margin: 24px 0 40px;
    overflow: hidden;
}
.rs-hero::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, var(--c-accent-cyan, #cffafe), transparent 70%);
    opacity: .5;
    pointer-events: none;
}
.rs-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.rs-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: color-mix(in srgb, var(--c-accent-cyan, #cffafe) 30%, transparent);
    border: 1px solid var(--c-border, #e5e7eb);
    flex-shrink: 0;
}
.rs-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--c-text, #111827);
    line-height: 1.2;
}
.rs-sub {
    font-size: 13px;
    color: var(--c-text-sub, #4b5563);
    margin-top: 4px;
}

/* ---------- 双栏 ---------- */
.rs-layout {
    position: relative;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    align-items: start;
}
.rs-panel {
    background: var(--c-surface, #fafafa);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 14px;
    padding: 14px;
    position: sticky;
    top: 76px;
}
.rs-stage {
    background: var(--c-surface, #fafafa);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 14px;
    padding: 14px;
    min-width: 0;
}

/* ---------- 面板组 ---------- */
.rs-group {
    padding: 12px 2px;
    border-bottom: 1px dashed var(--c-border, #e5e7eb);
}
.rs-group:last-child { border-bottom: none; }
.rs-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.rs-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text, #111827);
}
.rs-tip {
    font-size: 11.5px;
    color: var(--c-text-muted, #6b7280);
}
.rs-val {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--c-primary, #6366f1);
}

.rs-textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    background: var(--c-bg-soft, #f3f4f6);
    color: var(--c-text, #111827);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12.5px;
    line-height: 1.7;
    font-family: Consolas, Monaco, "Courier New", monospace;
    outline: none;
    transition: border-color .2s;
}
.rs-textarea:focus { border-color: var(--c-primary, #6366f1); }

/* 热门源 */
.rs-hot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.hot-label {
    font-size: 11.5px;
    color: var(--c-text-muted, #6b7280);
    line-height: 24px;
}
.hot-chip {
    background: var(--c-bg-soft, #f3f4f6);
    color: var(--c-text-sub, #4b5563);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 12px;
    cursor: pointer;
    transition: all .18s;
    font-family: inherit;
}
.hot-chip:hover {
    color: var(--c-primary, #6366f1);
    border-color: var(--c-primary, #6366f1);
}
.hot-chip.active {
    background: var(--c-primary, #6366f1);
    color: #fff;
    border-color: var(--c-primary, #6366f1);
}

.rs-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.rs-status {
    font-size: 12px;
    color: var(--c-text-muted, #6b7280);
    margin-top: 10px;
    min-height: 16px;
    line-height: 1.5;
}
.rs-status.loading { color: var(--c-accent-orange, #f59e0b); animation: rs-pulse 1s infinite alternate; }
.rs-status.done { color: var(--c-accent-green, #16a34a); }
@keyframes rs-pulse { from { opacity: .5; } to { opacity: 1; } }

/* ---------- 通用按钮 / 控件 ---------- */
.rs-btn {
    border: 1px solid var(--c-border, #e5e7eb);
    background: var(--c-bg-soft, #f3f4f6);
    color: var(--c-text, #111827);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .18s;
    font-family: inherit;
}
.rs-btn:hover { border-color: var(--c-primary, #6366f1); color: var(--c-primary, #6366f1); }
.rs-btn.primary {
    background: var(--c-primary, #6366f1);
    border-color: var(--c-primary, #6366f1);
    color: #fff;
}
.rs-btn.primary:hover { background: var(--c-primary-dark, #4f46e5); color: #fff; }
.rs-btn.ghost { background: transparent; }
.rs-btn.block { width: 100%; }
.rs-btn:disabled { opacity: .5; cursor: not-allowed; }
.rs-btn:disabled:hover { color: var(--c-text, #111827); border-color: var(--c-border, #e5e7eb); }

.rs-check {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--c-text-sub, #4b5563);
    cursor: pointer;
    margin-top: 8px;
}
.rs-check input { accent-color: var(--c-primary, #6366f1); }

.rs-range-row { margin: 8px 0 2px; }
.rs-range {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--c-bg-soft, #e5e7eb);
    border-radius: 2px;
    outline: none;
}
.rs-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--c-primary, #6366f1);
    border: 3px solid var(--c-surface, #fff);
    box-shadow: 0 0 0 1px var(--c-border, #d1d5db);
    cursor: pointer;
}

/* ---------- 已加载源列表 ---------- */
.rs-source-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 10px;
}
.rs-source-list::-webkit-scrollbar { width: 6px; }
.rs-source-list::-webkit-scrollbar-thumb { background: var(--c-border, #d1d5db); border-radius: 3px; }
.rs-source-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    background: var(--c-bg-soft, #f3f4f6);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 9px;
}
.rs-source-item.error { border-color: var(--c-accent-orange, #f59e0b); }
.rs-source-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--c-surface, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.rs-source-icon img { width: 100%; height: 100%; object-fit: cover; }
.rs-source-name {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--c-text, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rs-source-sub {
    font-size: 11px;
    color: var(--c-text-muted, #6b7280);
}
.rs-source-ops {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.rs-source-ops button {
    border: none;
    background: transparent;
    color: var(--c-text-muted, #6b7280);
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 5px;
    transition: all .15s;
}
.rs-source-ops button:hover { color: var(--c-primary, #6366f1); background: var(--c-primary-soft, #eef2ff); }
.rs-source-ops button.danger:hover { color: #ef4444; background: color-mix(in srgb, #ef4444 10%, transparent); }

/* ---------- 文章流工具栏 ---------- */
.rs-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.rs-search { flex: 1; min-width: 200px; }
.rs-search input {
    width: 100%;
    box-sizing: border-box;
    background: var(--c-bg-soft, #f3f4f6);
    color: var(--c-text, #111827);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 13px;
    outline: none;
    transition: border-color .2s;
}
.rs-search input:focus { border-color: var(--c-primary, #6366f1); }

.rs-seg {
    display: flex;
    background: var(--c-bg-soft, #f3f4f6);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}
.rs-seg button {
    border: none;
    background: transparent;
    color: var(--c-text-sub, #4b5563);
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .18s;
}
.rs-seg button.active {
    background: var(--c-primary, #6366f1);
    color: #fff;
}

.rs-stage-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.rs-count {
    font-size: 12px;
    color: var(--c-text-muted, #6b7280);
}

/* ---------- 文章流 ---------- */
.rs-frame {
    min-height: 420px;
    position: relative;
}
.rs-results {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 源分组卡片 */
.rs-feed {
    background: var(--c-bg-card, #fff);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 13px;
    overflow: hidden;
}
.rs-feed-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--c-border, #e5e7eb);
    background: linear-gradient(90deg, var(--c-primary-soft, #eef2ff), transparent 65%);
}
.rs-feed-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-surface, #fff);
    border: 1px solid var(--c-border, #e5e7eb);
    font-size: 17px;
    overflow: hidden;
}
.rs-feed-icon img { width: 100%; height: 100%; object-fit: cover; }
.rs-feed-info { flex: 1; min-width: 0; }
.rs-feed-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text, #111827);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rs-feed-title:hover { color: var(--c-primary, #6366f1); }
.rs-feed-desc {
    font-size: 11.5px;
    color: var(--c-text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rs-feed-count {
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--c-primary, #6366f1);
    background: var(--c-primary-soft, #eef2ff);
    border-radius: 999px;
    padding: 3px 10px;
}
.rs-feed-refresh {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--c-text-muted, #6b7280);
    font-size: 15px;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 6px;
    transition: all .15s;
}
.rs-feed-refresh:hover { color: var(--c-primary, #6366f1); background: var(--c-primary-soft, #eef2ff); }

.rs-feed-error {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--c-accent-orange, #f59e0b);
    background: color-mix(in srgb, var(--c-accent-orange, #f59e0b) 9%, transparent);
    flex-wrap: wrap;
}
.rs-feed-error .err-url {
    font-family: Consolas, monospace;
    font-size: 11.5px;
    color: var(--c-text-muted, #6b7280);
    word-break: break-all;
}

/* 文章项 */
.rs-items { display: flex; flex-direction: column; }
.rs-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--c-border, #e5e7eb);
    transition: background .18s;
    position: relative;
}
.rs-item:last-child { border-bottom: none; }
.rs-item:hover { background: var(--c-bg-soft, #f8fafc); }
.rs-item-thumb {
    width: 108px;
    height: 68px;
    border-radius: 9px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--c-bg-soft, #f3f4f6);
    border: 1px solid var(--c-border, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.rs-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.rs-item:hover .rs-item-thumb img { transform: scale(1.05); }
.rs-item-main { flex: 1; min-width: 0; }
.rs-item-title-row { display: flex; align-items: flex-start; gap: 6px; }
.rs-item-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text, #111827);
    text-decoration: none;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rs-item-title:hover { color: var(--c-primary, #6366f1); }
.rs-item-ops {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.rs-item-ops button {
    border: none;
    background: transparent;
    color: var(--c-text-muted, #9ca3af);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 5px;
    transition: all .15s;
    line-height: 1.3;
}
.rs-item-ops button:hover { color: var(--c-primary, #6366f1); background: var(--c-primary-soft, #eef2ff); }
.rs-item-ops button.starred { color: #f59e0b; }
.rs-item-desc {
    font-size: 12px;
    color: var(--c-text-sub, #4b5563);
    line-height: 1.6;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rs-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--c-text-muted, #6b7280);
    flex-wrap: wrap;
}
.rs-item-meta .tag {
    color: var(--c-primary, #6366f1);
    background: var(--c-primary-soft, #eef2ff);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 10.5px;
}
.rs-item-meta .sep { opacity: .45; }

/* ---------- 空态 / 加载 ---------- */
.rs-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--c-text-muted, #6b7280);
}
.rs-empty-icon { font-size: 48px; margin-bottom: 12px; filter: grayscale(.3); }
.rs-empty p { margin: 4px 0; font-size: 14px; }
.rs-empty-sub { font-size: 12px; }

.rs-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--c-text-muted, #6b7280);
}
.rs-loading-ring {
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    border: 3px solid var(--c-border, #e5e7eb);
    border-top-color: var(--c-primary, #6366f1);
    border-radius: 50%;
    animation: rs-spin .8s linear infinite;
}
@keyframes rs-spin { to { transform: rotate(360deg); } }
.rs-loading p { font-size: 13px; margin: 0; }

/* ---------- 信息区 ---------- */
.qg-info {
    background: var(--c-bg-card, #fff);
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 26px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .rs-layout { grid-template-columns: 1fr; }
    .rs-panel { position: static; }
}
@media (max-width: 600px) {
    .rs-item { flex-direction: column; }
    .rs-item-thumb { width: 100%; height: 140px; }
    .rs-feed-head { flex-wrap: wrap; }
}
