/* ===== AI角色库 — Talegp 风格 ===== */

.character-library-page {
    display: none;
    position: fixed;
    inset: 0;
    background: #0a0a0f;
    z-index: 900;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}
.character-library-page.active {
    display: flex;
}

/* ========== 顶部标题栏 ========== */
.cl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    background: #0a0a0f;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    flex-shrink: 0;
    min-height: 52px;
}
.cl-title {
    font-size: 16px;
    font-weight: 600;
    color: #c8c8d4;
    margin: 0;
    letter-spacing: 0.3px;
}
.cl-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cl-search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.cl-search-icon {
    position: absolute;
    left: 12px;
    color: rgba(255,255,255,0.18);
    pointer-events: none;
}
.cl-search-input {
    width: 220px;
    height: 34px;
    padding: 0 14px 0 34px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    color: #c0c0cc;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.cl-search-input::placeholder { color: rgba(255,255,255,0.15); }
.cl-search-input:focus {
    border-color: rgba(124,140,255,0.3);
    background: rgba(255,255,255,0.06);
}
.cl-create-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 14px;
    background: linear-gradient(135deg, #6c7afc, #a855f7);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}
.cl-create-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.cl-create-btn:active { transform: translateY(0); }

/* ========== 主体布局 ========== */
.cl-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== 左侧分类侧栏 ========== */
.cl-sidebar {
    width: 180px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.04);
    overflow-y: auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.06) transparent;
}
.cl-sidebar::-webkit-scrollbar { width: 3px; }
.cl-sidebar::-webkit-scrollbar-track { background: transparent; }
.cl-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 2px; }

.cl-sidebar-header {
    padding: 16px 16px 10px;
}
.cl-sidebar-title {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.2);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}
.cl-category-tree {
    padding: 4px 0;
    flex: 1;
}
.cl-cat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    cursor: pointer;
    color: rgba(255,255,255,0.35);
    font-size: 12px;
    transition: all 0.15s;
    border-left: 2px solid transparent;
    user-select: none;
    margin: 0;
}
.cl-cat-item:hover {
    background: rgba(255,255,255,0.025);
    color: rgba(255,255,255,0.55);
}
.cl-cat-item.active {
    background: rgba(124,140,255,0.06);
    color: #9da8ff;
    border-left-color: #7c8cff;
    font-weight: 500;
}
.cl-cat-item .cl-cat-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.35;
}
.cl-cat-item.active .cl-cat-icon { opacity: 0.85; }
.cl-cat-item .cl-cat-arrow {
    width: 10px;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: rgba(255,255,255,0.35);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.cl-cat-item.expanded .cl-cat-arrow { transform: rotate(90deg); }
.cl-cat-children {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}
.cl-cat-children.show {
    max-height: 1200px;
}
.cl-cat-item.child {
    padding-left: 44px;
    font-size: 11px;
}
.cl-cat-item.child .cl-cat-icon { width: 14px; height: 14px; }
.cl-cat-count {
    margin-left: auto;
    font-size: 10px;
    color: rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.03);
    padding: 1px 6px;
    border-radius: 6px;
    min-width: 18px;
    text-align: center;
}
.cl-cat-item.active .cl-cat-count {
    background: rgba(124,140,255,0.1);
    color: rgba(255,255,255,0.3);
}
.cl-cat-loading {
    padding: 20px;
    text-align: center;
    color: rgba(255,255,255,0.14);
    font-size: 11px;
}

/* ========== 右侧内容区 ========== */
.cl-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ========== 筛选栏 — 下拉框风格 ========== */
.cl-filter-bar {
    padding: 10px 24px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: transparent;
    align-items: flex-start;
}

