/* 零号AI · 全屏会话工作台（ChatGPT 结构 + 平台 B 端气质） */

.wb-page.wb-page-ai,
.wb-page-ai {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
    background: #f5f6f8;
}

.wb-page.wb-page-ai .wb-ai-full,
.wb-ai-full {
    flex: 1;
    min-height: 0;
    display: flex;
    padding: 0;
    box-sizing: border-box;
    height: 100%;
}

.zero-ai-home-workspace {
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    margin: 0;
}

.zero-ai-workspace {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
    background: #fff;
}

/* —— 左侧会话侧栏 —— */
.zero-ai-session-side {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e8ebf0;
    background: #f7f8fa;
    padding: 12px 10px;
    box-sizing: border-box;
    overflow: hidden;
    transition: width 200ms ease, padding 200ms ease;
}

.zero-ai-session-side-head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-bottom: 12px;
}

.zero-ai-new-session {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 1px solid #d6e4ff;
    border-radius: 10px;
    background: #fff;
    color: #0056FF;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.zero-ai-new-session:hover {
    background: #f5f8ff;
    border-color: #0056FF;
}

.zero-ai-new-session i { font-size: 16px; }

.zero-ai-sidebar-toggle {
    width: 32px;
    height: 40px;
    flex-shrink: 0;
    border: 1px solid #e8ebf0;
    border-radius: 10px;
    background: #fff;
    color: #86909c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.zero-ai-sidebar-toggle:hover {
    color: #0056FF;
    border-color: #d6e4ff;
    background: #f5f8ff;
}

.zero-ai-sidebar-toggle i { font-size: 18px; line-height: 1; }

.zero-ai-session-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    opacity: 1;
    transition: opacity 160ms ease;
}

.zero-ai-session-side.is-collapsed {
    width: 48px;
    padding: 12px 6px;
}

.zero-ai-session-side.is-collapsed .zero-ai-session-side-head {
    flex-direction: column-reverse;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.zero-ai-session-side.is-collapsed .zero-ai-new-session {
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
}

.zero-ai-session-side.is-collapsed .zero-ai-side-label,
.zero-ai-session-side.is-collapsed .zero-ai-session-list {
    display: none;
}

.zero-ai-session-side.is-collapsed .zero-ai-sidebar-toggle {
    width: 36px;
    height: 36px;
}

.zero-ai-session-group { margin-bottom: 12px; }

.zero-ai-session-group-title {
    font-size: 12px;
    color: #86909c;
    padding: 4px 8px 6px;
}

.zero-ai-session-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 8px 8px 8px 10px;
    border-radius: 8px;
    color: #4e5969;
    font-size: 13px;
    cursor: pointer;
    line-height: 1.35;
    box-sizing: border-box;
}

.zero-ai-session-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zero-ai-session-ops {
    flex: 0 0 52px;
    width: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
}

.zero-ai-session-item:hover .zero-ai-session-ops,
.zero-ai-session-item.is-active .zero-ai-session-ops {
    opacity: 1;
    pointer-events: auto;
}

.zero-ai-session-op {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #86909c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.zero-ai-session-op i {
    font-size: 16px;
    line-height: 1;
}

.zero-ai-session-op:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #4e5969;
}

.zero-ai-session-op.is-pin.is-on,
.zero-ai-session-op.is-pin.is-on:hover {
    color: #0056FF;
}

.zero-ai-session-op.is-del:hover {
    background: #fff1f0;
    color: #f53f3f;
}

.zero-ai-session-item:hover {
    background: #eef0f3;
    color: #1d2129;
}

.zero-ai-session-item.is-active {
    background: #ebf2ff;
    color: #0056FF;
}

.zero-ai-session-item.is-active .zero-ai-session-op {
    color: #86909c;
}

.zero-ai-session-item.is-active .zero-ai-session-op.is-pin.is-on {
    color: #0056FF;
}

.zero-ai-session-item.is-active .zero-ai-session-op.is-del:hover {
    color: #f53f3f;
}

.zero-ai-session-empty {
    font-size: 12px;
    color: #c0c4cc;
    padding: 12px 8px;
}

