/* ================================================================
 * DS Fav v5.7.0 — 收藏夹 / 文件夹
 * ================================================================ */

:root {
    --ds-fv-primary: #f59e0b;
    --ds-fv-bg: #f8fafc;
    --ds-fv-card: #ffffff;
    --ds-fv-text: #0f172a;
    --ds-fv-text-2: #64748b;
    --ds-fv-border: #e2e8f0;
    --ds-fv-radius: 12px;
}

/* ---- 收藏按钮 ---- */
.ds-fv-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ds-fv-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--ds-fv-card);
    color: var(--ds-fv-text-2);
    border: 1px solid var(--ds-fv-border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.ds-fv-btn:hover {
    border-color: var(--ds-fv-primary);
    color: var(--ds-fv-primary);
}
.ds-fv-btn.is-faved {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-color: transparent;
    color: #fff;
}
.ds-fv-btn.is-faved:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: #fff;
}
.ds-fv-btn-login {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff !important;
    border-color: transparent;
    text-decoration: none;
}
.ds-fv-icon { font-size: 14px; }
.ds-fv-count {
    font-size: 12px;
    color: var(--ds-fv-text-2);
    background: var(--ds-fv-bg);
    padding: 2px 8px;
    border-radius: 999px;
}

/* ---- 弹窗 ---- */
.ds-fv-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--ds-fv-card);
    padding: 24px;
    border-radius: 12px;
    min-width: 360px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 999999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.ds-fv-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
}
.ds-fv-modal h3 {
    margin: 0 0 16px;
    font-size: 16px;
}
.ds-fv-folder-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--ds-fv-border);
    border-radius: 8px;
}
.ds-fv-folder-list li {
    padding: 10px 14px;
    border-bottom: 1px solid var(--ds-fv-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}
.ds-fv-folder-list li:last-child { border-bottom: none; }
.ds-fv-folder-list li:hover { background: var(--ds-fv-bg); }
.ds-fv-folder-list li.is-active {
    background: linear-gradient(90deg, #fef3c7, transparent);
    color: var(--ds-fv-primary);
    font-weight: 600;
}
.ds-fv-folder-list .ds-fv-folder-count {
    font-size: 12px;
    color: var(--ds-fv-text-2);
    background: var(--ds-fv-bg);
    padding: 1px 8px;
    border-radius: 999px;
}
.ds-fv-new {
    border-top: 1px dashed var(--ds-fv-border);
    padding-top: 12px;
    margin-bottom: 12px;
}
.ds-fv-new input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--ds-fv-border);
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
    margin-bottom: 8px;
}
.ds-fv-new label {
    display: block;
    font-size: 13px;
    color: var(--ds-fv-text-2);
    margin-bottom: 6px;
}
.ds-fv-modal-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.ds-fv-modal-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--ds-fv-border);
    background: var(--ds-fv-card);
    cursor: pointer;
    font-size: 13px;
}
.ds-fv-modal-actions .ds-fv-confirm {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}

/* ---- 公开分享页 ---- */
.ds-fv-share-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ds-fv-text);
}
.ds-fv-share-head {
    text-align: center;
    padding: 24px 0 32px;
    border-bottom: 1px solid var(--ds-fv-border);
    margin-bottom: 24px;
}
.ds-fv-share-head h1 {
    font-size: 28px;
    margin: 0 0 8px;
}
.ds-fv-share-desc {
    color: var(--ds-fv-text-2);
    font-size: 14px;
    margin: 0 0 8px;
}
.ds-fv-share-meta {
    color: var(--ds-fv-text-2);
    font-size: 13px;
    margin: 0;
}
.ds-fv-share-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.ds-fv-share-card {
    background: var(--ds-fv-card);
    border: 1px solid var(--ds-fv-border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.2s;
}
.ds-fv-share-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--ds-fv-primary);
}
.ds-fv-share-thumb {
    aspect-ratio: 4/3;
    background: var(--ds-fv-bg);
    overflow: hidden;
}
.ds-fv-share-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ds-fv-share-thumb-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--ds-fv-text-2);
}
.ds-fv-share-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    padding: 10px 12px 4px;
    line-height: 1.4;
}
.ds-fv-share-note {
    font-size: 12px;
    color: var(--ds-fv-text-2);
    margin: 0;
    padding: 0 12px 10px;
    font-style: italic;
}
.ds-fv-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--ds-fv-text-2);
    font-size: 14px;
}

/* ---- 暗黑 ---- */
@media (prefers-color-scheme: dark) {
    :root {
        --ds-fv-bg: #0f172a;
        --ds-fv-card: #1e293b;
        --ds-fv-text: #f1f5f9;
        --ds-fv-text-2: #94a3b8;
        --ds-fv-border: #334155;
    }
    .ds-fv-folder-list .ds-fv-folder-count { background: #334155; }
    .ds-fv-count { background: #334155; }
}
