/* ============================================================
 * 白砚 · 内容管理卡
 * 操作条 + 卡商城 + 商品编辑器
 * ============================================================ */

/* ---------- 注入到「三个点」下拉的编辑/删除项 ---------- */
/* 含本插件菜单项的下拉菜单：给足宽度，避免文字被挤成一列 */
.dropdown-menu.baiyc-cc-has {
    min-width: 168px;
}

.dropdown-menu.baiyc-cc-has > li > a {
    white-space: nowrap;
}

/* 小小的消耗提示 */
.baiyc-cc-mtip {
    display: block;
    font-size: 11px;
    opacity: .7;
    margin-left: 22px;
    margin-top: -2px;
    white-space: nowrap;
}

/* JS 新建的下拉（文章原本没有三个点时）与主题风格一致 */
.baiyc-cc-dd {
    position: relative;
    display: inline-block;
}

.baiyc-cc-dd .dropdown-menu {
    position: absolute;
    right: 0;
    left: auto;
    top: 100%;
    z-index: 999;
    display: none;
    padding: 6px 0;
    border-radius: 10px;
    background: var(--main-bg-color, #fff);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .16);
    list-style: none;
    margin: 6px 0 0;
}

.baiyc-cc-dd.open .dropdown-menu,
.baiyc-cc-dd .dropdown-menu.show {
    display: block;
}

.baiyc-cc-dd .dropdown-menu > li > a {
    display: block;
    padding: 8px 16px;
    color: var(--main-color, #4e5358);
    text-decoration: none;
    white-space: nowrap;
}

.baiyc-cc-dd .dropdown-menu > li > a:hover {
    background: var(--body-bg-color, #f5f6f7);
}

/* ---------- 商城（套用父主题商品卡片样式：product-lists-row / product-item） ---------- */
.baiyc-cc-shop {
    margin: 16px 0;
}

/* 商城列表页的分类 / 排序导航 */
.baiyc-cc-shop-cats {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    padding-bottom: 8px;
}

.baiyc-cc-shop-cat {
    flex: 0 0 auto;
    color: var(--main-color, #4e5358);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.baiyc-cc-shop-sorts {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--muted-bg-color, #eee);
    font-size: 13px;
}

.baiyc-cc-shop-sort {
    color: var(--muted-color, #777);
    text-decoration: none;
}

.baiyc-cc-shop-cat.focus-color,
.baiyc-cc-shop-sort.focus-color {
    color: var(--focus-color, #f04494);
}

/* 无图时的图标缩略图 */
.baiyc-cc-card .item-thumbnail .baiyc-cc-thumb-ic {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 140px;
    font-size: 48px;
    color: var(--focus-color, #f04494);
}

.baiyc-cc-card .item-thumbnail .baiyc-cc-thumb-ic .icon,
.baiyc-cc-card .item-thumbnail .baiyc-cc-thumb-ic svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.baiyc-cc-card .baiyc-cc-card-meta {
    margin: 6px 0 2px;
}

.baiyc-cc-card .baiyc-cc-buy {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

/* ---------- 我的背包：方形卡片网格（8 列 × 4 行） ---------- */
.baiyc-cc-bp {
    margin: 16px 0;
}

.baiyc-cc-bp-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
}

/* 首屏纯 CSS 只显示前 32 个（8×4）；JS 接管翻页后加 .bp-js 解除此限制 */
.baiyc-cc-bp-grid:not(.bp-js) .baiyc-cc-bp-sq:nth-child(n+33) {
    display: none;
}

.baiyc-cc-bp-sq {
    cursor: pointer;
    border-radius: 12px;
    background: var(--main-bg-color, #fff);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    padding: 10px;
    text-align: center;
    transition: transform .15s, box-shadow .15s;
}

.baiyc-cc-bp-sq:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.baiyc-cc-bp-sq-vi {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: #fff;
    background: linear-gradient(135deg, var(--focus-color, #f04494), #7c3aed);
}

.baiyc-cc-bp-sq-vi img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.baiyc-cc-bp-sq-badge {
    position: absolute;
    right: 4px;
    top: 4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 20px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.baiyc-cc-bp-sq-name {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--key-color, #333);
}

/* 分页 */
.baiyc-cc-bp-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
}

.baiyc-cc-bp-pager .bp-pg {
    min-width: 32px;
    height: 32px;
    line-height: 30px;
    padding: 0 10px;
    text-align: center;
    border: 1px solid var(--muted-bg-color, #eee);
    border-radius: 8px;
    color: var(--main-color, #4e5358);
    text-decoration: none;
}

.baiyc-cc-bp-pager .bp-pg.active {
    background: var(--focus-color, #f04494);
    border-color: var(--focus-color, #f04494);
    color: #fff;
}

/* 背包弹窗 */
.baiyc-cc-bp-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}

.baiyc-cc-bp-modal.show {
    display: block;
}

.baiyc-cc-bp-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
}

.baiyc-cc-bp-modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 440px;
    max-height: 84vh;
    overflow: auto;
    padding: 22px;
    border-radius: 14px;
    background: var(--main-bg-color, #fff);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.baiyc-cc-bp-modal-game {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted-2-color, #888);
}
.baiyc-cc-bp-modal-game:empty,
.baiyc-cc-bp-modal-game[hidden] {
    display: none;
}
.baiyc-cc-bp-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.baiyc-cc-bp-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--key-color, #333);
}

.baiyc-cc-bp-modal-x {
    font-size: 22px;
    line-height: 1;
    color: var(--muted-2-color, #999);
    text-decoration: none;
}

.baiyc-cc-bp-modal-meta {
    margin-bottom: 12px;
}

.baiyc-cc-bp-modal-count {
    margin-left: 6px;
    color: var(--focus-color, #f04494);
    font-weight: 700;
}

.baiyc-cc-bp-modal-desc {
    color: var(--main-color, #4e5358);
    line-height: 1.8;
}

.baiyc-cc-bp-modal-extra {
    margin-top: 12px;
}

.baiyc-cc-bp-deliv-title {
    font-weight: 700;
    margin: 6px 0;
    color: var(--key-color, #333);
}

.baiyc-cc-bp-deliv {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: var(--body-bg-color, #f5f6f7);
    color: var(--main-color, #4e5358);
    word-break: break-all;
    line-height: 1.7;
}

.baiyc-cc-bp-modal-link {
    margin-top: 12px;
    text-align: center;
}

@media (max-width: 1100px) {
    .baiyc-cc-bp-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 768px) {
    .baiyc-cc-bp-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 480px) {
    .baiyc-cc-bp-grid { grid-template-columns: repeat(3, 1fr); }
    .baiyc-cc-bp-sq-name { font-size: 12px; }
}

/* ---------- 商品编辑器 ---------- */
.baiyc-cc-pe-wrap {
    margin: 20px auto;
}

.baiyc-cc-pe {
    padding: 24px;
    max-width: 760px;
    margin: 0 auto;
}

.baiyc-cc-pe-h {
    margin: 0 0 16px;
    font-size: 20px;
}

.baiyc-cc-pe-label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
    color: var(--key-color, #333);
}

.baiyc-cc-pe-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--muted-bg-color, #eee);
    border-radius: 10px;
    background: var(--body-bg-color, #f5f6f7);
    color: var(--main-color, #4e5358);
    font-size: 14px;
    box-sizing: border-box;
}

textarea.baiyc-cc-pe-input {
    resize: vertical;
}

.baiyc-cc-pe-thumb {
    margin-top: 8px;
}

.baiyc-cc-pe-thumb img {
    max-width: 160px;
    border-radius: 10px;
}

.baiyc-cc-pe-actions {
    margin-top: 20px;
}

.baiyc-cc-pe-note {
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted-2-color, #999);
    line-height: 1.7;
}

/* 载入态 */
.is-loading {
    opacity: .6;
    pointer-events: none;
}

.baiyc-cc-buy .but.disabled {
    opacity: .5;
    pointer-events: none;
}

/* ---------- 购买确认弹窗 ---------- */
.baiyc-cc-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}

.baiyc-cc-modal.show {
    display: block;
}

.baiyc-cc-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
}

.baiyc-cc-modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 400px;
    max-height: 86vh;
    overflow: auto;
    padding: 20px;
    border-radius: 14px;
    background: var(--main-bg-color, #fff);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.baiyc-cc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.baiyc-cc-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--key-color, #333);
}

.baiyc-cc-modal-x {
    font-size: 22px;
    line-height: 1;
    color: var(--muted-2-color, #999);
    text-decoration: none;
}

.baiyc-cc-modal-qtyrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--main-color, #4e5358);
}

.baiyc-cc-step {
    width: 32px;
    height: 32px;
    border: 1px solid var(--muted-bg-color, #eee);
    border-radius: 8px;
    background: var(--body-bg-color, #f5f6f7);
    color: var(--main-color, #4e5358);
    font-size: 16px;
    cursor: pointer;
}

.baiyc-cc-modal-qty {
    width: 70px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--muted-bg-color, #eee);
    border-radius: 8px;
    background: var(--body-bg-color, #f5f6f7);
    color: var(--main-color, #4e5358);
}

.baiyc-cc-modal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--muted-bg-color, #eee);
    font-size: 14px;
}

.baiyc-cc-modal-row span {
    color: var(--muted-color, #777);
}

.baiyc-cc-modal-row b {
    color: var(--key-color, #333);
}

.baiyc-cc-modal-actions {
    margin-top: 18px;
    text-align: center;
}

.baiyc-cc-modal-ok.disabled {
    opacity: .5;
    pointer-events: none;
}

.baiyc-cc-modal-note {
    margin: 12px 0 4px;
}

.baiyc-cc-modal-notelabel {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--key-color, #333);
}

.baiyc-cc-modal-noteinput {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--muted-bg-color, #eee);
    border-radius: 10px;
    background: var(--body-bg-color, #f5f6f7);
    color: var(--main-color, #4e5358);
    box-sizing: border-box;
    resize: vertical;
}
