/* doubao-node.css — 豆包 Web 辅助节点 */
.node-type-doubao .node-frame,
.node-type-doubao .node-frame.node-frame-doubao,
.node-type-doubao .node-shell-doubao {
    --node-type-color: var(--type-ai);
}

/* 问号说明按钮：仅借用 token，不写主题选择器 */
.doubao-help-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    margin-left: 6px;
    border-radius: 50%;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
    background: var(--surface, transparent);
    color: var(--text-soft, #475569);
    cursor: pointer;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-normal, .18s) var(--ease-out, ease);
}
.doubao-help-btn:hover {
    color: var(--accent, var(--type-doubao, #f97316));
    border-color: var(--accent, var(--type-doubao, #f97316));
    transform: translateY(-1px);
}
.doubao-help-btn .svg-icon {
    width: 11px;
    height: 11px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* 生成中切换为停止按钮：用 color-mix 从 --danger 派生背景，跟随主题 */
.doubao-btn.doubao-stop-btn {
    background: color-mix(in srgb, var(--danger, #dc2626) 10%, var(--node-neu-surface));
    color: var(--danger, #dc2626);
}
.doubao-btn.doubao-stop-btn:hover {
    background: color-mix(in srgb, var(--danger, #dc2626) 18%, var(--node-neu-surface));
    color: var(--danger, #dc2626);
    box-shadow: var(--neu-shadow-hover);
}

.doubao-node-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
}

.doubao-prompt-section,
.doubao-ref-section {
    flex-shrink: 0;
}

.doubao-prompt-section {
    padding: 12px;
}

.doubao-ref-section {
    overflow: hidden;
}

.doubao-rich-input {
    min-height: 96px;
    max-height: 176px;
    overflow-y: auto;
    line-height: 1.6;
    padding: 12px 14px;
}

.doubao-empty-ref {
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    border-radius: 12px;
    background: var(--node-neu-surface);
    box-shadow: var(--neu-inset);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}

.doubao-empty-ref strong {
    color: var(--text-soft);
    font-size: 12px;
}

.doubao-empty-ref span {
    max-width: 240px;
}

.doubao-status {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--node-neu-surface);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
    box-shadow: var(--neu-inset);
}

.doubao-status strong {
    color: var(--text);
    font-size: 12px;
}

.doubao-status span {
    overflow-wrap: anywhere;
}

.doubao-status.is-running {
    background: color-mix(in srgb, var(--accent) 8%, var(--node-neu-surface));
    box-shadow: var(--neu-inset), 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent) inset;
}

.doubao-status.is-running strong {
    color: var(--accent);
}

.doubao-running-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.doubao-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--node-neu-surface);
    color: var(--accent);
    box-shadow: var(--neu-shadow);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.doubao-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.doubao-param-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--node-neu-surface);
    box-shadow: var(--neu-inset);
}
/* 模型行：标签 + 模型下拉 + 数量下拉 */
.doubao-param-row:has(.doubao-count-dropdown) {
    grid-template-columns: auto minmax(0, 1fr) auto;
}
.doubao-param-dropdown {
    width: 100%;
    min-width: 0;
}
.doubao-count-dropdown {
    width: 72px;
    flex: 0 0 72px;
}
.doubao-param-dropdown .param-trigger {
    width: 100%;
}

.doubao-tool-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.doubao-btn {
    height: 32px;
    min-height: 32px;
    border: none;
    border-radius: 10px;
    background: var(--node-neu-surface);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: var(--neu-shadow);
    transition: transform var(--duration-fast), box-shadow var(--duration-normal), background var(--duration-normal), color var(--duration-fast);
}

.doubao-btn:hover {
    transform: translateY(-1px);
    background: color-mix(in srgb, var(--accent) 8%, var(--node-neu-surface));
    color: var(--accent);
    box-shadow: var(--neu-shadow-hover);
}

.doubao-btn:active {
    transform: translateY(0);
    box-shadow: var(--neu-inset);
}

.doubao-btn.primary {
    width: 100%;
    height: 40px;
    min-height: 40px;
    border-radius: 12px;
    color: var(--text);
    background: var(--node-neu-surface);
    box-shadow: var(--neu-shadow);
    font-size: 13px;
    letter-spacing: 0.02em;
}

.doubao-btn.primary:hover {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--node-neu-surface));
    box-shadow: var(--neu-shadow-hover);
}

.doubao-btn.secondary {
    color: var(--text-soft);
}

.doubao-btn.secondary:hover {
    color: var(--accent);
}

.doubao-btn:disabled,
.doubao-btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .6;
    pointer-events: none;
    transform: none;
    background: var(--node-neu-surface);
    box-shadow: var(--neu-inset);
}