/* 每个维度一个下拉容器 */
.cl-dropdown {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* 下拉按钮 */
.cl-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    height: auto;
    min-height: 28px;
    padding: 3px 8px 3px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.025);
    color: rgba(255,255,255,0.3);
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s;
    font-family: inherit;
    user-select: none;
    flex-wrap: wrap;
}
.cl-dropdown-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.5);
}
.cl-dropdown-btn.active {
    background: rgba(124,140,255,0.08);
    border-color: rgba(124,140,255,0.2);
    color: #9da8ff;
}
.cl-dropdown-plus {
    font-weight: 500;
    font-size: 12px;
    line-height: 1;
}
.cl-dropdown-label {
    font-weight: 400;
}
/* 选中后的值显示 */
.cl-dropdown-filter-label {
    color: rgba(255,255,255,0.5);
}
.cl-dropdown-filter-sep {
    color: rgba(255,255,255,0.2);
    margin: 0 1px;
}
.cl-dropdown-filter-val {
    color: #9da8ff;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}
.cl-dropdown-filter-more {
    font-size: 10px;
    color: rgba(124,140,255,0.5);
    margin-left: 1px;
}
.cl-dropdown-arrow {
    margin-left: 2px;
    transition: transform 0.2s;
    opacity: 0.4;
    flex-shrink: 0;
}
.cl-dropdown.open .cl-dropdown-arrow {
    transform: rotate(180deg);
}
.cl-dropdown.open .cl-dropdown-btn {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
}
/* 清除筛选按钮 */
.cl-clear-filters-btn {
    height: 24px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,80,80,0.2);
    background: rgba(255,80,80,0.06);
    color: rgba(255,100,100,0.7);
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    font-family: inherit;
}
.cl-clear-filters-btn:hover {
    background: rgba(255,80,80,0.12);
    border-color: rgba(255,80,80,0.35);
    color: #ff7777;
}

/* 下拉菜单 */
.cl-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 130px;
    max-height: 220px;
    overflow-y: auto;
    background: #17171f;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 4px 0;
    z-index: 100;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.06) transparent;
}
.cl-dropdown-menu::-webkit-scrollbar { width: 3px; }
.cl-dropdown-menu::-webkit-scrollbar-track { background: transparent; }
.cl-dropdown-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
.cl-dropdown.open .cl-dropdown-menu {
    display: block;
}

/* 下拉菜单项 */
.cl-dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    transition: all 0.12s;
    white-space: nowrap;
}
.cl-dropdown-item:hover {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.85);
}
.cl-dropdown-item:has(.cl-dropdown-check:checked) {
    background: rgba(124,140,255,0.06);
    color: #9da8ff;
}
.cl-dropdown-check {
    display: none;
}
.cl-dropdown-checkmark {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid rgba(255,255,255,0.18);
    flex-shrink: 0;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cl-dropdown-check:checked + .cl-dropdown-checkmark {
    background: rgba(124,140,255,0.2);
    border-color: rgba(124,140,255,0.35);
}
.cl-dropdown-check:checked + .cl-dropdown-checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #9da8ff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* 已选标签条 */
.cl-dropdown-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}
.cl-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px 1px 4px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    white-space: nowrap;
    user-select: none;
    transition: all 0.15s;
}
.cl-chip:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}
.cl-chip-x {
    cursor: pointer;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    font-size: 10px;
    line-height: 1;
    opacity: 0.5;
    transition: all 0.12s;
    flex-shrink: 0;
}
.cl-chip-x:hover {
    opacity: 1;
    background: rgba(255,80,80,0.3);
    color: #ff9999;
}

/* ========== 角色卡片网格 ========== */
.cl-card-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(134px, 1fr));
    gap: 14px;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.06) transparent;
}
.cl-card-grid::-webkit-scrollbar { width: 4px; }
.cl-card-grid::-webkit-scrollbar-track { background: transparent; }
.cl-card-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 2px; }

.cl-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: rgba(255,255,255,0.12);
    font-size: 13px;
}

