/* ============================================================
 * RiPro-V5 Child — 设计门户视觉风格
 * 使用 functions.php 注入的 CSS 变量：
 *   --dp-brand / --dp-brand-2 / --dp-gradient
 * 以及分栏目变量（在分类页注入）：
 *   --cat-accent / --cat-gradient
 * ============================================================ */

.dp-hero {
    position: relative;
    padding: 96px 20px 84px;
    text-align: center;
    color: #fff;
    background: var(--dp-gradient, linear-gradient(135deg, #6d5efc, #ff6ea9));
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.dp-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .12);
}
.dp-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
}
.dp-hero-title {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    margin: 0 0 14px;
    letter-spacing: 1px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .18);
}
.dp-hero-sub {
    font-size: 16px;
    opacity: .95;
    margin: 0 0 26px;
}
.dp-hero-search {
    display: flex;
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    border-radius: 999px;
    padding: 5px 5px 5px 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}
.dp-hero-search input {
    flex: 1;
    border: 0;
    outline: 0;
    font-size: 15px;
    background: transparent;
    color: #333;
}
.dp-hero-search button {
    border: 0;
    border-radius: 999px;
    padding: 10px 26px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    background: var(--dp-gradient, linear-gradient(135deg, #6d5efc, #ff6ea9));
}

/* ---------- 通用区块 ---------- */
.dp-section {
    max-width: 1180px;
    margin: 48px auto;
    padding: 0 20px;
}
.dp-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}
.dp-section-head h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    background: var(--dp-gradient, linear-gradient(135deg, #6d5efc, #ff6ea9));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dp-section-head a {
    color: var(--dp-brand, #6d5efc);
    text-decoration: none;
    font-weight: 600;
}

/* ---------- 配色网格 ---------- */
.dp-gradient-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.dp-gradient-grid--full {
    grid-template-columns: repeat(4, 1fr);
}
.dp-gradient-card {
    position: relative;
    height: 130px;
    border-radius: 16px;
    cursor: pointer;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
    transition: transform .25s ease, box-shadow .25s ease;
}
.dp-gradient-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .2);
}
.dp-gradient-name {
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
.dp-gradient-value {
    font-size: 12px;
    opacity: .9;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* ---------- 文章网格 ---------- */
.dp-post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.dp-post-grid--full {
    grid-template-columns: repeat(4, 1fr);
}
.dp-post-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
    transition: transform .25s ease, box-shadow .25s ease;
    border: 1px solid #f0f0f3;
}
.dp-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .14);
}
.dp-post-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}
.dp-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.dp-post-card:hover .dp-post-thumb img {
    transform: scale(1.05);
}
.dp-post-ph {
    width: 100%;
    height: 100%;
    background: var(--dp-gradient, linear-gradient(135deg, #6d5efc, #ff6ea9));
    opacity: .8;
}
.dp-post-body {
    padding: 14px 16px 18px;
}
.dp-post-cat {
    display: inline-block;
    font-size: 12px;
    color: var(--dp-brand, #6d5efc);
    background: color-mix(in srgb, var(--dp-brand, #6d5efc) 12%, #fff);
    padding: 2px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.dp-post-body h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.4;
}
.dp-post-body h3 a {
    color: #1f2330;
    text-decoration: none;
}
.dp-post-body p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

/* ---------- 独立小工具 ----------
 * 重要：RiPro 的 CSS 含 .widget ul>li{padding:5px 0}（优先级 0,1,2）与
 * .sidebar .widget ul{...}（0,2,1），会覆盖单类名选择器。
 * 因此这里所有规则统一使用「双类名」，把优先级抬到 (0,2,0) 以上，确保生效。
 * ------------------------------------------------------------ */
.dp-w { /* 小工具内部容器 */
    width: 100%;
    text-align: left; /* 防止继承父主题 .widget 的 text-align: center */
}

/* ---- 精选文章 ---- */
.dp-widget-list.dp-widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: transparent;
}
.dp-widget-item.dp-widget-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    margin: 0;
    border-bottom: 1px dashed #ececf1;
    list-style: none;
    text-align: left;
}
.dp-widget-item.dp-widget-item:last-child {
    border-bottom: 0;
}
.dp-widget-thumb.dp-widget-thumb {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    background: var(--dp-gradient, linear-gradient(135deg, #6d5efc, #ff6ea9));
}
.dp-widget-thumb.dp-widget-thumb .dp-widget-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}
.dp-widget-ph.dp-widget-ph {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.dp-widget-meta.dp-widget-meta {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}
.dp-widget-title.dp-widget-title {
    display: block;
    font-weight: 600;
    color: #1f2330;
    text-decoration: none;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.dp-widget-title.dp-widget-title:hover {
    color: var(--dp-brand, #6d5efc);
}
.dp-widget-sub.dp-widget-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    color: #9aa0ac;
    text-align: left;
}
.dp-widget-cat.dp-widget-cat {
    display: inline-block;
    font-size: 11px;
    line-height: 1.6;
    color: var(--dp-brand, #6d5efc);
    background: color-mix(in srgb, var(--dp-brand, #6d5efc) 12%, #fff);
    padding: 0 8px;
    border-radius: 999px;
}

/* ---- 渐变配色墙 ---- */
.dp-gradient-wall.dp-gradient-wall {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}
.dp-gradient-wall.dp-gradient-wall .dp-gradient-card {
    height: 82px;
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .1);
}
.dp-gradient-wall.dp-gradient-wall .dp-gradient-name {
    font-size: 12px;
}
.dp-gradient-wall.dp-gradient-wall .dp-gradient-value {
    font-size: 10px;
    opacity: .92;
    word-break: break-all;
}

/* ---- 热门资源 ---- */
.dp-resource-list.dp-resource-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: transparent;
    text-align: left;
}
.dp-resource-item.dp-resource-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    margin: 0;
    border-bottom: 1px dashed #ececf1;
    list-style: none;
    font-size: 14px;
    text-align: left;
}
.dp-resource-item.dp-resource-item:last-child {
    border-bottom: 0;
}
.dp-resource-num.dp-resource-num {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: var(--dp-brand, #6d5efc);
}
.dp-resource-title.dp-resource-title {
    flex: 1 1 auto;
    min-width: 0;
    color: #1f2330;
    text-decoration: none;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}
.dp-resource-title.dp-resource-title:hover {
    color: var(--dp-brand, #6d5efc);
}
.dp-resource-count.dp-resource-count {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--dp-brand, #6d5efc);
    min-width: 20px;
    text-align: right;
}

/* ---- 通用提示 / 空状态 ---- */
.dp-widget-tip.dp-widget-tip,
.dp-widget-empty.dp-widget-empty {
    margin: 8px 0 0;
    padding: 0;
    font-size: 12px;
    color: #9aa0ac;
    text-align: center;
}

/* ---------- 分栏目 Hero ---------- */
.dp-cat-hero {
    border-radius: 18px;
    padding: 40px 28px;
    color: #fff;
    margin: 24px auto;
    max-width: 1180px;
    background: var(--cat-gradient, var(--dp-gradient, linear-gradient(135deg, #6d5efc, #ff6ea9)));
}
.dp-cat-hero-inner {
    max-width: 760px;
}
.dp-cat-title {
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 8px;
    color: #fff;
}
.dp-cat-hero-text {
    margin: 0;
    opacity: .95;
}

/* ---------- 页面通用 ---------- */
.dp-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}
.dp-page-hero {
    text-align: center;
    padding: 30px 0 20px;
}
.dp-page-hero h1 {
    font-size: 34px;
    font-weight: 800;
    margin: 0 0 8px;
    background: var(--dp-gradient, linear-gradient(135deg, #6d5efc, #ff6ea9));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dp-page-hero p {
    color: #6b7280;
    margin: 0;
}

/* ---------- 复制提示 ---------- */
.dp-copy-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(20px);
    background: #1f2330;
    color: #fff;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: all .25s ease;
    z-index: 9999;
}
.dp-copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- 页脚版权 ---------- */
.ripro-child-footer-note {
    text-align: center;
    padding: 18px;
    color: #9aa0ac;
    font-size: 13px;
}

/* ============================================================
 * CPT 模板样式（配色库 / 资源库）
 * ============================================================ */

/* 归档色卡：查看链接 */
.dp-grad-view {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 12px;
    color: #fff;
    text-decoration: none;
    background: rgba(0, 0, 0, .28);
    padding: 3px 10px;
    border-radius: 999px;
    opacity: 0;
    transition: opacity .2s ease;
}
.dp-gradient-card:hover .dp-grad-view {
    opacity: 1;
}

/* 资源分类筛选条 */
.dp-res-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 0 0 26px;
}
.dp-res-filter-item {
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 14px;
    color: #4b5563;
    text-decoration: none;
    background: #f3f4f6;
    transition: all .2s ease;
}
.dp-res-filter-item:hover {
    color: var(--dp-brand, #6d5efc);
}
.dp-res-filter-item.is-active {
    color: #fff;
    background: var(--dp-gradient, linear-gradient(135deg, #6d5efc, #ff6ea9));
}

/* 返回链接 */
.dp-back {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--dp-brand, #6d5efc);
    text-decoration: none;
    font-size: 14px;
}

/* ---------- 配色详情页 ---------- */
.dp-single-color {
    max-width: 900px;
}
.dp-color-big {
    height: 320px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
}
.dp-color-big-hint {
    font-size: 15px;
    font-weight: 700;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
}
.dp-color-big-code {
    font-size: 13px;
    background: rgba(0, 0, 0, .28);
    padding: 5px 14px;
    border-radius: 999px;
}
.dp-color-codes {
    display: flex;
    gap: 20px;
    margin: 18px 0 24px;
    flex-wrap: wrap;
}
.dp-color-codes span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}
.dp-color-codes code {
    background: #f3f4f6;
    padding: 3px 10px;
    border-radius: 6px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.dp-color-desc h1 {
    font-size: 26px;
    margin: 0 0 12px;
}

/* ---------- 资源详情页 ---------- */
.dp-single-resource {
    max-width: 900px;
}
.dp-res-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    border: 1px solid #f0f0f3;
}
.dp-res-cover img {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.dp-res-body {
    padding: 24px 26px 30px;
}
.dp-res-body h1 {
    font-size: 27px;
    margin: 0 0 18px;
}
.dp-res-visit {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 26px;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    background: var(--dp-gradient, linear-gradient(135deg, #6d5efc, #ff6ea9));
    transition: transform .2s ease, box-shadow .2s ease;
}
.dp-res-visit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(109, 94, 252, .32);
}
.dp-res-desc {
    color: #4b5563;
    line-height: 1.85;
}

/* 付费门禁框 */
.dp-res-paybox {
    margin: 0 0 20px;
    padding: 20px 22px;
    border-radius: 14px;
    border: 1px dashed #d8dbe3;
    background: linear-gradient(180deg, #fbfbfe 0%, #f7f7fb 100%);
}
.dp-res-paybox-title {
    font-weight: 700;
    color: #1f2330;
    margin-bottom: 8px;
}
.dp-res-paybox-price {
    margin-bottom: 14px;
    color: #4b5563;
    font-size: 14px;
}
.dp-res-paybox-price b {
    font-size: 20px;
    color: var(--dp-brand, #6d5efc);
}

/* 短代码容器 */
.dp-sc {
    margin: 18px 0;
}

/* ============================================================
 * 设计门户视觉嵌入 RiPro（父主题卡片 / 导航 / 按钮）
 * 仅在父主题既有标记上做视觉增强，不改变结构。
 * ============================================================ */

/* 文章卡片 */
.post-item.item-grid,
.post-item.item-list {
    border-radius: 14px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.post-item.item-grid:hover,
.post-item.item-list:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .12);
}
.post-item .entry-title a {
    transition: color .2s ease;
}
.post-item .entry-title a:hover {
    color: var(--dp-brand, #6d5efc);
}
.post-item .entry-cat-dot a {
    background: var(--dp-gradient, linear-gradient(135deg, #6d5efc, #ff6ea9));
    color: #fff;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    text-decoration: none;
}

/* 导航 */
.navbar .main-menu > li.current-menu-item > a,
.navbar .main-menu > li.current-menu-ancestor > a {
    color: var(--dp-brand, #6d5efc);
    font-weight: 700;
}
.navbar .main-menu > li > a {
    position: relative;
    transition: color .2s ease;
}
.navbar .main-menu > li > a:hover {
    color: var(--dp-brand, #6d5efc);
}
.navbar .main-menu > li.current-menu-item > a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: var(--dp-gradient, linear-gradient(135deg, #6d5efc, #ff6ea9));
}

/* 按钮（RiPro 基于 Bootstrap，.btn 系列） */
.btn-primary,
.btn-danger,
.btn-success {
    border: 0;
    background-image: var(--dp-gradient, linear-gradient(135deg, #6d5efc, #ff6ea9));
    transition: transform .2s ease, box-shadow .2s ease;
}
.btn-primary:hover,
.btn-danger:hover,
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(109, 94, 252, .28);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .dp-gradient-grid,
    .dp-gradient-grid--full,
    .dp-post-grid,
    .dp-post-grid--full {
        grid-template-columns: repeat(2, 1fr);
    }
    .dp-color-big {
        height: 240px;
    }
}
@media (max-width: 560px) {
    .dp-gradient-grid,
    .dp-gradient-grid--full,
    .dp-post-grid,
    .dp-post-grid--full {
        grid-template-columns: 1fr;
    }
    .dp-hero {
        padding: 70px 16px 60px;
    }
}
