.module-config-admin-page .recharge-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.module-config-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    min-height: 36rem;
}
.module-config-list-panel,
.module-config-body-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    min-width: 0;
}
.module-config-list-title {
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .75rem;
}
.module-config-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 10px;
    padding: .75rem .85rem;
    margin-bottom: .55rem;
    color: #334155;
}
.module-config-item small {
    display: block;
    margin-top: .2rem;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .75rem;
}
.module-config-item.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
}
.module-config-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}
.module-config-section-head h2 {
    margin: 0;
    font-size: 1.05rem;
}
.module-config-admin-page .mc-tool-row {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: .9rem;
    margin-bottom: .85rem;
    background: #f8fafc;
}
.mc-tool-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}
.module-config-admin-page .mc-tool-row--add {
    background: #fff;
    border-style: dashed;
    padding: .75rem;
}
.mc-add-tool-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 72px;
}
.mc-add-tool-card .mc-plus-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 1.5px dashed #94a3b8;
    border-radius: 10px;
    color: #64748b;
    background: #fff;
    cursor: pointer;
}
.mc-add-tool-card .form-select {
    max-width: 280px;
}
.mc-plus-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mc-plus-icon svg {
    width: 22px;
    height: 22px;
}
.mc-media-list,
.mc-poster-list {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-start;
}
.mc-media-item {
    position: relative;
    width: 120px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.mc-media-item img,
.mc-media-item video {
    display: block;
    width: 100%;
    height: 88px;
    object-fit: cover;
    background: #0f172a08;
}
.mc-media-item button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    line-height: 1;
    font-size: 14px;
}
.mc-media-type {
    display: block;
    padding: .25rem .4rem;
    font-size: .72rem;
    color: #64748b;
    text-align: center;
}
.mc-media-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 118px;
    border-style: dashed;
    cursor: pointer;
    color: #64748b;
    background: #fff;
}
.mc-media-add input,
.mc-poster-add input {
    display: none !important;
}
.mc-media-add:hover,
.mc-poster-add-tile:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}
.mc-media-add .mc-plus-icon {
    flex: 1;
    width: 100%;
    min-height: 88px;
}
.module-config-admin-page .mc-poster-card,
.module-config-admin-page .mc-poster-add {
    width: 160px;
    flex: 0 0 160px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.module-config-admin-page .mc-poster-preview,
.module-config-admin-page .mc-poster-add-tile {
    position: relative;
    box-sizing: border-box;
    width: 160px;
    height: 284px;
    flex-shrink: 0;
    aspect-ratio: auto;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .55rem;
}
.module-config-admin-page .mc-poster-preview img {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    object-position: center;
    display: block;
}
.module-config-admin-page .mc-poster-preview {
    cursor: pointer;
}
.mc-poster-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    line-height: 1;
    font-size: 14px;
    z-index: 3;
}
.mc-poster-zoom {
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 3;
    height: 24px;
    padding: 0 .45rem;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: .68rem;
    line-height: 24px;
}
.mc-range-field {
    margin-top: .55rem;
}
.mc-range-field .form-label {
    margin-bottom: .2rem;
    font-size: .78rem;
}
.mc-range-input {
    width: 100%;
    display: block;
    margin: 0;
    accent-color: #2563eb;
}
.mc-range-ticks {
    display: flex;
    justify-content: space-between;
    font-size: .72rem;
    color: #64748b;
    margin-top: .1rem;
}
.mc-poster-add {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.module-config-admin-page .mc-poster-add-tile {
    flex-direction: column;
    gap: .35rem;
    border-style: dashed;
    color: #64748b;
    font-size: .82rem;
    margin-bottom: 0;
}
.mc-poster-add-tile .mc-plus-icon {
    width: 48px;
    height: 48px;
    border: 1.5px dashed currentColor;
    border-radius: 12px;
}
.mc-qr-placeholder {
    position: absolute;
    box-sizing: border-box;
    width: calc(var(--qr-size, 0.18) * 100%);
    aspect-ratio: 1;
    border: 1px solid #e11d48;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}
.mc-qr-modules {
    width: calc((1 - 2 * var(--qr-margin, 0.06)) * 100%);
    height: calc((1 - 2 * var(--qr-margin, 0.06)) * 100%);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
.mc-qr-placeholder.is-bottom-center { left: 50%; bottom: calc(var(--qr-inset, 0.045) * 100%); transform: translateX(-50%); }
.mc-qr-placeholder.is-bottom-left { left: calc(var(--qr-inset, 0.045) * 100%); bottom: calc(var(--qr-inset, 0.045) * 100%); }
.mc-qr-placeholder.is-bottom-right { right: calc(var(--qr-inset, 0.045) * 100%); bottom: calc(var(--qr-inset, 0.045) * 100%); }
.mc-qr-placeholder.is-top-left { left: calc(var(--qr-inset, 0.045) * 100%); top: calc(var(--qr-inset, 0.045) * 100%); }
.mc-qr-placeholder.is-top-center { left: 50%; top: calc(var(--qr-inset, 0.045) * 100%); transform: translateX(-50%); }
.mc-qr-placeholder.is-top-right { right: calc(var(--qr-inset, 0.045) * 100%); top: calc(var(--qr-inset, 0.045) * 100%); }
.mc-name-placeholder {
    position: absolute;
    z-index: 2;
    max-width: calc(100% - var(--name-inset, 7px) * 2);
    line-height: 1;
    white-space: nowrap;
    font-weight: 400;
    pointer-events: none;
    text-shadow: none;
    /* 水平调节：0=贴底、1=贴顶，1em 为文字自身行高，与 canvas 烧录口径一致 */
    bottom: calc(var(--name-inset, 7px) + var(--name-level, 0) * (100% - var(--name-inset, 7px) * 2 - 1em));
}
.mc-name-placeholder[hidden] {
    display: none;
}
.mc-name-placeholder.is-top-left,
.mc-name-placeholder.is-bottom-left { left: var(--name-inset, 7px); }
.mc-name-placeholder.is-top-center,
.mc-name-placeholder.is-bottom-center { left: 50%; transform: translateX(-50%); }
.mc-name-placeholder.is-top-right,
.mc-name-placeholder.is-bottom-right { right: var(--name-inset, 7px); }
.module-config-admin-page .mc-poster-card {
    position: relative;
}
.mc-style-area {
    position: relative;
    margin-top: .5rem;
}
.mc-style-row {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.mc-style-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    width: 100%;
    height: 34px;
    padding: 0 .5rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-size: .78rem;
    line-height: 1;
    cursor: pointer;
}
.mc-style-btn svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}
.mc-style-btn:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
}
.mc-style-btn.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
}
.mc-style-layer {
    position: absolute;
    bottom: 0;
    left: calc(100% + 8px);
    z-index: 30;
    width: 236px;
    box-sizing: border-box;
    padding: .75rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .16);
}
.mc-style-layer.is-flipped {
    left: auto;
    right: calc(100% + 8px);
}
.mc-style-layer[hidden] {
    display: none;
}
.mc-style-layer .form-label {
    font-size: .78rem;
}
.mc-style-layer .mc-range-field {
    margin-top: .35rem;
}
.mc-name-appearance {
    display: flex;
    gap: .5rem;
    margin-top: .55rem;
}
.mc-name-appearance-half {
    flex: 1 1 50%;
    min-width: 0;
}
.mc-name-style-pair {
    display: flex;
    align-items: center;
    gap: .35rem;
}
.mc-name-style-pair .form-select {
    flex: 1 1 auto;
    min-width: 0;
}
.mc-name-color {
    flex: 0 0 26px;
    display: block;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.mc-name-color::-webkit-color-swatch-wrapper {
    padding: 0;
}
.mc-name-color::-webkit-color-swatch {
    border: 0;
    border-radius: 50%;
}
.mc-name-color::-moz-color-swatch {
    border: 0;
    border-radius: 50%;
}
.mc-empty-hint {
    color: #64748b;
    font-size: .9rem;
    margin: 0;
}
.mc-generate-form {
    max-width: 42rem;
}
.mc-mode-options {
    display: flex;
    gap: .75rem;
}
.mc-mode-option {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .55rem .9rem;
    background: #f8fafc;
    cursor: pointer;
}
.mc-mode-option:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
}
.mc-duration-row {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.mc-duration-row .form-control {
    max-width: 12rem;
}
.mc-duration-hint {
    color: #475569;
    font-size: .9rem;
    white-space: nowrap;
}
/* ---------- AI工具类目：类目卡片 + 横向工具列表 ---------- */
.mc-cat-list {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}
.mc-cat-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    padding: .85rem .9rem .9rem;
}
.mc-cat-card--none {
    background: #f8fafc;
    border-style: dashed;
}
.mc-cat-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .7rem;
}
.mc-cat-name {
    color: #0f172a;
    font-size: .95rem;
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mc-cat-count {
    color: #94a3b8;
    font-size: .78rem;
}
.mc-cat-tag {
    margin-left: auto;
    color: #64748b;
    font-size: .78rem;
    background: #eef2f6;
    border-radius: 999px;
    padding: .2rem .6rem;
}
.mc-cat-ops {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .3rem;
}
.mc-cat-ops button {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    padding: 0;
}
.mc-cat-ops button:hover:not(:disabled) {
    border-color: #2563eb;
    color: #1d4ed8;
    background: #eff6ff;
}
.mc-cat-ops button:disabled {
    opacity: .35;
    cursor: not-allowed;
}
.mc-cat-ops button svg {
    width: 15px;
    height: 15px;
}
/* 横向工具轨道：超出部分左右滑动 */
.mc-cat-track {
    display: flex;
    align-items: stretch;
    gap: .6rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: .25rem .15rem .5rem;
    scrollbar-width: thin;
}
.mc-cat-track::-webkit-scrollbar {
    height: 8px;
}
.mc-cat-track::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
.mc-cat-tool {
    position: relative;
    flex: 0 0 108px;
    width: 108px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    padding: .4rem;
    cursor: grab;
    user-select: none;
}
.mc-cat-tool.is-dragging {
    opacity: .45;
}
.mc-cat-tool.is-dragover {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .18);
}
.mc-cat-tool-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    background: #f1f5f9;
    overflow: hidden;
}
.mc-cat-tool-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mc-cat-tool-icon {
    font-size: 26px;
    line-height: 1;
}
.mc-cat-tool-name {
    display: block;
    margin-top: .35rem;
    font-size: .76rem;
    color: #334155;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    word-break: break-all;
}
/* 左下角拖拽手柄 */
.mc-cat-drag {
    position: absolute;
    left: .35rem;
    bottom: .3rem;
    width: 16px;
    height: 16px;
    color: #94a3b8;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
}
.mc-cat-tool:hover .mc-cat-drag,
.mc-cat-tool:focus-within .mc-cat-drag {
    opacity: 1;
}
.mc-cat-drag svg {
    width: 100%;
    height: 100%;
}
.mc-cat-tool-remove {
    position: absolute;
    top: .25rem;
    right: .25rem;
    width: 18px;
    height: 18px;
    line-height: 1;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, .62);
    color: #fff;
    font-size: 13px;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease;
}
.mc-cat-tool:hover .mc-cat-tool-remove {
    opacity: 1;
}
/* 左上角「工具角标」编辑按钮 */
.mc-cat-tool-edit {
    position: absolute;
    top: .3rem;
    left: .3rem;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: rgba(15, 23, 42, .62);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease, background-color .15s ease;
}
.mc-cat-tool:hover .mc-cat-tool-edit,
.mc-cat-tool:focus-within .mc-cat-tool-edit {
    opacity: 1;
}
.mc-cat-tool-edit:hover {
    background: #2563eb;
}
.mc-cat-tool-edit svg {
    width: 12px;
    height: 12px;
}
/* 配置态角标预览 */
.mc-cat-tool-badge {
    position: absolute;
    top: .3rem;
    right: .3rem;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 16px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .2);
}
.mc-cat-tool-badge--new {
    background: linear-gradient(135deg, #22d3ee, #2563eb);
}
.mc-cat-tool-badge--hot {
    background: linear-gradient(135deg, #fb7185, #ea580c);
}
.mc-cat-tool:hover .mc-cat-tool-badge {
    right: 1.45rem;
}
/* 角标弹窗表单 */
.mc-badge-form {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}
.mc-badge-target {
    margin: 0;
    color: #0f172a;
    font-size: .92rem;
    font-weight: 600;
}
.mc-badge-options {
    display: flex;
    gap: .5rem;
}
.mc-badge-option {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .45rem .8rem;
    background: #f8fafc;
    cursor: pointer;
    font-size: .88rem;
}
.mc-badge-option:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}
.mc-badge-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    color: #475569;
    font-size: .86rem;
}
.mc-badge-field input {
    max-width: 14rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .4rem .6rem;
    font-size: .88rem;
}
.mc-badge-hint {
    margin: 0;
    color: #94a3b8;
    font-size: .8rem;
}
.mc-cat-tool--add {
    flex: 0 0 108px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    border-style: dashed;
    border-color: #94a3b8;
    color: #64748b;
    cursor: pointer;
    background: #fff;
}
.mc-cat-tool--add:hover {
    border-color: #2563eb;
    color: #1d4ed8;
}
.mc-cat-tool--add .mc-cat-tool-name {
    margin-top: 0;
}
/* 下拉用 fixed 定位：由 JS 按「+」卡片位置计算，避免被横向滚动轨道与类目卡片裁剪 */
.mc-cat-menu {
    position: fixed;
    z-index: 1080;
    width: 15rem;
    max-height: 20rem;
    overflow-y: auto;
    padding: .4rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
}
.mc-cat-menu-title {
    padding: .25rem .35rem .4rem;
    color: #94a3b8;
    font-size: .74rem;
}
.mc-cat-menu--empty {
    color: #94a3b8;
    font-size: .8rem;
    padding: .6rem .7rem;
}
.mc-cat-menu-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: none;
    padding: .3rem .35rem;
    text-align: left;
    cursor: pointer;
}
.mc-cat-menu-item:hover {
    background: #eff6ff;
}
.mc-cat-menu-cover {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #f1f5f9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.mc-cat-menu-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mc-cat-menu-name {
    font-size: .82rem;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mc-cat-add {
    margin-top: .9rem;
}
.mc-cat-add-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    border: 1px dashed #94a3b8;
    border-radius: 12px;
    padding: .75rem .9rem;
    background: #f8fafc;
}
.mc-cat-add-card strong {
    color: #0f172a;
    font-size: .9rem;
}
.mc-cat-add-card .form-select {
    max-width: 16rem;
}
@media (max-width: 991.98px) {
    .module-config-layout { grid-template-columns: 1fr; }
    .module-config-admin-page .recharge-head { flex-direction: column; align-items: stretch; }
}