.zero-ai-session-del-mask {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(15, 23, 42, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.zero-ai-session-del-dialog {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
    padding: 20px 20px 16px;
}

.zero-ai-session-del-text {
    font-size: 14px;
    line-height: 1.6;
    color: #1d2129;
    margin-bottom: 18px;
}

.zero-ai-session-del-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* —— 右侧主区 —— */
.zero-ai-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.zero-ai-context-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 24px;
    border-bottom: 1px solid #f2f3f5;
    flex-shrink: 0;
    min-height: 0;
    box-sizing: border-box;
    background: #fff;
}

.zero-ai-context-bar:empty,
.zero-ai-context-bar[style*="display: none"],
.zero-ai-context-bar[style*="display:none"] {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    min-height: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.zero-ai-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 8px 0 10px;
    border-radius: 4px;
    background: #ebf2ff;
    color: #0056FF;
    font-size: 12px;
    max-width: 100%;
}

.zero-ai-tag.is-muted {
    background: #f2f3f5;
    color: #4e5969;
}

.zero-ai-tag button {
    border: none;
    background: transparent;
    color: #86909c;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.zero-ai-tag button:hover { color: #1d2129; }

.zero-ai-main-body {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #f7f8fa;
}

.zero-ai-thread {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 24px 24px 32px;
    scroll-behavior: smooth;
    box-sizing: border-box;
    width: 100%;
}

.zero-ai-thread::-webkit-scrollbar { width: 6px; }
.zero-ai-thread::-webkit-scrollbar-thumb {
    background: rgba(96, 98, 102, 0.32);
    border-radius: 3px;
}

.zero-ai-thread-empty {
    max-width: 720px;
    margin: 10vh auto 0;
    text-align: center;
    padding: 0 16px;
}

.zero-ai-home-title {
    font-size: 24px;
    font-weight: 600;
    color: #1d2129;
    line-height: 1.4;
    margin: 0 0 8px;
}

.zero-ai-home-sub {
    font-size: 13px;
    color: #86909c;
    margin: 0 0 20px;
}

.zero-ai-welcome-chips {
    justify-content: center;
    flex-wrap: wrap;
}

.zero-ai-thread-empty.is-waiting {
    min-height: 120px;
}

.zero-ai-focus-list {
    margin: 10px 0 4px;
}

.zero-ai-focus-row {
    padding: 8px 0;
    border-bottom: 1px solid #f2f3f5;
    font-size: 13px;
    color: #1d2129;
}

.zero-ai-focus-row:last-child { border-bottom: none; }

.zero-ai-dash-mini { margin-top: 12px; }
.zero-ai-dash-mini:first-of-type { margin-top: 8px; }

.zero-ai-msg-end {
    width: 100%;
    height: 1px;
    overflow: hidden;
    pointer-events: none;
}

.zero-ai-jump-bottom {
    position: absolute;
    right: 28px;
    bottom: 16px;
    z-index: 3;
    display: none;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 12px;
    border-radius: 16px;
    border: 1px solid #e5eaf2;
    background: #fff;
    color: #4e5969;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(31, 35, 41, 0.08);
    cursor: pointer;
}

.zero-ai-jump-bottom.is-show { display: inline-flex; }

/* —— 消息 —— */
.zero-ai-msg {
    width: 100%;
    max-width: none;
    margin: 0 0 22px;
}

.zero-ai-msg-enter {
    animation: zeroAiMsgIn 0.18s ease;
}

@keyframes zeroAiMsgIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.zero-ai-msg-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.zero-ai-msg-row.is-user { justify-content: flex-end; }
.zero-ai-msg-row.is-ai { justify-content: flex-start; }

.zero-ai-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    user-select: none;
}

.zero-ai-avatar.is-user {
    background: #0056FF;
    color: #fff;
}

.zero-ai-avatar.is-system {
    background: #EEF4FF;
    color: #0056FF;
    box-sizing: border-box;
    /* 与首条系统会话条（min-height 44px）视觉垂直居中 */
    margin-top: 5px;
}

.zero-ai-bubble-user {
    max-width: 60%;
    width: fit-content;
    background: #0056FF;
    color: #FFFFFF;
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
}

.zero-ai-plain,
.zero-ai-ai-stack {
    max-width: min(780px, calc(100% - 40px));
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* 短文本自适应；含业务卡片的栈撑满可用宽度以便卡片到 780 */
.zero-ai-plain {
    width: fit-content;
    color: #1D2939;
    font-size: 13px;
    line-height: 1.7;
}

.zero-ai-ai-stack {
    width: 100%;
}

/* SystemTextMessage：普通系统文本回复条 */
.zero-ai-system-text {
    box-sizing: border-box;
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    background: #F8FBFF;
    border: 1px solid #D9E7FF;
    border-radius: 12px;
    color: #1D2939;
    font-size: 13px;
    line-height: 20px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 业务卡片内嵌说明文字（非独立会话条）仍用此样式 */
.zero-ai-ai-text {
    font-size: 13px;
    line-height: 1.7;
    color: #1D2939;
    white-space: pre-wrap;
}

.zero-ai-ai-stack > .zero-ai-system-text + .zero-ai-skill-used,
.zero-ai-plain > .zero-ai-system-text + .zero-ai-skill-used {
    margin-top: 10px;
}

.zero-ai-plain.is-system-nav > .zero-ai-system-text + .zero-ai-skill-used {
    margin-top: 10px;
}

.zero-ai-plain .zero-ai-actions {
    margin-top: 12px;
    align-self: flex-start;
    justify-content: flex-start;
}

.zero-ai-plain > .zero-ai-skill-used + .zero-ai-actions {
    margin-top: 8px;
}

.zero-ai-ai-stack > .zero-ai-system-text + .zero-ai-card,
.zero-ai-ai-stack > .zero-ai-skill-used + .zero-ai-card {
    margin-top: 8px;
    width: 100%;
    max-width: 780px;
    box-sizing: border-box;
}

.zero-ai-thinking {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4e5969;
    font-size: 13px;
    padding: 4px 0;
}

.zero-ai-thinking-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.zero-ai-thinking-dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #86909c;
    display: inline-block;
    animation: zeroAiDot 1s infinite ease-in-out;
}

.zero-ai-thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.zero-ai-thinking-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes zeroAiDot {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

.zero-ai-card {
    background: #FFFFFF;
    border: 1px solid #E5EAF2;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 8px;
    box-shadow: 0 1px 3px rgba(31, 35, 41, 0.04);
    width: 100%;
    max-width: 780px;
    box-sizing: border-box;
}

.zero-ai-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d2129;
    margin-bottom: 10px;
}

.zero-ai-card-sub,
.zero-ai-card-note {
    font-size: 12px;
    color: #86909c;
    margin-top: 4px;
    line-height: 1.5;
}

.zero-ai-card-note {
    margin-top: 8px;
    font-size: 13px;
    color: #4e5969;
}

.zero-ai-card-note.is-danger { color: #f53f3f; }

.zero-ai-meta {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 6px 8px;
    font-size: 13px;
}

.zero-ai-meta dt { color: #86909c; }
.zero-ai-meta dd { color: #1d2129; margin: 0; }

.zero-ai-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.zero-ai-dash-mini .zero-ai-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.zero-ai-stat {
    background: #f7f8fa;
    border-radius: 6px;
    padding: 8px 6px;
    text-align: center;
}

.zero-ai-stat b {
    display: block;
    font-size: 15px;
    color: #1d2129;
    font-weight: 600;
}

.zero-ai-stat span {
    font-size: 12px;
    color: #86909c;
}

.zero-ai-status {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 12px;
    background: #f2f3f5;
    color: #4e5969;
}

.zero-ai-status.on { background: #e8ffea; color: #00a870; }
.zero-ai-status.off { background: #ffece8; color: #f53f3f; }
.zero-ai-status.warn { background: #fff7e8; color: #d46b08; }

.zero-ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.zero-ai-btn {
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid #e5eaf2;
    background: #fff;
    color: #1d2129;
    font-size: 13px;
    cursor: pointer;
}

.zero-ai-btn:hover { border-color: #c9d4f0; color: #0056FF; }

.zero-ai-btn.primary {
    background: #0056FF;
    border-color: #0056FF;
    color: #fff;
}

.zero-ai-btn.primary:hover { background: #0046d9; color: #fff; }

.zero-ai-btn.danger {
    background: #fff;
    border-color: #f53f3f;
    color: #f53f3f;
}

.zero-ai-btn.danger.primary,
.zero-ai-btn.danger-solid {
    background: #f53f3f;
    border-color: #f53f3f;
    color: #fff;
}

.zero-ai-followups {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.zero-ai-follow {
    height: 28px;
    padding: 0 10px;
    border-radius: 14px;
    border: 1px solid #e5eaf2;
    background: #fff;
    color: #4e5969;
    font-size: 12px;
    cursor: pointer;
}

.zero-ai-follow:hover { background: #ebf2ff; color: #0056FF; border-color: #d6e4ff; }

.zero-ai-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 8px;
}

.zero-ai-table th {
    text-align: left;
    color: #8c8c8c;
    font-weight: 500;
    padding: 8px 6px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.zero-ai-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #f2f3f5;
    color: #1d2129;
}

.zero-ai-line-item {
    border: 1px solid #E5EAF2;
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    background: #fff;
}

.zero-ai-line-item h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.zero-ai-line-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
    font-size: 12px;
    color: #4e5969;
}

/* 客户线路查询：核心字段列表 */
.zero-ai-line-table-card {
    width: 100%;
    max-width: 840px;
    padding: 0;
    overflow: hidden;
    margin-top: 10px;
    box-sizing: border-box;
}

.zero-ai-line-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.zero-ai-line-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    table-layout: fixed;
}

.zero-ai-line-table th {
    height: 40px;
    padding: 0 14px;
    text-align: left;
    font-weight: 500;
    font-size: 13px;
    color: #86909c;
    background: #FAFAFA;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
    box-sizing: border-box;
}

.zero-ai-line-table td {
    height: 50px;
    padding: 0 14px;
    border-bottom: 1px solid #f2f3f5;
    color: #1d2129;
    font-size: 13px;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.zero-ai-line-table tbody tr:hover td {
    background: #fafbfc;
}

.zero-ai-cell-ellipsis {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.zero-ai-line-table th:last-child,
.zero-ai-line-table td.zero-ai-line-table-op {
    position: sticky;
    right: 0;
    width: 80px;
    min-width: 80px;
    text-align: left;
    background: #fff;
    box-shadow: -6px 0 8px -6px rgba(0, 0, 0, 0.06);
    z-index: 1;
}

.zero-ai-line-table th:last-child {
    background: #FAFAFA;
}

.zero-ai-line-table tbody tr:hover td.zero-ai-line-table-op {
    background: #fafbfc;
}

.zero-ai-text-btn {
    border: none;
    background: transparent;
    color: #0056FF;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.zero-ai-text-btn:hover {
    color: #0046d9;
    text-decoration: underline;
}

.zero-ai-plain.is-system-nav .zero-ai-line-table-card,
.zero-ai-plain.is-system-nav .zero-ai-line-detail-card {
    align-self: stretch;
    max-width: 840px;
}

.zero-ai-ai-stack > .zero-ai-line-table-card {
    width: 100%;
    max-width: 840px;
}

.zero-ai-plain.is-system-nav .zero-ai-line-table-card + .zero-ai-actions,
.zero-ai-plain.is-system-nav .zero-ai-line-table-card + .zero-ai-followups,
.zero-ai-ai-stack > .zero-ai-line-table-card + .zero-ai-actions,
.zero-ai-ai-stack > .zero-ai-line-table-card + .zero-ai-followups {
    margin-top: 14px;
}

.zero-ai-line-detail-card {
    width: 100%;
    max-width: 480px;
    margin-top: 8px;
}

.zero-ai-line-detail-card .zero-ai-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.zero-ai-confirm {
    border-color: #ffccc7;
    background: #fff7f6;
}

.zero-ai-success {
    border-color: #b7eb8f;
    background: #f6ffed;
}

.zero-ai-success-title {
    color: #00a870;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.zero-ai-reject-input {
    width: 100%;
    min-height: 72px;
    border: 1px solid #e8ebf0;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    margin-top: 8px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.zero-ai-skill-used {
    font-size: 12px;
    color: #98A2B3;
    margin-top: 6px;
    margin-bottom: 0;
    line-height: 1.4;
    align-self: flex-start;
    background: none;
    padding: 0;
    border: none;
}

.zero-ai-analysis-item {
    padding: 8px 0;
    border-top: 1px solid #f5f6f8;
    font-size: 13px;
}

.zero-ai-analysis-item:first-child { border-top: none; padding-top: 0; }
.zero-ai-analysis-item b { color: #1d2129; }

/* —— 底部输入（跟随右侧主内容区宽度自适应） —— */
.zero-ai-composer {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 24px 20px;
    background: linear-gradient(180deg, rgba(247, 248, 250, 0) 0%, #f7f8fa 28%, #f7f8fa 100%);
    border-top: 1px solid #f0f0f0;
}

.zero-ai-composer-inner {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.zero-ai-input-box {
    background: #FFFFFF;
    border: 1px solid #DCE3ED;
    border-radius: 16px;
    padding: 10px 12px 10px;
    min-height: 90px;
    max-height: 180px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: 0 2px 10px rgba(31, 35, 41, 0.04);
}

.zero-ai-input-box textarea {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.55;
    color: #1d2129;
    min-height: 44px;
    max-height: 96px;
    font-family: inherit;
    overflow: auto;
}

.zero-ai-input-box textarea::placeholder { color: #9ca6b9; }
.zero-ai-input-box textarea:disabled { opacity: 0.7; }

.zero-ai-input-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    position: relative;
}

.zero-ai-skill-rail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    position: relative;
}

.zero-ai-chip {
    height: 28px;
    padding: 0 10px;
    border-radius: 14px;
    border: 1px solid #e5eaf2;
    background: #fff;
    color: #4e5969;
    font-size: 12px;
    cursor: pointer;
    line-height: 26px;
    white-space: nowrap;
}

.zero-ai-chip:hover {
    border-color: #c9d4f0;
    color: #0056FF;
    background: #f5f8ff;
}

.zero-ai-chip.is-skill {
    background: #f5f8ff;
    border-color: #d6e4ff;
    color: #0056FF;
}

.zero-ai-chip.is-skill.active {
    background: #0056FF;
    border-color: #0056FF;
    color: #fff;
}

.zero-ai-chip.is-more {
    width: 28px;
    padding: 0;
    text-align: center;
    font-size: 16px;
    line-height: 26px;
}

.zero-ai-skill-pop {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: min(420px, 78vw);
    padding: 10px;
    background: #fff;
    border: 1px solid #e5eaf2;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(31, 35, 41, 0.12);
}

.zero-ai-send {
    height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: #0056FF;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}

.zero-ai-send:hover { background: #0046d9; }
.zero-ai-send:disabled { opacity: 0.55; cursor: not-allowed; }

.zero-ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zero-ai-icon-btn {
    border: none;
    background: transparent;
    color: #86909c;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.zero-ai-icon-btn:hover { background: #f2f3f5; color: #1d2129; }

/* —— FAB / Drawer —— */
.zero-ai-fab {
    position: fixed;
    right: 20px;
    bottom: 120px;
    z-index: 12010;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 14px 0 6px;
    border: none;
    border-radius: 24px;
    background: #0056FF;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 86, 255, 0.28);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.zero-ai-fab-icon {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    background: rgba(255,255,255,.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.zero-ai-fab-text {
    white-space: nowrap;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width .18s, opacity .18s;
}

.zero-ai-fab:hover .zero-ai-fab-text {
    max-width: 72px;
    opacity: 1;
}

body.zero-ai-drawer-open .zero-ai-fab,
.zero-ai-fab.is-hidden {
    display: none !important;
}

.zero-ai-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 38vw;
    min-width: 400px;
    max-width: 520px;
    height: 100vh;
    background: #fff;
    box-shadow: -8px 0 24px rgba(31, 35, 41, 0.12);
    z-index: 12000;
    display: none;
    flex-direction: column;
    pointer-events: none;
}

.zero-ai-drawer.open,
#zero-ai-drawer.open {
    display: flex !important;
    pointer-events: auto !important;
}

#zero-ai-drawer:not(.open) {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.zero-ai-drawer-head {
    padding: 14px 16px 12px;
    border-bottom: 1px solid #f2f3f5;
    flex-shrink: 0;
}

.zero-ai-drawer-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.zero-ai-drawer-head-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.zero-ai-drawer-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2129;
}

.zero-ai-drawer-sub {
    font-size: 12px;
    color: #86909c;
    margin-top: 2px;
}

.zero-ai-drawer-close {
    font-size: 18px;
}

.zero-ai-page-ctx {
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 12px;
    color: #86909c;
    line-height: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.zero-ai-drawer-history {
    margin-top: 10px;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    background: #fafbfc;
    max-height: 220px;
    overflow: auto;
    padding: 8px;
}

.zero-ai-drawer-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #86909c;
    padding: 0 4px 6px;
}

.zero-ai-drawer .zero-ai-main-body {
    margin-top: 0;
    padding-top: 0;
    background: #f7f8fa;
}

.zero-ai-drawer .zero-ai-thread {
    padding: 12px 12px 24px;
}

.zero-ai-drawer .zero-ai-msg { max-width: none; }
.zero-ai-drawer .zero-ai-composer {
    padding: 10px 12px 14px;
    background: #fff;
}
.zero-ai-drawer .zero-ai-composer-inner { max-width: none; }
.zero-ai-drawer .zero-ai-plain,
.zero-ai-drawer .zero-ai-ai-stack {
    max-width: calc(100% - 44px);
    width: auto;
}
.zero-ai-drawer .zero-ai-ai-stack { width: 100%; }
.zero-ai-drawer .zero-ai-bubble-user { max-width: calc(100% - 44px); }

.zero-ai-focus-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(31, 35, 41, 0.08);
    padding: 18px 20px;
    margin-bottom: 16px;
}

.zero-ai-focus-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.zero-ai-focus-sum {
    font-size: 13px;
    color: #4e5969;
    margin-top: 4px;
}

.zero-ai-focus-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid #f5f6f8;
    cursor: pointer;
    font-size: 13px;
    color: #1d2129;
}

.zero-ai-focus-item:hover { color: #0056FF; }
.zero-ai-focus-item i { color: #c0c4cc; }

@media (max-width: 1100px) {
    .zero-ai-drawer {
        width: 86vw;
        min-width: 0;
        max-width: none;
    }
    .zero-ai-session-side:not(.is-collapsed) { width: 200px; }
}

@media (max-width: 900px) {
    .zero-ai-plain,
    .zero-ai-ai-stack {
        max-width: calc(100% - 40px);
    }
    .zero-ai-stats,
    .zero-ai-dash-mini .zero-ai-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .zero-ai-session-side:not(.is-collapsed) { width: 168px; }
    .zero-ai-context-bar,
    .zero-ai-thread,
    .zero-ai-composer {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* —— 生命周期欢迎态 / 角色 / Dashboard —— */
.zero-ai-thread-empty.is-lifecycle {
    max-width: 920px;
    margin: 48px auto 32px;
    text-align: left;
}

.zero-ai-workspace.is-welcome .zero-ai-thread-empty {
    max-width: 920px;
    margin: 40px auto 48px;
    text-align: left;
}

.zero-ai-workspace.is-welcome .zero-ai-home-title,
.zero-ai-workspace.is-welcome .zero-ai-home-sub {
    text-align: center;
}

.zero-ai-workspace.is-welcome .zero-ai-welcome-chips {
    justify-content: center;
    margin-bottom: 28px;
}

.zero-ai-home-hint {
    margin-top: 16px;
    font-size: 12px;
    color: #86909c;
    text-align: center;
}

.zero-ai-role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
    width: 100%;
    align-items: stretch;
}

@media (max-width: 720px) {
    .zero-ai-role-grid { grid-template-columns: 1fr; }
}

.zero-ai-msg .zero-ai-role-grid {
    max-width: 100%;
}

.zero-ai-role-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    border: 1px solid #e8ebf0;
    border-radius: 10px;
    padding: 14px;
    background: #fff;
    text-align: left;
    box-sizing: border-box;
}

.zero-ai-role-card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.zero-ai-role-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.zero-ai-role-card-head strong {
    font-size: 14px;
    color: #1d2129;
    font-weight: 600;
}

.zero-ai-role-card p {
    margin: 0 0 10px;
    font-size: 12px;
    color: #4e5969;
    line-height: 1.6;
    flex-shrink: 0;
}

.zero-ai-role-caps-label {
    margin-bottom: 6px;
    flex-shrink: 0;
}

.zero-ai-role-tag {
    display: inline-block;
    font-size: 11px;
    color: #0056FF;
    background: #eef4ff;
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 500;
    flex-shrink: 0;
}

.zero-ai-role-caps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
    align-content: flex-start;
}

.zero-ai-role-caps span {
    font-size: 11px;
    color: #4e5969;
    background: #f2f3f5;
    border-radius: 4px;
    padding: 2px 6px;
}

.zero-ai-role-excludes {
    font-size: 11px;
    color: #86909c;
    margin-bottom: 10px;
}

.zero-ai-role-card-foot,
.zero-ai-role-card .zero-ai-actions {
    margin-top: auto;
    padding-top: 14px;
    flex-shrink: 0;
    justify-content: flex-start;
}

.zero-ai-role-card .zero-ai-btn {
    min-width: 148px;
    height: 32px;
    padding: 0 14px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.zero-ai-my-roles {
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #fafbfc;
}

.zero-ai-my-roles-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #1d2129;
    margin-bottom: 8px;
}

.zero-ai-my-roles-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.zero-ai-my-role-item {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.zero-ai-my-role-item span { color: #86909c; }

.zero-ai-config-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff7e8;
    color: #ad6800;
    font-size: 13px;
    margin-bottom: 14px;
}

.zero-ai-progress-welcome,
.zero-ai-progress-card {
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 14px;
    background: #fff;
    text-align: left;
}

.zero-ai-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.zero-ai-progress-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.zero-ai-progress-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4e5969;
}

.zero-ai-progress-item.is-done { color: #00a870; }
.zero-ai-progress-icon { width: 16px; text-align: center; }

.zero-ai-home-dashboard {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.zero-ai-dash-card {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 16px 18px;
    text-align: left;
}

.zero-ai-dash-block { margin-bottom: 14px; }
.zero-ai-dash-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.zero-ai-dash-metric {
    border: 1px solid #eef0f3;
    border-radius: 8px;
    background: #fafbfc;
    padding: 12px;
    text-align: left;
    cursor: pointer;
}

.zero-ai-dash-metric:hover { border-color: #c9d8ff; background: #f5f8ff; }
.zero-ai-dash-label { font-size: 12px; color: #86909c; margin-bottom: 6px; }
.zero-ai-dash-value { font-size: 18px; font-weight: 600; color: #1d2129; }

.zero-ai-dash-msg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f2f3f5;
    font-size: 13px;
}

.zero-ai-dash-msg:last-child { border-bottom: none; }
.zero-ai-dash-favs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.zero-ai-dash-fav {
    border: 1px solid #eef0f3;
    border-radius: 8px;
    background: #fff;
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #1d2129;
    cursor: pointer;
}

.zero-ai-dash-fav i { font-size: 18px; color: #0056FF; }
.zero-ai-dash-fav:hover { border-color: #c9d8ff; }

.zero-ai-workspace.is-chatting .zero-ai-home-dashboard { display: none; }

@media (max-width: 900px) {
    .zero-ai-dash-grid,
    .zero-ai-dash-favs,
    .zero-ai-my-roles-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
