/* ============================================================
   AI 生成广告语 — ai_slogan_generation.css
   ============================================================ */

/* ---------- 输入区域 ---------- */
.slogan-input-area {
    padding: 0;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.08);
    margin-bottom: 24px;
    overflow: hidden;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    align-items: flex-start;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.form-group.full-width {
    flex: 1 1 100%;
}

.form-group--narrow {
    max-width: 160px;
    flex: 0 0 160px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

/* ---------- 渐变工具栏 / 标题条（参考 SVG 编辑器 .svg-toolbar 设计） ---------- */
.slogan-section-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.28);
}

.slogan-banner-left {
    display: flex;
    align-items: center;
    gap: 11px;
}

.slogan-banner-icon {
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.18));
}

.slogan-banner-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.slogan-banner-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.76);
    margin-top: 2px;
    font-weight: 400;
}

.slogan-banner-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    padding: 3px 9px;
    flex-shrink: 0;
}

/* 表单内容区域 */
.slogan-form-body {
    padding: 20px 20px 8px;
}

/* ---------- 文本输入样式（query-input） ---------- */
.query-input {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}

.query-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.query-input::placeholder {
    color: #9ca3af;
}

/* ---------- select 统一风格 ---------- */
.query-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: auto;
}

.query-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* 字符计数 */
.char-count {
    font-size: 12px;
    color: #9ca3af;
    text-align: right;
    margin-top: -2px;
    transition: color 0.2s;
}

.char-count.danger { color: #ef4444; font-weight: 600; }

/* ---------- 风格按钮 ---------- */
.style-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
}

.style-btn {
    padding: 7px 17px;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.style-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #f0f0ff;
}

.style-btn.active {
    border-color: #6366f1;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.32);
}

/* ---------- 操作按钮行 ---------- */
.actions-group {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.shortcut-hint {
    font-size: 11px;
    opacity: 0.72;
    margin-left: 6px;
}

/* ---------- 加载动画 ---------- */
.slogan-loading {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 24px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1.5px solid #ddd6fe;
    border-radius: 12px;
    color: #6366f1;
    font-size: 15px;
    font-weight: 500;
    margin: 8px 0;
}

.loading-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid #e0e0ff;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: sg-spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes sg-spin {
    to { transform: rotate(360deg); }
}

/* 主按钮流光闪光动画 */
@keyframes sg-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.button.btnShimmer {
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #6366f1) !important;
    background-size: 200% auto !important;
    animation: sg-shimmer 1.2s linear infinite !important;
    color: #fff !important;
    cursor: not-allowed !important;
    border-color: transparent !important;
}

/* 卡片错落入场动画 */
.hg-anim-in {
    animation: sg-card-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes sg-card-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 结果区域 ---------- */
.slogan-results {
    margin-top: 6px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-radius: 12px;
}

.results-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-count {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #059669;
    background: #d1fae5;
    border-radius: 12px;
    padding: 2px 11px;
    line-height: 1.6;
}

.results-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.action-btn {
    padding: 7px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.action-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #f0f0ff;
}

/* ---------- 广告语卡片网格 ---------- */
.slogan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.slogan-card {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px 18px 16px;
    transition: all 0.22s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: default;
    will-change: transform;
}

.slogan-card:hover {
    border-color: #818cf8;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.18);
    transform: translateY(-3px);
    background: linear-gradient(180deg, #fafaff 0%, #fff 100%);
}

/* 序号徽章 */
.slogan-index {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.40);
}

/* 广告语正文（支持整段点击复制） */
.slogan-text {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.5;
    padding-left: 30px;
    padding-right: 6px;
    word-break: break-word;
    overflow-wrap: break-word;
    letter-spacing: 0.02em;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.18s ease;
}

.slogan-text:hover {
    background: #f5f3ff;
}

/* 元信息行（风格 + 亮点） */
.slogan-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 22px;
}

.slogan-style-tag {
    font-size: 12px;
    color: #6366f1;
    background: #ede9fe;
    border-radius: 8px;
    padding: 2px 10px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.slogan-highlight {
    font-size: 12px;
    color: #9ca3af;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

/* 卡片底部行（字数徽章 + 复制按钮） */
.slogan-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.slogan-word-count {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
    background: #f3f4f6;
    border-radius: 4px;
    padding: 2px 8px;
    line-height: 1.6;
}

/* 复制按钮 */
.slogan-copy-btn {
    padding: 7px 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
}

.slogan-copy-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #f0f0ff;
}

.slogan-copy-btn.copied {
    border-color: #10b981;
    color: #10b981;
    background: #ecfdf5;
}

/* ---------- 暗黑模式 ---------- */
body.dark-mode .slogan-word-count {
    background: #334155;
    color: #64748b;
}

body.dark-mode .slogan-input-area {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

body.dark-mode .slogan-section-banner {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 55%, #7c3aed 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .slogan-banner-badge {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
}

body.dark-mode .slogan-loading {
    background: linear-gradient(135deg, #1e1e40 0%, #1d1133 100%);
    border-color: #3730a3;
    color: #818cf8;
}

body.dark-mode .query-input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .query-input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

body.dark-mode .query-input::placeholder {
    color: #64748b;
}

body.dark-mode .form-group label {
    color: #e2e8f0;
}

body.dark-mode .query-select {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

body.dark-mode .query-select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

body.dark-mode .style-btn {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

body.dark-mode .style-btn:hover {
    border-color: #818cf8;
    color: #818cf8;
    background: #1e1e40;
}

body.dark-mode .style-btn.active {
    color: #fff;
    border-color: #6366f1;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

body.dark-mode .results-header {
    background: linear-gradient(135deg, #1e1e40 0%, #1e293b 100%);
}

body.dark-mode .results-header h3 {
    color: #f1f5f9;
}

body.dark-mode .results-count {
    color: #34d399;
    background: #064e3b;
}

body.dark-mode .action-btn {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

body.dark-mode .action-btn:hover {
    border-color: #818cf8;
    color: #818cf8;
    background: #1e1e40;
}

body.dark-mode .slogan-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .slogan-card:hover {
    border-color: #818cf8;
    box-shadow: 0 6px 20px rgba(129, 140, 248, 0.15);
    background: #1e1e40;
}

body.dark-mode .slogan-text {
    color: #f1f5f9;
}

body.dark-mode .slogan-text:hover {
    background: #1e1e40;
}

body.dark-mode .slogan-style-tag {
    color: #818cf8;
    background: #1e1e40;
}

body.dark-mode .slogan-highlight {
    color: #64748b;
}

body.dark-mode .slogan-copy-btn {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

body.dark-mode .slogan-copy-btn:hover {
    border-color: #818cf8;
    color: #818cf8;
    background: #1e1e40;
}

body.dark-mode .slogan-copy-btn.copied {
    border-color: #34d399;
    color: #34d399;
    background: #064e3b;
}

body.dark-mode .required-mark { color: #f87171; }

body.dark-mode .char-count {
    color: #64748b;
}

body.dark-mode .char-count.danger { color: #f87171; font-weight: 600; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    .form-group--narrow {
        max-width: 100%;
        flex: 1;
    }

    .slogan-grid {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .actions-group {
        flex-wrap: wrap;
    }
}
