/* ==================== 我要创作弹窗 ==================== */
.creation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.creation-modal-dialog {
    background: #fff;
    border-radius: 12px;
    width: 880px;
    max-width: 95vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    animation: creationModalIn 0.25s ease-out;
}

@keyframes creationModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.creation-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
}

.creation-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.creation-modal-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    color: #999;
    font-size: 20px;
    transition: all 0.2s;
}

.creation-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.creation-modal-tabs {
    display: flex;
    padding: 0 24px;
    border-bottom: 1px solid #eee;
    gap: 0;
}

.creation-modal-tab {
    display: inline-block;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    user-select: none;
    line-height: 1.4;
}

.creation-modal-tab:hover {
    color: #1890ff;
}

.creation-modal-tab.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
    font-weight: 500;
}

.creation-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 24px;
    min-width: 0;
    min-height: 380px;
}

/* 卡片网格布局 - 一行3个 */
.creation-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
}

.creation-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.creation-card:hover {
    border-color: #1890ff;
    background: #f0f7ff;
    box-shadow: 0 2px 12px rgba(24, 144, 255, 0.1);
    transform: translateY(-1px);
}

.creation-card.selected {
    border-color: #1890ff;
    background: #e6f4ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 左侧图标 */
.creation-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    color: #fff;
    font-weight: 600;
}

.creation-card-icon.default { background: linear-gradient(135deg, #667eea, #764ba2); }
.creation-card-icon.type1  { background: linear-gradient(135deg, #f093fb, #f5576c); }
.creation-card-icon.type2  { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.creation-card-icon.type3  { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.creation-card-icon.type4  { background: linear-gradient(135deg, #fa709a, #fee140); }

/* 右侧内容区：标题 + 描述 + 标签 */
.creation-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.creation-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.creation-card-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.creation-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.creation-card-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e8f4ff;
    color: #1890ff;
    white-space: nowrap;
}

/* 空状态 */
.creation-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.creation-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.creation-empty-text {
    font-size: 14px;
}

/* 占位卡片 */
.creation-card-placeholder {
    background: linear-gradient(90deg, #f5f5f5 25%, #e8e8e8 50%, #f5f5f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 10px;
    min-height: 130px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== 模板编辑器 ==================== */
.template-editor-wrap {
    position: relative;
    width: 100%;
}

.template-editor {
    min-height: 55px;
    max-height: 260px;
    width: 100%;
    border: none;
    outline: none;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    overflow-y: auto;
    word-break: break-all;
    font-family: inherit;
    background: transparent;
}

.template-editor:empty::before {
    content: attr(data-placeholder);
    color: #bbb;
    pointer-events: none;
}

/* 模板占位标签 */
.template-tag {
    display: inline-block;
    background: #e6f4ff;
    border: 1px dashed #1890ff;
    border-radius: 4px;
    padding: 1px 8px;
    color: #1890ff;
    cursor: text;
    font-size: 13px;
    margin: 0 2px;
    user-select: text;
    transition: all 0.15s;
    position: relative;
}

.template-tag:hover {
    background: #bae0ff;
}

.template-tag:focus {
    background: #fff;
    border-style: solid;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
    outline: none;
}

.template-normal-text {
    user-select: text;
}

/* ==================== 斜杠命令面板 ==================== */
.slash-command-panel {
    position: absolute;
    bottom: 100%;
    left: 10px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    width: 340px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 9999;
    animation: slashPanelIn 0.15s ease-out;
}
@keyframes slashPanelIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* 自定义滚动条 */
.slash-command-panel::-webkit-scrollbar {
    width: 4px;
}
.slash-command-panel::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 2px;
}
.slash-command-panel::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.slash-command-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #fafafa;
}
.slash-command-item:last-child {
    border-bottom: none;
}

.slash-command-item:first-child {
    border-radius: 12px 12px 0 0;
}

.slash-command-item:last-child {
    border-radius: 0 0 12px 12px;
}

.slash-command-item:hover,
.slash-command-item.active {
    background: #f5f9ff;
    padding-left: 20px;
}
.slash-command-item.active .slash-command-icon {
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.25);
    transform: scale(1.05);
}

.slash-command-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    font-size: 17px;
    background: #f0f5ff;
    color: #1890ff;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.slash-command-info {
    flex: 1;
    overflow: hidden;
}

.slash-command-name {
    font-size: 13px;
    color: #1a1a1a;
    font-weight: 600;
    line-height: 1.4;
}

.slash-command-desc {
    font-size: 11px;
    color: #999;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* ==================== 我要创作按钮 ==================== */
.btn-create-work {
    float: left;
    margin-right: 15px;
    overflow: hidden;
    padding: 0px 8px;
    color: #1890ff;
    cursor: pointer;
    line-height: 35px;
    font-size: 14px;
    user-select: none;
    white-space: nowrap;
}

.btn-create-work:hover {
    background: #f5f5f5;
    border-radius: 4px;
    color: #40a9ff;
}

/* 选择技能 关闭按钮 */
.used-skill {
    position: relative;
    overflow: visible !important;
}
.skill-close-btn {
    display: none;
    position: absolute;
    top: 3px;
    right: 4px;
    width: 15px;
    height: 15px;
    font-size: 12px;
    color: #ff4d4f;
    background: #fff;
    border: 1px solid #ff4d4f;
    border-radius: 50%;
    z-index: 2;
    font-weight: bold;
}
.skill-close-btn.show {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.skill-close-btn:hover {
    color: #fff;
    background: #ff4d4f;
    transform: scale(1.1);
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .creation-modal-dialog {
        width: 98vw;
        max-height: 95vh;
        border-radius: 8px;
    }

    .creation-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .creation-modal-body {
        padding: 12px;
    }
}

/* 小屏幕适配：按钮紧凑 */
@media (max-width: 1450px) {
    .btn-create-work {
        margin-right: 6px;
        padding: 0px 4px;
        font-size: 12px;
        cursor: pointer;
    }
}