/* 角色卡片 — Talegp 风格 */
.cl-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}
.cl-card:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(124,140,255,0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(124,140,255,0.06);
}
.cl-card-img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    background: rgba(255,255,255,0.015);
}
.cl-card-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, rgba(124,140,255,0.05), rgba(168,85,247,0.05));
    display: flex;
    align-items: center;
    justify-content: center;
}
.cl-card-placeholder-icon {
    font-size: 42px;
    opacity: 0.15;
}
.cl-card-info {
    padding: 8px 10px 10px;
    flex-shrink: 0;
}
.cl-card-name {
    font-size: 12px;
    font-weight: 600;
    color: #d0d0d8;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
}
.cl-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}
.cl-card-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    background: rgba(124,140,255,0.06);
    color: rgba(157,168,255,0.5);
    white-space: nowrap;
    line-height: 1.4;
}
.cl-card-category {
    font-size: 9px;
    color: rgba(255,255,255,0.13);
    margin-top: 3px;
}
.cl-card-recommend {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(108,122,252,0.12));
    color: #a78bfa;
    margin-bottom: 3px;
}

/* ========== 空状态 ========== */
.cl-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 0;
    color: rgba(255,255,255,0.08);
}
.cl-empty-icon {
    font-size: 64px;
    margin-bottom: 12px;
    opacity: 0.2;
}
.cl-empty-text {
    font-size: 14px;
}

/* ========== 分页 ========== */
.cl-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 14px 24px;
    border-top: 1px solid rgba(255,255,255,0.03);
    flex-shrink: 0;
    background: transparent;
}
.cl-page-btn {
    min-width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.02);
    color: rgba(255,255,255,0.3);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    transition: all 0.15s;
}
.cl-page-btn:hover {
    background: rgba(255,255,255,0.06);
    color: #c0c0cc;
}
.cl-page-btn.active {
    background: linear-gradient(135deg, #6c7afc, #a855f7);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}
.cl-page-btn:disabled {
    opacity: 0.15;
    cursor: not-allowed;
}

/* ========== 详情弹窗 ========== */
.cl-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}
.cl-detail-panel {
    width: calc(100vw - 400px);
    max-width: calc(100vw - 400px);
    max-height: 94vh;
    background: #15151d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}
.cl-detail-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 18px;
    transition: all 0.15s;
}
.cl-detail-close:hover {
    background: rgba(255,255,255,0.15);
    color: #e0e0e6;
}

/* 顶部头部 */
.cl-detail-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 28px 14px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cl-detail-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cl-detail-name {
    font-size: 22px;
    font-weight: 700;
    color: #e8e8ef;
    margin: 0;
    letter-spacing: 0.3px;
}
.cl-detail-role-tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.45);
    font-size: 12px;
}
.cl-detail-category {
    font-size: 13px;
    color: rgba(255,255,255,0.38);
}

/* 可滚动主体 */
.cl-detail-body {
    overflow-y: auto;
    flex: 1;
}

/* 左右分栏 */
.cl-detail-layout {
    display: flex;
    gap: 0;
    min-height: 500px;
}

/* 左侧图片区 */
.cl-detail-gallery {
    width: 50%;
    flex-shrink: 0;
    padding: 20px 16px 20px 28px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.04);
}
/* 图片网格：上三下一 */
.cl-detail-img-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
    flex: 1;
}
.cl-detail-grid-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.cl-detail-grid-cell:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: 2;
}
.cl-detail-grid-caption {
    font-size: 11px;
    color: rgba(255,255,255,0.34);
    text-align: center;
    line-height: 1.3;
}
.cl-detail-grid-item {
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.03);
}
/* 上排3张：竖图比例 */
.cl-detail-grid-cell:nth-child(1) .cl-detail-grid-item,
.cl-detail-grid-cell:nth-child(2) .cl-detail-grid-item,
.cl-detail-grid-cell:nth-child(3) .cl-detail-grid-item {
    aspect-ratio: 3 / 4;
}
/* 下排1张：横跨整行 */
.cl-detail-grid-cell:nth-child(4) .cl-detail-grid-item {
    aspect-ratio: 3 / 1.5;
}
.cl-detail-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cl-detail-grid-item.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.12);
    font-size: 12px;
    background: rgba(255,255,255,0.01);
    border-style: dashed;
}
.cl-detail-grid-item.broken img {
    display: none;
}
.cl-detail-grid-item.broken {
    background: rgba(255,255,255,0.02);
    position: relative;
}
.cl-detail-grid-item.broken::after {
    content: '图片加载失败';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.12);
    font-size: 12px;
    background: rgba(255,255,255,0.015);
}

