/* ============================================
   首页 / 通用卡片容器样式（与原主题一致）
   ============================================ */

:root {
    --bg: #faf9f7;
    --bg-card: #fff;
    --bg-warm: #f5f3f0;
    --text: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #999;
    --border: #e8e5e2;
    --border-light: #f0eeeb;
    --primary: #1a1a1a;
    --accent: #c4a882;
    --accent-light: #f5efe6;
    --success: #5a8a6e;
    --warning: #b8956a;
    --danger: #a05050;
    --radius: 4px;
    --radius-sm: 2px;
}

.dgs-home-page {
    background: #f5f5f5;
    min-height: 100vh;
    padding-bottom: 60px;
}
.dgs-home-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 15px;
}
.dgs-home-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
    margin-top: -20px;
    overflow: hidden;
}

/* ---------- 顶栏 ---------- */
.card-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-light);
}
.topbar-brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}
.topbar-link {
    font-size: 13px;
    color: var(--text-secondary);
}
.topbar-link:hover { color: var(--text); }
.topbar-user { font-size: 13px; color: var(--text); font-weight: 600; }
.topbar-vip-badge {
    display: inline-block;
    padding: 1px 8px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* ---------- 搜索区 ---------- */
.search-hero {
    text-align: center;
    padding: 56px 24px 40px;
    background: var(--bg-warm);
    border-bottom: 1px solid var(--border-light);
}
.search-hero-logo {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text);
}
.search-hero-sub {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.search-hero-box {
    max-width: 520px;
    margin: 26px auto 0;
    display: flex;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 30px;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.search-hero-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(196, 168, 130, .15);
}
.search-hero-box input {
    flex: 1;
    height: 46px;
    padding: 0 20px;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}
.search-hero-box .search-btn {
    height: 46px;
    padding: 0 28px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    transition: background .2s;
}
.search-hero-box .search-btn:hover { background: #333; }

/* ---------- 统计条 ---------- */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}
.stat-item { text-align: center; }
.stat-number { font-size: 17px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---------- 区块 ---------- */
.section { padding: 28px 24px; }
.section + .section { border-top: 1px solid var(--border-light); }
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    position: relative;
    padding-left: 12px;
}
.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    background: var(--accent);
    border-radius: 2px;
}
.section-more { font-size: 12px; color: var(--text-muted); }
.section-more a:hover { color: var(--accent); }

/* ---------- 作品网格：9:16 竖版卡片 ---------- */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.resource-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.resource-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
    transform: translateY(-2px);
}

/* 上图：9:16 竖版封面 */
.work-cover {
    display: block;
    aspect-ratio: 9 / 16;
    background: var(--bg-warm);
    overflow: hidden;
}
.work-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.resource-card:hover .work-cover img { transform: scale(1.03); }
.work-cover-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #d8d2c8;
    letter-spacing: 2px;
}

/* 角标 */
.resource-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 600;
}
.badge-paid { background: var(--accent); }
.badge-free { background: var(--success); }
.badge-vip { background: var(--accent); }
.badge-stack { top: 34px; }

/* 下图：标题与价格 */
.resource-body { padding: 10px 12px 12px; }
.resource-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 39px;
}
.resource-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.work-price { display: inline-flex; align-items: baseline; color: var(--accent); }
.price-symbol { font-size: 11px; }
.price-num { font-size: 17px; font-weight: 700; margin: 0 1px; }
.price-dec { font-size: 11px; }
.work-free-tag { font-size: 12px; color: var(--success); font-weight: 600; }

/* 加载更多 */
.load-more-wrap { text-align: center; margin-top: 22px; }

/* ---------- 特性区 ---------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.feature-card {
    padding: 22px 18px;
    background: var(--bg-warm);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    text-align: center;
}
.feature-icon {
    font-size: 22px;
    color: var(--accent);
    margin-bottom: 10px;
}
.feature-title { font-size: 14px; font-weight: 700; color: var(--text); }
.feature-desc {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ---------- 页脚 ---------- */
.home-card-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ---------- 快捷操作（兼容） ---------- */
.home-quick-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 0 24px 24px;
}
.home-quick-btn {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    background: #fff;
}
.home-quick-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 搜索结果提示 ---------- */
.search-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================
   移动端适配（直接追加到home.css确保优先级）
   ============================================ */
@media (max-width: 768px) {
    /* 容器调整：保持卡片形式，灰色背景环绕 */
    .dgs-home-container {
        margin: 12px auto;
        padding: 0 12px;
    }
    .dgs-home-card {
        margin-top: 0;
        border-radius: 6px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
        border: 1px solid #e0e0e0;
        background: #fff;
        overflow: hidden;
    }

    /* 顶栏 */
    .card-topbar {
        padding: 10px 14px;
    }
    .topbar-right {
        gap: 10px;
    }
    .topbar-link {
        font-size: 12px;
    }

    /* 搜索区 */
    .search-hero {
        padding: 30px 14px 24px;
    }
    .search-hero-logo {
        font-size: 26px;
    }
    .search-hero-box {
        max-width: 100%;
    }
    .search-hero-box input {
        font-size: 13px;
    }

    /* 统计条 */
    .stats-bar {
        gap: 24px;
        padding: 14px;
    }

    /* 区块 */
    .section {
        padding: 16px 14px;
    }
    .section-title {
        font-size: 15px;
    }

    /* 作品网格：强制一行两列 */
    .resource-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .resource-body { display: none !important; }
    .resource-card { border-radius: 6px; }
    .resource-badge { font-size: 10px; padding: 1px 6px; top: 6px; left: 6px; }
    .badge-stack { top: 6px !important; left: 42px !important; right: auto !important; }

    /* 三种下载方式：移动端直接隐藏 */
    .features-grid { display: none !important; }

    /* 快捷操作 */
    .home-quick-actions {
        padding: 0 14px 16px;
    }

    /* 页脚 */
    .home-card-footer {
        padding: 14px;
        font-size: 11px;
    }
}