/* 智能相关推荐 - 前端样式 */
/* 主色 #3b82f6，与站点统一；不依赖外部 CSS 框架 */

.srp-cards-wrap {
    margin: 32px 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.srp-cards-wrap .srp-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
    padding-left: 10px;
    border-left: 4px solid #3b82f6;
    color: #1f2937;
    line-height: 1.4;
}

/* 卡片网格 */
.srp-cards-grid {
    display: grid;
    grid-gap: 18px;
    gap: 18px;
}
.srp-cards-grid.srp-cols-2 { grid-template-columns: repeat(2, 1fr); }
.srp-cards-grid.srp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.srp-cards-grid.srp-cols-4 { grid-template-columns: repeat(4, 1fr); }

.srp-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    height: 100%;
}
.srp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(59,130,246,.12);
    border-color: #3b82f6;
}

.srp-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f3f4f6;
}
.srp-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.srp-card-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.srp-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.5;
    color: #1f2937;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.srp-card-excerpt {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 10px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.srp-card-date {
    font-size: 12px;
    color: #9ca3af;
    margin-top: auto;
}
.srp-card-aggregator {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-color: transparent;
}
.srp-card-aggregator .srp-card-title,
.srp-card-aggregator .srp-card-date { color: #fff; }
.srp-card-badge {
    display: inline-block;
    background: rgba(255,255,255,.25);
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* 样式变体 */
.srp-style-simple .srp-card { border: none; border-bottom: 2px solid #f0f1f3; border-radius: 0; background: transparent; }
.srp-style-simple .srp-card:hover { box-shadow: none; transform: none; border-bottom-color: #3b82f6; }
.srp-style-compact .srp-card-body { padding: 10px 12px; }
.srp-style-compact .srp-card-title { font-size: 14px; -webkit-line-clamp: 1; }
.srp-style-compact .srp-card-excerpt { display: none; }

/* ===== 侧边栏浮窗 ===== */
.srp-sidebar {
    position: fixed;
    right: 20px;
    bottom: 24px;
    width: 260px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.16);
    padding: 14px 14px 10px;
    z-index: 9999;
    animation: srp-fade-in .35s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.srp-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f1f3;
}
.srp-sidebar-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}
.srp-sidebar-close:hover { background: #e5e7eb; color: #1f2937; }
.srp-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    text-decoration: none;
    color: #374151;
    border-radius: 8px;
    transition: background .2s ease;
}
.srp-sidebar-item:hover { background: #f3f6ff; color: #3b82f6; }
.srp-sidebar-item img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.srp-sidebar-item span {
    font-size: 13px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.srp-sidebar-aggregator {
    background: #eef4ff;
    color: #3b82f6;
    font-weight: 600;
    justify-content: center;
    margin-top: 4px;
}

/* ===== 阅读完成弹窗 ===== */
.srp-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: srp-fade-in .3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.srp-popup {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 460px;
    max-width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: srp-pop-in .35s cubic-bezier(.18,.89,.32,1.28);
}
.srp-popup h3 {
    margin: 0;
    padding: 18px 20px;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    border-bottom: 1px solid #f0f1f3;
}
.srp-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    z-index: 2;
}
.srp-popup-close:hover { background: #e5e7eb; color: #1f2937; }
.srp-popup-list {
    padding: 12px 16px 18px;
    overflow-y: auto;
}
.srp-popup-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    text-decoration: none;
    color: #374151;
    border-radius: 8px;
    transition: background .2s ease;
}
.srp-popup-item:hover { background: #f3f6ff; }
.srp-popup-item img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.srp-popup-item div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.srp-popup-item-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #1f2937;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.srp-popup-item-excerpt {
    font-size: 12px;
    color: #9ca3af;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 动画 */
@keyframes srp-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes srp-pop-in {
    0% { opacity: 0; transform: scale(.85) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* 响应式 */
@media (max-width: 768px) {
    .srp-cards-grid.srp-cols-3,
    .srp-cards-grid.srp-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .srp-sidebar { width: 220px; bottom: 16px; right: 12px; }
    .srp-popup { width: 100%; }
}
@media (max-width: 480px) {
    .srp-cards-grid.srp-cols-2,
    .srp-cards-grid.srp-cols-3,
    .srp-cards-grid.srp-cols-4 { grid-template-columns: 1fr; }
    .srp-sidebar { display: none !important; }
}

/* ===== 暗色模式 ===== */
@media (prefers-color-scheme: dark) {
    .srp-cards-wrap .srp-title { color: #f3f4f6; }
    .srp-card { background: #1f2937; border-color: #374151; }
    .srp-card:hover { border-color: #3b82f6; box-shadow: 0 12px 24px rgba(59,130,246,.25); }
    .srp-card-thumb { background: #374151; }
    .srp-card-title { color: #f3f4f6; }
    .srp-card-excerpt { color: #9ca3af; }
    .srp-card-date { color: #6b7280; }

    .srp-sidebar { background: #1f2937; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
    .srp-sidebar-title { color: #f3f4f6; border-bottom-color: #374151; }
    .srp-sidebar-close { background: #374151; color: #d1d5db; }
    .srp-sidebar-item { color: #d1d5db; }
    .srp-sidebar-item:hover { background: #111827; color: #60a5fa; }
    .srp-sidebar-aggregator { background: #1e3a5f; color: #60a5fa; }

    .srp-popup-overlay { background: rgba(0,0,0,.7); }
    .srp-popup { background: #1f2937; }
    .srp-popup h3 { color: #f3f4f6; border-bottom-color: #374151; }
    .srp-popup-close { background: #374151; color: #d1d5db; }
    .srp-popup-item { color: #d1d5db; }
    .srp-popup-item:hover { background: #111827; }
    .srp-popup-item-title { color: #f3f4f6; }
}
