/* ================================================================
 * DS Topic v5.9.0 — 资源专题 / 周报
 * ================================================================ */

:root {
    --ds-tp-primary: #8b5cf6;
    --ds-tp-bg: #f8fafc;
    --ds-tp-card: #ffffff;
    --ds-tp-text: #0f172a;
    --ds-tp-text-2: #64748b;
    --ds-tp-border: #e2e8f0;
}

/* ---- 通用 ---- */
.ds-tp-wrap, .ds-tps-grid, .ds-wk-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ds-tp-text);
}
.ds-tp-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--ds-tp-text-2);
    background: var(--ds-tp-bg);
    border-radius: 8px;
}

/* ---- 专题头部 ---- */
.ds-tp-head {
    position: relative;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 60px 32px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    text-align: center;
}
.ds-tp-head-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));
}
.ds-tp-head-inner {
    position: relative;
    z-index: 1;
}
.ds-tp-icon {
    font-size: 48px;
    display: inline-block;
    margin-bottom: 12px;
}
.ds-tp-head h1 {
    font-size: 32px;
    margin: 0 0 12px;
    color: #fff;
}
.ds-tp-desc {
    font-size: 15px;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 12px;
    line-height: 1.6;
}
.ds-tp-meta {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}
.ds-tp-meta strong { color: #fde68a; }

/* ---- 资源网格 ---- */
.ds-tp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.ds-tp-card {
    background: var(--ds-tp-card);
    border: 1px solid var(--ds-tp-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}
.ds-tp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--ds-tp-primary);
}
.ds-tp-card-thumb {
    aspect-ratio: 4/3;
    background: var(--ds-tp-bg);
    overflow: hidden;
    display: block;
}
.ds-tp-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ds-tp-card-thumb-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--ds-tp-text-2);
}
.ds-tp-card-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    padding: 10px 12px 4px;
    line-height: 1.4;
}
.ds-tp-card-title a { color: inherit; text-decoration: none; }
.ds-tp-card-note {
    font-size: 12px;
    color: var(--ds-tp-text-2);
    margin: 0;
    padding: 0 12px 10px;
    font-style: italic;
}

/* ---- 专题列表 ---- */
.ds-tps-grid {
    display: grid;
    gap: 16px;
}
.ds-tps-card {
    background: var(--ds-tp-card);
    border: 1px solid var(--ds-tp-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.ds-tps-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--ds-tp-primary);
}
.ds-tps-card-cover {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ds-tps-card-icon {
    font-size: 48px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}
.ds-tps-card-body { padding: 12px 14px; }
.ds-tps-card-body h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
}
.ds-tps-card-body p {
    font-size: 13px;
    color: var(--ds-tp-text-2);
    margin: 0 0 8px;
    line-height: 1.5;
}
.ds-tps-card-count {
    font-size: 12px;
    color: var(--ds-tp-primary);
    font-weight: 600;
}

/* ---- 周报 ---- */
.ds-wk-head {
    text-align: center;
    padding: 32px 16px 24px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 16px;
    margin-bottom: 24px;
}
.ds-wk-head h1 { margin: 0 0 8px; color: #92400e; }
.ds-wk-period { color: #b45309; font-size: 14px; margin: 0; }
.ds-wk-section { margin-bottom: 32px; }
.ds-wk-section h2 {
    font-size: 20px;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ds-tp-primary);
}
.ds-wk-grid { display: grid; gap: 12px; }
.ds-wk-grid-3 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ds-wk-grid-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.ds-wk-card {
    background: var(--ds-tp-card);
    border: 1px solid var(--ds-tp-border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.2s;
}
.ds-wk-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.ds-wk-card-thumb {
    aspect-ratio: 4/3;
    background: var(--ds-tp-bg);
    overflow: hidden;
}
.ds-wk-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ds-wk-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    padding: 10px 12px 4px;
    line-height: 1.4;
}
.ds-wk-card time { display: block; font-size: 12px; color: var(--ds-tp-text-2); padding: 0 12px 10px; }

.ds-wk-rank {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--ds-tp-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--ds-tp-border);
}
.ds-wk-rank li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--ds-tp-border);
    transition: background 0.15s;
}
.ds-wk-rank li:last-child { border-bottom: none; }
.ds-wk-rank li:hover { background: var(--ds-tp-bg); }
.ds-wk-rank-num {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    text-align: center;
    line-height: 24px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.ds-wk-rank li:nth-child(n+4) .ds-wk-rank-num {
    background: var(--ds-tp-bg);
    color: var(--ds-tp-text-2);
}
.ds-wk-rank-title { flex: 1; color: var(--ds-tp-text); text-decoration: none; }
.ds-wk-rank-cnt { color: var(--ds-tp-text-2); font-size: 12px; }
.ds-wk-footer {
    text-align: center;
    color: var(--ds-tp-text-2);
    font-size: 12px;
    margin-top: 32px;
    padding: 12px;
}

/* ---- 暗黑 ---- */
@media (prefers-color-scheme: dark) {
    :root {
        --ds-tp-bg: #0f172a;
        --ds-tp-card: #1e293b;
        --ds-tp-text: #f1f5f9;
        --ds-tp-text-2: #94a3b8;
        --ds-tp-border: #334155;
    }
    .ds-wk-rank li:nth-child(n+4) .ds-wk-rank-num { background: #334155; }
}
