/* ============================================================
 * 账号管理组件样式（独立组件，前缀 am-）
 * 主色：#1677ff ｜ 页面底：#f5f7fa ｜ 文本：#1f2329 / #646a73 / #8f959e
 * ============================================================ */

.am-panel {
    display: flex;
    height: 100%;
    min-height: 460px;
    background: #f5f7fa;
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
    color: #1f2329;
    box-shadow: 0 1px 6px rgba(31, 35, 41, 0.06);
}

/* ---------------- 左侧：账号设备列表 ---------------- */
.am-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #eef0f4;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.am-search {
    position: relative;
    padding: 16px 14px 12px;
    flex-shrink: 0;
}

.am-search-icon {
    position: absolute;
    left: 27px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.am-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 38px;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    background: #f7f8fa;
    font-size: 13px;
    color: #1f2329;
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.am-search-input:focus {
    border-color: #1677ff;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.12);
}

.am-search-input::placeholder {
    color: #a3a9b3;
}

.am-account-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 8px 16px;
}

.am-account-list::-webkit-scrollbar,
.am-history-list::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.am-account-list::-webkit-scrollbar-thumb,
.am-history-list::-webkit-scrollbar-thumb {
    background: #e2e5ea;
    border-radius: 3px;
}

.am-account-item {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    margin-bottom: 2px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .18s;
}

.am-account-item:hover {
    background: #f5f7fa;
}

.am-account-item.is-active {
    background: rgba(22, 119, 255, 0.08);
}

.am-account-avatar {
    position: relative;
    flex-shrink: 0;
    margin-right: 12px;
}

/* 平台标识角标（头像右下角） */
.am-platform-badge {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 15px;
    height: 15px;
    padding: 1px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 1px #fff, 0 1px 3px rgba(31, 35, 41, 0.18);
    box-sizing: content-box;
    z-index: 2;
}

.am-platform-badge img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}

.am-avatar {
    display: inline-block;
    width: 38px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.am-account-body {
    flex: 1;
    min-width: 0;
}

.am-account-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.am-account-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2329;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.am-status {
    flex-shrink: 0;
    font-size: 10px;
    padding: 0 5px;
    border-radius: 4px;
    line-height: 15px;
}

.am-status.is-online {
    color: #14a66f;
    background: rgba(20, 166, 111, 0.1);
}

.am-status.is-offline {
    color: #8f959e;
    background: #f0f1f4;
}

.am-account-meta {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #8f959e;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.am-platform-icon {
    width: 13px;
    height: 13px;
    border-radius: 3px;
    flex-shrink: 0;
}

.am-dispatch-btn {
    flex-shrink: 0;
    height: 26px;
    padding: 0 10px;
    margin-left: 6px;
    border: 1px solid #1677ff;
    border-radius: 5px;
    background: #fff;
    color: #1677ff;
    font-size: 11px;
    cursor: pointer;
    transition: all .2s;
}

.am-dispatch-btn:hover {
    background: #1677ff;
    color: #fff;
}

.am-account-item.is-active .am-dispatch-btn {
    background: #1677ff;
    color: #fff;
}

.am-list-empty {
    padding: 50px 0;
    text-align: center;
    color: #a3a9b3;
    font-size: 13px;
}

/* ---------------- 右侧：任务配置 ---------------- */
.am-main {
    flex: 1;
    min-width: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.am-main-head {
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid #eef0f4;
    background: #fff;
}

.am-main-title {
    font-size: 14px;
    color: #1f2329;
    display: flex;
    align-items: center;
    gap: 6px;
}

.am-main-title b {
    font-weight: 600;
}

.am-main-platform {
    width: 15px;
    height: 15px;
    border-radius: 4px;
}

.am-main-tip {
    font-size: 12px;
    color: #8f959e;
}

/* 任务配置表单 */
.am-form {
    padding: 18px 20px 8px;
    background: #fff;
}

.am-form-item {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
}

.am-form-item label {
    width: 130px;
    flex-shrink: 0;
    font-size: 13px;
    color: #646a73;
}

.am-field {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    font-size: 13px;
    color: #1f2329;
    outline: none;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}

.am-field:focus {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.12);
}

.am-field::placeholder {
    color: #b4bac4;
}

.am-field-area {
    height: auto;
    padding: 8px 10px;
    line-height: 1.6;
    resize: none;
}

.am-submit-btn {
    margin-left: 130px;
    height: 34px;
    padding: 0 30px;
    border: none;
    border-radius: 6px;
    background: #1677ff;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.3);
    transition: background .2s;
}

.am-submit-btn:hover {
    background: #0f6ce8;
}

/* 历史任务记录 */
.am-history {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 6px 20px 18px;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    background: #fafbfc;
    overflow: hidden;
}

.am-history-title {
    flex-shrink: 0;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2329;
    background: #fff;
    border-bottom: 1px solid #eef0f4;
}

.am-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
}

