/**
 * modules/ai-prompts/style.css
 * AI 提示词模块专属样式
 * @author      DevToolsHub
 * @version     1.0.0
 * @created     2026-05-22
 * @standard    阿里巴巴前端开发规范
 */

/* ============================================================
   行业筛选 Tab
   ============================================================ */
.prompt-industry-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.prompt-industry-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.prompt-industry-tab:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: var(--primary-light);
}

.prompt-industry-tab.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   提示词卡片 Grid
   ============================================================ */
.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* ============================================================
   单个提示词卡片
   ============================================================ */
.prompt-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: all 0.18s;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.prompt-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.18s;
}

.prompt-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.prompt-card:hover::before {
    opacity: 1;
}

/* 卡片头部 */
.prompt-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prompt-card__icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.prompt-card__info {
    flex: 1;
    min-width: 0;
}

.prompt-card__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prompt-card__desc {
    font-size: 12px;
    color: var(--text-light);
}

/* 标签 */
.prompt-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.prompt-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* 操作按钮 */
.prompt-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.prompt-btn {
    flex: 1;
    padding: 7px 0;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.prompt-btn--view {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.prompt-btn--view:hover {
    background: var(--primary);
    color: #fff;
}

.prompt-btn--copy {
    background: #f0fdf4;
    color: #15803d;
}

.prompt-btn--copy:hover {
    background: #22c55e;
    color: #fff;
}

/* ============================================================
   提示词详情弹窗
   ============================================================ */
.prompt-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.prompt-modal.show {
    display: flex;
}

.prompt-modal__box {
    background: #fff;
    border-radius: var(--radius-xl, 16px);
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
}

.prompt-modal__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.prompt-modal__title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
    flex: 1;
}

.prompt-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.prompt-modal__close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.prompt-modal__body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prompt-modal__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.prompt-modal__text {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-main);
    white-space: pre-wrap;
    font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
    word-break: break-all;
}

.prompt-modal__copy-btn {
    align-self: flex-end;
    padding: 8px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prompt-modal__copy-btn:hover {
    background: var(--primary-dark);
}

/* ============================================================
   提示词搜索框
   ============================================================ */
.prompt-search-wrap {
    position: relative;
    margin-bottom: 16px;
}

.prompt-search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    font-size: 13px;
    color: var(--text-main);
    background: #fff;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.prompt-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 52, 211, 153), 0.12);
}

.prompt-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-light);
    pointer-events: none;
}

/* ============================================================
   空状态
   ============================================================ */
.prompt-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
    font-size: 14px;
}

.prompt-empty__icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
    .prompt-grid {
        grid-template-columns: 1fr;
    }

    .prompt-modal__box {
        max-height: 90vh;
    }
}