/* 右侧信息区 */
.cl-detail-info {
    flex: 1;
    padding: 20px 28px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.cl-detail-info-name {
    font-size: 24px;
    font-weight: 700;
    color: #e8e8ef;
    margin: 0 0 18px;
}

/* 属性表格 */
.cl-detail-section {
    margin-bottom: 20px;
}
.cl-detail-section-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}
.cl-detail-attrs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
}
.cl-detail-attr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.04);
}
.cl-detail-attr-key {
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
    min-width: 40px;
}
.cl-detail-attr-val {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    font-weight: 500;
}

/* 描述 */
.cl-detail-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    line-height: 1.9;
}
.cl-detail-purchase-note {
    color: rgba(255,255,255,0.42);
}

/* AI提示词 */
.cl-detail-prompt {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    padding: 12px 16px;
    line-height: 1.7;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 120px;
    overflow-y: auto;
}

/* 统计 */
.cl-detail-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: rgba(255,255,255,0.2);
    margin-top: auto;
    padding-top: 16px;
}

/* 操作按钮 */
.cl-detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.cl-detail-btn-apply {
    flex: 1;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #6c7afc, #a855f7);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.cl-detail-btn-apply:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.cl-detail-btn-edit {
    height: 42px;
    padding: 0 20px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.45);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.cl-detail-btn-edit:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
}

/* 移动端适配 */
@media (max-width: 640px) {
    .cl-detail-panel { width: 95vw; }
    .cl-detail-layout { flex-direction: column; }
    .cl-detail-gallery { width: 100%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.04); padding: 16px; }
    .cl-detail-info { padding: 16px; }
}

/* ========== 创建/编辑表单弹窗 ========== */
.cl-form-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}
.cl-form-panel {
    width: calc(100vw - 400px);
    max-width: calc(100vw - 400px);
    max-height: 94vh;
    background: #15151d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.cl-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 32px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cl-form-header h3 {
    font-size: 19px;
    font-weight: 600;
    color: #e8e8ef;
    margin: 0;
}
.cl-form-close {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cl-form-close:hover {
    background: rgba(255,255,255,0.08);
    color: #e0e0e6;
}
.cl-form-body {
    overflow-y: auto;
    padding: 28px 32px;
    flex: 1;
}
.cl-form-group {
    margin-bottom: 17px;
}
.cl-form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.cl-form-input,
.cl-form-select,
.cl-form-textarea {
    width: 100%;
    padding: 11px 15px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #e0e0e6;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.cl-form-input:focus,
.cl-form-select:focus,
.cl-form-textarea:focus {
    border-color: rgba(124,140,255,0.4);
}
.cl-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.25)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.cl-form-textarea {
    min-height: 84px;
    resize: vertical;
}
.cl-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.cl-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 4px;
}
.cl-btn-cancel {
    padding: 10px 22px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: rgba(255,255,255,0.45);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.cl-btn-cancel:hover {
    background: rgba(255,255,255,0.05);
    color: #e0e0e6;
}
.cl-btn-submit {
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #6c7afc, #a855f7);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.cl-btn-submit:hover { opacity: 0.9; }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .cl-sidebar {
        display: none;
        position: fixed;
        left: 0;
        top: 52px;
        bottom: 0;
        z-index: 20;
        width: 240px;
    }
    .cl-sidebar.open { display: flex; }
    .cl-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        padding: 12px;
        gap: 10px;
    }
    .cl-filter-bar {
        padding: 8px 12px 4px;
        gap: 6px;
    }
    .cl-header { padding: 8px 14px; }
    .cl-search-input { width: 140px; }
    .cl-detail-panel { width: 95vw; }
    .cl-form-panel { width: 95vw; }
    .cl-form-row { grid-template-columns: 1fr; }
}

@media (min-width: 1600px) {
    .cl-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 18px;
        padding: 28px 36px;
    }
}