.am-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    transition: box-shadow .2s;
}

.am-task-item:hover {
    box-shadow: 0 2px 8px rgba(31, 35, 41, 0.06);
}

.am-task-main {
    min-width: 0;
}

.am-task-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2329;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.am-task-detail {
    font-size: 11px;
    color: #8f959e;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.am-task-status {
    flex-shrink: 0;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 10px;
    margin-left: 10px;
}

.am-task-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.am-task-stop {
    flex-shrink: 0;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 10px;
    margin-left: 10px;
    border: 1px solid #ff4d4f;
    color: #ff4d4f;
    background: #fff;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.am-task-stop:hover {
    background: #ff4d4f;
    color: #fff;
}

.am-task-status.is-doing {
    color: #14a66f;
    background: rgba(20, 166, 111, 0.1);
}

.am-task-status.is-done {
    color: #ff4d4f;
    background: rgba(255, 77, 79, 0.1);
}

/* ============================================================
 * 抖音评论引流（AI评论引流 type=4）专用表单项（前缀 am-dr，主色蓝）
 * 沿用本页 am-form-item 布局，仅切换任务类型下方的表单项
 * ============================================================ */

/* 专用表单项滚动容器（任务类型=4 时展示） */
.am-dr-form {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 20px 18px;
    background: #fff;
}

/* 分组标题 */
.am-dr-section {
    position: relative;
    padding-left: 10px;
    margin: 14px 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2329;
}

.am-dr-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    border-radius: 2px;
    background: #1677ff;
}

/* 必填标记 */
.am-dr-req {
    color: #ff4d4f;
    font-style: normal;
    margin-left: 2px;
}

/* 智能体可搜索下拉组件（am-dr-comp） */
.am-dr-comp {
    position: relative;
    flex: 1;
    min-width: 0;
}

.am-dr-comp-btn {
    height: 34px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}

.am-dr-comp.is-active .am-dr-comp-btn {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.12);
}

.am-dr-comp-text {
    font-size: 13px;
    color: #8f959e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
}

.am-dr-comp-text.has-val {
    color: #1f2329;
}

.am-dr-comp-arrow {
    flex-shrink: 0;
    color: #8f959e;
    font-size: 12px;
    transition: transform .2s;
}

.am-dr-comp.is-active .am-dr-comp-arrow {
    transform: rotate(180deg);
}

.am-dr-comp-panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 40px;
    z-index: 210;
    background: #fff;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(31, 35, 41, 0.12);
    overflow: hidden;
}

.am-dr-comp-panel.is-open {
    display: block;
}

.am-dr-comp-search {
    display: block;
    width: 100%;
    height: 34px;
    box-sizing: border-box;
    border: none;
    border-bottom: 1px solid #f0f1f4;
    padding: 0 12px;
    font-size: 13px;
    color: #1f2329;
    outline: none;
    background: #fafbfc;
}

.am-dr-comp-search::placeholder {
    color: #a3a9b3;
}

.am-dr-comp-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
}

.am-dr-comp-list::-webkit-scrollbar {
    width: 6px;
}

.am-dr-comp-list::-webkit-scrollbar-thumb {
    background: #d3d6de;
    border-radius: 3px;
}

