/* --- 输入卡片容器 --- */
.input-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.input-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
}

/* --- 顶部选项卡 Tabs --- */
.input-tabs {
    display: flex;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.input-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    transition: all 0.2s;
    user-select: none;
    border-bottom: 2px solid transparent;
}

.input-tab:hover {
    background: #f0f0f0;
    color: #555;
}

/* 选中状态 */
.input-tab.active {
    color: #1890ff;
    /* 蓝色高亮 */
    background: #fff;
    border-bottom: 2px solid #1890ff;
}

/* --- 内容面板 --- */
.input-content {
    padding: 15px;
    background: #fff;
    min-height: 200px;
    /* 给一个最小高度防止切换时抖动 */
}

.tab-panel {
    display: none;
    height: 100%;
    flex-direction: column;
    animation: fadeIn 0.2s ease-in-out;
}

.tab-panel.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 文字输入框美化 --- */
textarea.custom-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 16px;
    font-family: inherit;
    color: #333;
    background: transparent;
    padding: 0;
    line-height: 1.5;
    box-sizing: border-box;
    min-height: 120px;
}

textarea.custom-textarea::placeholder {
    color: #ccc;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
    color: #aaa;
    border-top: 1px dashed #eee;
    padding-top: 8px;
}

/* --- 图标网格美化 (新的 icon-grid-modern 类) --- */
.icon-search-bar input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 12px;
    box-sizing: border-box;
}

.icon-grid-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4列布局 */
    gap: 8px;
    max-height: 180px;
    /* 固定高度，内部滚动 */
    overflow-y: auto;
    padding-right: 4px;
}

/* 滚动条样式 */
.icon-grid-modern::-webkit-scrollbar {
    width: 4px;
}

.icon-grid-modern::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* 图标项样式 (你需要确保 main.js 生成的div用了这个类，或者保留你原来的 icon-item 类样式) */
.icon-item {
    aspect-ratio: 1;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: #fafafa;
    padding: 5px;
}

.icon-item:hover {
    border-color: #1890ff;
    background-color: #e6f7ff;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(24, 144, 255, 0.2);
}

.icon-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* ... 原有的 .icon-item 样式 ... */

/* 新增：图标被选中/存在于舞台时的样式 */
.icon-item.selected {
    border-color: #1890ff;
    /* 蓝色边框 */
    background-color: #e6f7ff;
    /* 浅蓝背景 */
    box-shadow: 0 0 0 1px #1890ff;
    /* 加粗边框视觉 */
    opacity: 1;
    /* 确保不透明 */
}

/* 此时内部图片应该是彩色的 */
.icon-item.selected img {
    filter: none;
    opacity: 1;
}


/* --- 已选图标栏样式 --- */
.selected-icons-container {
    width: 100%;
    min-height: 38px;
    /* 保持和原来输入框差不多高 */
    padding: 4px;
    border: 1px solid #eee;
    background: #f5f5f5;
    border-radius: 6px;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    /* 图标多了可以横向滚动 */
    white-space: nowrap;
}

/* 占位文字 */
.placeholder-text {
    color: #ccc;
    font-size: 12px;
    padding-left: 5px;
    pointer-events: none;
}

/* 单个图标标签 */
.icon-tag {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 2px 4px 2px 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    /* 防止被挤压 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.icon-tag:hover {
    border-color: #ff4d4f;
    /* 悬停变红提示可删除 */
}

/* 标签内的微缩图 */
.icon-tag img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* 删除叉号 */
.icon-tag-close {
    cursor: pointer;
    font-size: 16px;
    color: #999;
    font-weight: bold;
    line-height: 1;
    padding: 0 2px;
}

.icon-tag-close:hover {
    color: #ff4d4f;
}

/* 美化滚动条 (同之前的风格) */
.selected-icons-container::-webkit-scrollbar {
    height: 4px;
}

.selected-icons-container::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}