/* ---------- Ai工作台 · 新建任务（Vue3 + axios 版） ----------
   先填提示词，提交时弹窗补任务名称（默认取提示词前 16 个字）。 */

.ai-home { position: relative; min-height: calc(100vh - 36px); background: #f7f6f2; overflow: hidden; }
.ai-home::before {
    content: ""; position: absolute; top: -80px; right: 4%; width: 420px; height: 520px;
    background: radial-gradient(closest-side, rgba(214, 178, 110, .28), rgba(214, 178, 110, 0));
    filter: blur(6px); pointer-events: none;
}
.ai-wrap { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 56px 24px 80px; }

.ai-greet { margin: 0 0 22px; font-size: 1.9rem; font-weight: 700; color: #1f1b16; letter-spacing: -.01em; }

/* 生成内容：顶部胶囊切换 */
.ai-modes {
    display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px;
    background: #edebe5; border-radius: 14px;
}
.ai-mode {
    display: inline-flex; align-items: center; gap: 7px; border: none; background: transparent;
    color: #4a453d; border-radius: 10px; padding: 9px 18px; font-size: .9rem; font-weight: 600;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.ai-mode .bi { font-size: 1rem; }
.ai-mode:hover { color: #1f1b16; }
.ai-mode.on {
    background: linear-gradient(180deg, #fb9424, #f07300); color: #fff;
    box-shadow: 0 4px 12px rgba(240, 115, 0, .28);
}

/* 快捷提示词：小胶囊 */
.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.ai-chip {
    display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid #e8e3da;
    border-radius: 999px; padding: 5px 12px; font-size: .76rem; font-weight: 500; color: #4a453d;
    line-height: 1.4; transition: border-color .15s, color .15s, background .15s;
}
.ai-chip .bi { font-size: .8rem; color: #7a7166; }
.ai-chip:hover { border-color: #f0b978; color: #c25b00; background: #fffaf3; }
.ai-chip:hover .bi { color: #f07300; }

/* 提示词输入卡 */
.ai-composer {
    margin-top: 22px; background: #fff; border-radius: 22px;
    box-shadow: 0 10px 34px rgba(80, 62, 34, .09), 0 1px 0 rgba(255, 255, 255, .9) inset;
    padding: 22px 24px 16px;
}
.ai-composer-input {
    display: block; width: 100%; border: none; outline: none; resize: none;
    min-height: 132px; font-size: 1rem; line-height: 1.8; color: #2b2620; background: transparent;
    font-family: inherit;
}
.ai-composer-input::placeholder { color: #a9a298; }
.ai-composer-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.ai-count { font-size: .72rem; color: #b3ada3; }
.ai-composer-right { display: flex; align-items: center; gap: 14px; }
/* 模型选择：自动 / 快速 / 极致 */
.ai-model-wrap { position: relative; }
.ai-model {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
    border: 1px solid #e6e1d8; border-radius: 999px; font-size: .78rem; color: #5a5349;
    background: #fff; transition: border-color .15s, color .15s;
}
.ai-model:hover, .ai-model.open { border-color: #f0b978; color: #1f1b16; }
.ai-model .bi-stars { color: #b08756; }
.ai-model-caret { font-size: .62rem; color: #a49c90; transition: transform .15s ease; }
.ai-model.open .ai-model-caret { transform: rotate(180deg); }
.ai-model-menu {
    position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 20; min-width: 118px;
    margin: 0; padding: 6px; list-style: none; background: #fff; border-radius: 12px;
    box-shadow: 0 10px 28px rgba(60, 44, 20, .16), 0 0 0 1px #f0ece4;
}
.ai-model-menu li {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px 10px; border-radius: 8px; font-size: .82rem; color: #4a453d; cursor: pointer;
    transition: background .12s, color .12s;
}
.ai-model-menu li:hover { background: #fdf3e6; }
.ai-model-menu li.on { color: #f07300; font-weight: 600; }
.ai-model-menu li .bi-check-lg { font-size: .8rem; }
.ai-send {
    width: 40px; height: 40px; border: none; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; color: #fff; font-size: 1.05rem;
    background: linear-gradient(180deg, #fb9424, #f07300);
    box-shadow: 0 6px 14px rgba(240, 115, 0, .3); transition: filter .15s, opacity .15s;
}
.ai-send:hover { filter: brightness(1.06); }
.ai-send:disabled { opacity: .55; box-shadow: none; }
.ai-send .spinner-border { width: 1rem; height: 1rem; }

.md-alert { position: relative; border-radius: 12px; padding: 12px 40px 12px 16px; font-size: .86rem; margin-top: 18px; }
.md-alert.ok { background: #eafaf0; border: 1px solid #9fd9b6; color: #1d7a45; }
.md-alert.err { background: #fdecec; border: 1px solid #f0a9a9; color: #b03021; }
.md-alert-close {
    position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
    border: none; background: transparent; color: inherit; opacity: .55; font-size: .8rem;
    border-radius: 50%; transition: opacity .15s, background .15s;
}
.md-alert-close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }

/* 任务名称弹窗 */
.ai-modal-mask {
    position: fixed; inset: 0; z-index: 1060; display: flex; align-items: center; justify-content: center;
    background: rgba(35, 28, 18, .42); padding: 16px;
}
.ai-modal {
    width: 100%; max-width: 440px; background: #fff; border-radius: 20px; padding: 26px 26px 22px;
    box-shadow: 0 24px 60px rgba(30, 22, 10, .25);
}
.ai-modal h2 { margin: 0; font-size: 1.12rem; font-weight: 700; color: #1f1b16; }
.ai-modal-sub { margin: 6px 0 18px; font-size: .8rem; color: #8c857a; }
.form-label { font-size: .8rem; font-weight: 600; color: #5a5247; margin-bottom: 6px; }
.ai-modal .form-control {
    width: 100%; border-radius: 12px; border-color: rgba(176, 135, 86, .3); font-size: .9rem;
}
.ai-modal .form-control:focus {
    border-color: #f08c1e; box-shadow: 0 0 0 .18rem rgba(240, 140, 30, .16);
}
.ai-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* 微信文章：公众号选择 / 新建 */
.ai-wx-loading, .ai-wx-empty { padding: 16px 4px; font-size: .82rem; color: #9a938a; }
.ai-wx-list { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.ai-wx-item {
    display: flex; align-items: center; gap: 10px; margin: 0; padding: 11px 14px; cursor: pointer;
    border: 1px solid #e8e3da; border-radius: 12px; transition: border-color .15s, background .15s;
}
.ai-wx-item:hover { border-color: #f0b978; }
.ai-wx-item.on { border-color: #f08c1e; background: #fffaf3; }
.ai-wx-item input { accent-color: #f07300; margin: 0; }
.ai-wx-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-wx-name { font-size: .88rem; font-weight: 600; color: #2b2620; }
.ai-wx-appid { font-size: .72rem; color: #9a938a; }
.ai-wx-error { margin-top: 12px; padding: 9px 12px; border-radius: 10px; background: #fdecec; border: 1px solid #f0a9a9; color: #b03021; font-size: .78rem; }
.ai-wx-add {
    display: inline-flex; align-items: center; gap: 5px; margin-top: 14px; padding: 0;
    border: none; background: transparent; color: #f07300; font-size: .82rem; font-weight: 600;
}
.ai-wx-add .bi { font-size: .8rem; }
.ai-wx-add:hover { text-decoration: underline; }
.ai-wx-field + .ai-wx-field { margin-top: 14px; }

.btn-md-primary {
    background: linear-gradient(180deg, #fb9424, #f07300); border: none; color: #fff;
    font-weight: 700; border-radius: 12px; padding: 10px 24px; font-size: .9rem;
}
.btn-md-primary:hover { filter: brightness(1.04); color: #fff; }
.btn-md-primary:disabled { opacity: .7; }
.btn-md-ghost {
    background: #fff; border: 1px solid #e2ddd4; color: #6b6358;
    border-radius: 12px; padding: 10px 20px; font-size: .9rem; font-weight: 600;
}
.btn-md-ghost:hover { background: #f6f3ec; }

@media (max-width: 576px) {
    .ai-wrap { padding: 32px 14px 56px; }
    .ai-greet { font-size: 1.35rem; }
    .ai-modes { border-radius: 12px; }
    .ai-mode { padding: 8px 13px; font-size: .82rem; }
    .ai-composer { padding: 16px 16px 12px; border-radius: 18px; }
    .ai-composer-input { min-height: 110px; }
    .ai-modal-actions { flex-direction: column-reverse; }
    .ai-modal-actions .btn-md-primary, .ai-modal-actions .btn-md-ghost { width: 100%; }
}