.am-dr-comp-opt {
    height: 34px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 5px;
    font-size: 13px;
    color: #1f2329;
    cursor: pointer;
    transition: background .15s;
}

.am-dr-comp-opt:nth-child(1) {
    margin-top: 2px;
}

.am-dr-comp-opt:nth-last-child(1) {
    margin-bottom: 2px;
}

.am-dr-comp-opt:hover {
    background: #f2f6ff;
}

.am-dr-comp-opt.is-active {
    background: #e8f1ff;
    color: #1677ff;
    font-weight: 600;
}

.am-dr-comp-opt-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.am-dr-comp-empty {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #b4bac4;
}

/* 账号选择（主/子） */
.am-dr-seg {
    display: flex;
    gap: 10px;
}

.am-dr-seg-btn {
    height: 34px;
    padding: 0 26px;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    background: #fff;
    color: #646a73;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}

.am-dr-seg-btn:hover {
    border-color: #7ab5ff;
    color: #1677ff;
}

.am-dr-seg-btn.is-active {
    border-color: #1677ff;
    background: #1677ff;
    color: #fff;
    font-weight: 600;
}

/* 带小字提示的表单项（获客/私信数量） */
.am-dr-item-vertical {
    align-items: flex-start;
}

.am-dr-field-wrap {
    flex: 1;
    min-width: 0;
}

.am-dr-field-wrap .am-field {
    max-width: 220px;
}

.am-dr-hint {
    margin-top: 4px;
    font-size: 12px;
    color: #ff4d4f;
}

/* 搜索关键词 + AI 生成按钮 */
.am-dr-keyword {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 10px;
}

.am-dr-keyword .am-field {
    flex: 1;
    min-width: 0;
}

.am-dr-ai-btn {
    flex-shrink: 0;
    height: 34px;
    padding: 0 16px;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    background: #f2f3f5;
    color: #646a73;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.am-dr-ai-btn:hover {
    background: #e9eaed;
    color: #1f2329;
}

/* 单选按钮组（综合排序/发布时间/搜索范围） */
.am-dr-radio-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.am-dr-radio-btn {
    height: 30px;
    padding: 0 16px;
    border: 1px solid #e5e6eb;
    border-radius: 15px;
    background: #fff;
    color: #646a73;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}

.am-dr-radio-btn:hover {
    border-color: #7ab5ff;
    color: #1677ff;
}

.am-dr-radio-btn.is-active {
    border-color: #1677ff;
    background: #1677ff;
    color: #fff;
    font-weight: 600;
}

/* 私信设置区域（勾选「是否私信」时显示，外框便于与操作设置区分） */
.am-dr-private-box {
    border: 1px solid #eef0f4;
    border-radius: 8px;
    margin-top: 4px;
    padding: 2px 14px 8px;
    background: #fafbfc;
    overflow: hidden;
}

/* 筛选条件折叠面板 */
.am-dr-collapse {
    border: 1px solid #eef0f4;
    border-radius: 8px;
    margin-top: 4px;
    overflow: hidden;
    background: #fafbfc;
}

.am-dr-collapse-hd {
    height: 42px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #1f2329;
    cursor: pointer;
    user-select: none;
    background: #fff;
    border-bottom: 1px solid #f0f1f4;
}

.am-dr-collapse-arrow {
    font-size: 12px;
    color: #8f959e;
    transition: transform .2s;
}

.am-dr-collapse-hd:not(.am-dr-collapse-open) .am-dr-collapse-arrow {
    transform: rotate(180deg);
}

.am-dr-collapse-bd {
    padding: 10px 14px 2px;
}

/* 意向客户子分组标题 */
.am-dr-sub {
    position: relative;
    padding-left: 10px;
    margin: 12px 0 2px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1f2329;
}

.am-dr-sub::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 3px;
    border-radius: 2px;
    background: #1677ff;
}

/* 数字加减器 */
.am-dr-stepper {
    display: flex;
    align-items: center;
    height: 30px;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    overflow: hidden;
}

.am-dr-step-btn {
    width: 32px;
    height: 100%;
    border: none;
    background: #f7f8fa;
    color: #646a73;
    font-size: 15px;
    cursor: pointer;
    transition: background .2s;
    line-height: 1;
}

.am-dr-step-btn:hover {
    background: rgba(22, 119, 255, 0.08);
    color: #1677ff;
}

.am-dr-step-input {
    width: 56px;
    height: 100%;
    border: none;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    text-align: center;
    font-size: 13px;
    color: #1f2329;
    outline: none;
    background: #fff;
    box-sizing: border-box;
}

/* 数字加减器的单位（小时/条/% 等） */
.am-dr-step-unit {
    padding: 0 10px;
    font-size: 12px;
    color: #8f959e;
    flex-shrink: 0;
}

/* 意向客户操作：复选框 + ± 数字 */
.am-dr-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: #1f2329;
    margin: 8px 0 8px 0;
}

.am-dr-checkbox {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border: 1.5px solid #c9cdd4;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    transition: all .2s;
}

.am-dr-opt.is-checked .am-dr-checkbox {
    background: #1677ff;
    border-color: #1677ff;
}

.am-dr-opt-name {
    min-width: 110px;
}

.am-dr-opt-unit {
    font-size: 13px;
    color: #8f959e;
}

.am-dr-opt:not(.is-checked) .am-dr-stepper {
    opacity: .45;
    pointer-events: none;
}

/* 是否私信：独立显著开关样式（区别于普通勾选项） */
.am-dr-opt.am-dr-is-private {
    margin: 12px 0 2px 0;
    padding: 11px 16px;
    border: 1.5px solid #d9dee5;
    border-radius: 8px;
    background: #fafbfc;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #3d4653;
    gap: 10px;
    transition: all .2s;
}
.am-dr-opt.am-dr-is-private .am-dr-checkbox {
    width: 18px;
    height: 18px;
    font-size: 12px;
    border-width: 2px;
}
.am-dr-opt.am-dr-is-private .am-dr-opt-name {
    min-width: 0;
}
.am-dr-opt.am-dr-is-private.is-checked {
    border-color: #1677ff;
    background: #eaf3ff;
    color: #1677ff;
}

/* 开始运行按钮 */
.am-dr-submit-btn {
    margin-left: 130px;
    margin-top: 16px;
    height: 36px;
    padding: 0 34px;
    border: none;
    border-radius: 6px;
    background: #1677ff;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.3);
    transition: background .2s;
}

.am-dr-submit-btn:hover {
    background: #0f6ce8;
}

/* ============================================================
 * 下发表单 / 历史任务记录：CustomTabs 顶部结构
 * TAB1 任务下发 / TAB2 历史任务记录
 * ============================================================ */
.am-main-tabs {
    flex: 1;
    min-height: 0;
    display: flex;
}

.am-main-tabs .CU-tabs {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 内容区独立滚动：header 固定在顶部，表单/历史在内容区滚动，避免被遮盖 */
.am-main-tabs .CU-tabs-content {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 0;
    overflow: auto;
}

/* 选中 tab 颜色对齐项目主色 */
.am-main-tabs .CU-tab-item.is-active {
    color: #1677ff;
    border-bottom-color: #1677ff;
}

/* 内容面板：交由 tabs 内容区整体滚动，避免表单/历史出现双重滚动条 */
.am-main-tabs .am-tab-dispatch .am-form {
    padding: 18px 20px 8px;
}

.am-main-tabs .am-tab-dispatch .am-dr-form {
    flex: none;
    min-height: 0;
    overflow: visible;
}

.am-main-tabs .am-tab-history .am-history {
    flex: none;
    min-height: 0;
    overflow: visible;
    margin: 16px 20px 18px;
}

/* 历史任务记录：记录查询条件筛选条 */
.am-history-filter {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 14px;
    background: #fff;
    border-bottom: 1px solid #eef0f4;
}

.am-history-filter label {
    flex-shrink: 0;
    font-size: 13px;
    color: #646a73;
}

.am-history-filter-select {
    flex: 1;
    min-width: 0;
    max-width: 200px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    font-size: 13px;
    color: #1f2329;
    outline: none;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}

.am-history-filter-select:focus {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.12);
}
