* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: #F0EDE8; }

:root {
    --green: #10B981;
    --green-dark: #059669;
    --green-light: #ECFDF5;
    --warm-bg: #FBF8F4;
    --warm-card: #FFFCF7;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #EBE8E3;
    --gray-300: #D6D3CE;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-800: #1F2937;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
    background: #F0EDE8;
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

#app {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background: var(--warm-bg);
    position: relative;
    padding-bottom: 24px;
}

/* === 公共页面 === */
.page { display: none; padding: 16px; }
.page.active { display: block; }

/* === 登录页 === */
.login-page {
    flex-direction: column; justify-content: center;
    align-items: center; min-height: 100vh; padding: 40px 28px; text-align: center;
    position: relative;
    overflow: hidden;
}
.page.login-page.active { display: flex; }

.login-page::before {
    content: "";
    position: absolute; inset: 0;
    background: url("/img/logo.png") center/cover no-repeat;
    opacity: 0.12;
    z-index: 0;
}
.login-brand {
    position: relative;
    z-index: 1;
    margin-bottom: 48px;
}
.login-logo { display: none; }
.login-logo-fallback {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981, #34D399);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 12px 32px rgba(16,185,129,0.25);
    position: relative; z-index: 1;
}
.logo-icon-text {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
}
.login-subtitle {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}
.login-tip {
    margin-top: 24px;
    font-size: 9px;
    color: var(--gray-300);
    position: relative; z-index: 1;
}

/* 微信登录按钮 */
.btn-wechat {
    display: block; width: 100%; max-width: 320px; padding: 14px;
    background: #07C160; color: #fff; border: none;
    border-radius: var(--radius-sm); font-size: 16px; font-weight: 600; cursor: pointer;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    position: relative; z-index: 1;
}
.btn-wechat:active { background: #06AD56; transform: scale(0.98); }
.btn-wechat .wechat-icon { font-size: 20px; }

/* === 顶栏 === */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--warm-bg);
}
.top-bar h1 { font-size: 20px; font-weight: 700; color: var(--gray-800); }
.top-bar .archive-btn {
    color: var(--green);
    text-decoration: none;
    font-size: 11px;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid var(--green);
    cursor: pointer;
    font-weight: 500;
    background: #fff;
    display: inline-flex; align-items: center; gap: 4px;
}
.top-bar .archive-btn svg { flex-shrink: 0; }
.top-bar .archive-btn:active { background: var(--green-light); }

/* === 额度条 === */
.quota-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 20px 12px;
    font-size: 9px;
}
.quota-bar .q-item {
    padding: 4px 10px;
    border-radius: 12px;
    background: #fff;
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
    font-weight: 500;
    display: inline-flex; align-items: center; gap: 3px;
}
.quota-bar .q-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.quota-bar .q-zero {
    color: #EF4444;
    border-color: #FECACA;
    background: #FFF5F5;
}

/* === 模块按钮 === */
.section-label {
    font-size: 11px;
    color: var(--gray-400);
    padding: 8px 20px 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 0 20px;
    margin-bottom: 12px;
}
.module-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 16px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    min-height: 90px;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}
.module-btn:active {
    transform: scale(0.98);
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}
.module-btn.disabled { opacity: 0.35; pointer-events: none; }
.module-btn .icon { width: 26px; height: 26px; margin-bottom: 8px; }
.module-btn .icon svg { display: block; width: 100%; height: 100%; }

/* 模块图标配色 */
[data-module="technical"] .icon,
.q-item[data-module="technical"] { color: #10B981; }
[data-module="online_consult"] .icon,
.q-item[data-module="online_consult"] { color: #6366F1; }
[data-module="diagnose"] .icon,
.q-item[data-module="diagnose"] { color: #F59E0B; }
[data-module="laishilu"] .icon,
.q-item[data-module="laishilu"] { color: #EC4899; }
[data-module="video_script"] .icon,
.q-item[data-module="video_script"] { color: #8B5CF6; }
[data-module="daily_batch"] .icon,
.q-item[data-module="daily_batch"] { color: #F59E0B; }
[data-module="moments"] .icon,
.q-item[data-module="moments"] { color: #F59E0B; }
[data-module="xiaohongshu"] .icon,
.q-item[data-module="xiaohongshu"] { color: #EF4444; }
[data-module="rewrite"] .icon,
.q-item[data-module="rewrite"] { color: #8B5CF6; }
[data-module="comment_inbound"] .icon,
.q-item[data-module="comment_inbound"] { color: #06B6D4; }
[data-module="compliance"] .icon,
.q-item[data-module="compliance"] { color: #10B981; }
.module-btn .name { font-size: 15px; font-weight: 600; color: var(--gray-800); }
.module-btn .hint { font-size: 11px; color: var(--gray-400); margin-top: 2px; line-height: 1.4; }

/* === 列表区域 === */
.card-header svg,
.card-body svg { width: 16px; height: 16px; vertical-align: -3px; flex-shrink: 0; }
.list-section { padding: 12px 20px; }
.list-section h3 {
    font-size: 13px; color: var(--gray-400); margin-bottom: 12px;
    font-weight: 600; letter-spacing: 0.5px;
}
.content-card {
    padding: 14px 16px; background: #fff;
    border-radius: var(--radius-sm); margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}
.content-card .card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px; font-size: 12px; color: var(--gray-400);
}
.content-card .card-body {
    font-size: 13px; line-height: 1.6; max-height: 72px;
    overflow: hidden; color: var(--gray-600);
}
.content-card .card-actions { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }
.content-card .card-actions button {
    padding: 5px 12px; font-size: 12px; border-radius: 6px;
    border: 1px solid var(--gray-200); background: #fff; cursor: pointer; color: var(--gray-600);
}

/* === 表单 === */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 14px; font-weight: 600;
    color: var(--gray-800); margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm); font-size: 15px;
    background: #fff; color: var(--gray-800);
    transition: border-color 0.15s;
    font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.08);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: #C4BFB8; }
.form-group textarea { min-height: 80px; resize: vertical; }
.field-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; line-height: 1.5; }

.section-title {
    font-size: 15px; font-weight: 700;
    color: var(--gray-800);
    padding-top: 20px;
    margin-bottom: 4px;
    border-top: 1px solid var(--gray-200);
}

/* 多选组 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.checkbox-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    background: #fff;
}
.checkbox-item:has(input:checked) {
    background: var(--green-light);
    border-color: var(--green);
    color: var(--green-dark);
    font-weight: 500;
}
.checkbox-item input[type="checkbox"] { width: auto; margin: 0; }

/* === 主按钮 === */
.btn-primary {
    display: block; width: 100%; padding: 14px;
    background: var(--green); color: #fff; border: none;
    border-radius: var(--radius-sm); font-size: 16px; font-weight: 600; cursor: pointer;
    transition: all 0.15s;
}
.btn-primary:active { background: var(--green-dark); transform: scale(0.98); }

/* === 结果页 === */
.result-header {
    display: flex; align-items: center; padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200); gap: 12px;
    background: #fff;
}
.result-header .back-btn { background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px; }
.result-header .module-name { font-size: 16px; font-weight: 600; }

.result-content {
    padding: 20px; font-size: 15px; line-height: 1.8;
    white-space: pre-wrap; word-break: break-word; min-height: 200px;
}

.result-actions {
    display: flex; gap: 12px; padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
}
.result-actions button {
    flex: 1; padding: 12px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; cursor: pointer;
    border: 1px solid var(--gray-200); background: #fff;
}
.result-actions .btn-copy { background: var(--green); color: #fff; border-color: var(--green); }
.result-actions .btn-favorite { border-color: #F59E0B; color: #F59E0B; }

.follow-up { padding: 0 20px 16px; display: flex; gap: 8px; }
.follow-up input {
    flex: 1; padding: 12px; border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm); font-size: 14px;
}
.follow-up-send {
    padding: 11px 18px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.follow-up-send:active { background: var(--green-dark); }

/* === 覆盖层（档案表单） === */
.overlay {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--warm-bg); z-index: 100; overflow-y: auto; padding: 16px 20px;
}
.overlay.active { display: block; }
.overlay .close-btn { background: none; border: none; font-size: 22px; cursor: pointer; float: right; color: var(--gray-400); }
.overlay h2 { font-size: 20px; font-weight: 700; }

/* ================================================
   聊天页面
   ================================================ */
.chat-page {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 0 !important;
    background: #F0EDE8;
    overflow: hidden;
}
.page.chat-page.active { display: flex; }

.chat-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--warm-bg);
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 12px;
    flex-shrink: 0;
}
.chat-header .back-btn {
    background: none; border: none; font-size: 20px; cursor: pointer;
    padding: 4px; flex-shrink: 0; color: var(--gray-800);
}
.chat-header .chat-title {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: var(--gray-800);
}
.chat-header .chat-new-btn {
    background: #fff;
    border: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: 9px;
    padding: 5px 12px;
    border-radius: 16px;
    cursor: pointer;
    flex-shrink: 0;
    font-weight: 500;
}
.chat-header .chat-new-btn:active { background: var(--gray-100); }

/* 消息滚动区 */
.chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
    background: #F0EDE8;
}

/* 消息气泡 */
.chat-bubble {
    max-width: 82%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.65;
    word-break: break-word;
    animation: bubbleIn 0.25s ease-out;
}
@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-bubble.ai {
    align-self: flex-start;
    background: #fff;
    border-bottom-left-radius: 6px;
    color: var(--gray-800);
    box-shadow: var(--shadow-sm);
}
.chat-bubble.user {
    align-self: flex-end;
    background: var(--green);
    border-bottom-right-radius: 6px;
    color: #fff;
}

/* AI 气泡内的 Markdown 排版 */
.chat-bubble.ai h3 { font-size: 16px; font-weight: 700; margin: 12px 0 6px; color: var(--gray-800); }
.chat-bubble.ai h4 { font-size: 15px; font-weight: 700; margin: 10px 0 4px; color: var(--gray-800); }
.chat-bubble.ai h5 { font-size: 14px; font-weight: 700; margin: 8px 0 4px; color: var(--gray-800); }
.chat-bubble.ai h3:first-child,
.chat-bubble.ai h4:first-child,
.chat-bubble.ai h5:first-child { margin-top: 0; }

.chat-bubble.ai strong { color: var(--gray-800); }
.chat-bubble.ai em { font-style: italic; }

.chat-bubble.ai ul,
.chat-bubble.ai ol { padding-left: 20px; margin: 6px 0; }
.chat-bubble.ai li { margin-bottom: 2px; }
.chat-bubble.ai li:last-child { margin-bottom: 0; }

.chat-bubble.ai pre {
    margin: 8px 0;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-bubble.ai code {
    font-size: 11px;
    background: var(--gray-100);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: "SF Mono", "Menlo", monospace;
}
.chat-bubble.ai pre code {
    background: none;
    padding: 0;
    font-size: 11px;
}

.chat-bubble.ai blockquote {
    border-left: 3px solid var(--green);
    padding-left: 10px;
    margin: 6px 0;
    color: var(--gray-500);
}
.chat-bubble.ai hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 10px 0;
}

.copy-bubble-btn {
    display: block;
    margin-top: 8px;
    padding: 4px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: #fff;
    font-size: 9px;
    color: var(--gray-400);
    cursor: pointer;
    width: fit-content;
    margin-left: auto;
    margin-right: 0;
}
.copy-bubble-btn:active { background: var(--green-light); color: var(--green); border-color: var(--green); }

/* 用户气泡不需要 h3/h4 的特殊样式 */
.chat-bubble.user strong { font-weight: 700; }
.chat-bubble.user em { font-style: italic; }

/* 欢迎卡片 */
.chat-welcome {
    align-self: stretch;
    background: var(--warm-card);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow-md);
    animation: bubbleIn 0.3s ease-out;
}
.chat-welcome .welcome-icon {
    width: 22px; height: 22px;
    margin: 0 auto 4px;
    color: var(--green);
}
.chat-welcome .welcome-icon svg { display: block; width: 100%; height: 100%; }
.chat-welcome .welcome-title {
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2px;
    color: var(--gray-800);
}
.chat-welcome .welcome-desc {
    font-size: 11px;
    color: var(--gray-500);
    line-height: 1.5;
    text-align: center;
}
.chat-welcome .welcome-quota {
    display: inline-block;
    margin: 6px auto 0;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--green-dark);
    background: var(--green-light);
    text-align: center;
}
.chat-welcome .welcome-quota-zero {
    color: #EF4444;
    background: #FFF5F5;
}
.chat-welcome .welcome-tips {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}
.chat-welcome .tip-chip {
    font-size: 9px;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
}
.chat-welcome .tip-chip:active {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

/* 欢迎卡片 — 步骤导视 */
.welcome-steps { padding: 6px 10px;
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--green-light);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.step-item {
    font-size: 9px;
    color: var(--gray-600);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}
.step-item::before {
    content: "";
    display: inline-block;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    margin-top: 5px;
}

.welcome-tips-label {
    margin-top: 10px;
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 600;
}

/* 底部输入栏 */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--warm-bg);
    position: sticky;
    bottom: 0;
    z-index: 10;
    flex-shrink: 0;
}
.chat-input {
    flex: 1;
    padding: 11px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 22px;
    font-size: 15px;
    outline: none;
    background: #fff;
    color: var(--gray-800);
    transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--green); }
.chat-input::placeholder { color: #C4BFB8; }

.send-btn {
    padding: 11px 20px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}
.send-btn:active { background: var(--green-dark); }
.send-btn:disabled { opacity: 0.4; pointer-events: none; }


/* 打字指示器 */
.chat-typing {
    align-self: flex-start;
    padding: 10px 16px;
    background: #fff;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 4px;
    align-items: center;
    min-height: 40px;
}
.chat-typing span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--gray-300);
    animation: typingBounce 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%           { transform: translateY(-6px); }
}

/* === 业务诊断 === */
.diag-btn {
    width: 44px; height: 40px; border-radius: var(--radius-sm);
    background: #F59E0B; color: #fff; border: none; font-size: 15px;
    font-weight: 700; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.diag-btn:active { background: #D97706; }
.diag-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; margin: 0 16px 8px;
    background: #FFF7ED; border: 1px solid #FED7AA;
    border-radius: var(--radius-sm); font-size: 12px; color: #92400E;
}
.diag-bar button {
    padding: 4px 12px; font-size: 12px; border-radius: 4px;
    border: 1px solid #F59E0B; color: #F59E0B; background: #fff; cursor: pointer;
}
.diag-bar button:active { background: #FEF3C7; }
/* 诊断浮层 */
#page-diagnose-form .form-card {
    background: #fff; border-radius: 16px 16px 0 0;
    padding: 24px 20px; max-width: 500px; width: 100%;
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    z-index: 1000; box-shadow: 0 -4px 20px rgba(0,0,0,.1);
}
#page-diagnose-form .form-group { margin-bottom: 16px; }
#page-diagnose-form .form-group label {
    display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 4px;
}
#page-diagnose-form .form-group input,
#page-diagnose-form .form-group textarea {
    width: 100%; padding: 10px 12px; font-size: 14px;
    border: 1px solid #E5E7EB; border-radius: 8px; background: #F9FAFB;
}
#page-diagnose-form .form-actions { display: flex; gap: 10px; margin-top: 20px; }
#page-diagnose-form .btn-cancel {
    flex: 1; padding: 12px; font-size: 14px; font-weight: 600;
    border: 1px solid #E5E7EB; border-radius: 8px; background: #fff; color: #6B7280; cursor: pointer;
}
#page-diagnose-form .btn-save {
    flex: 2; padding: 12px; font-size: 14px; font-weight: 600;
    border: none; border-radius: 8px; background: #F59E0B; color: #fff; cursor: pointer;
}

/* === 调试页 === */
#page-debug h3 { margin: 16px 0 8px; font-size: 14px; color: #374151; }
#page-debug select, #page-debug textarea { font-family: inherit; }
#page-debug pre { font-family: "SF Mono", "Fira Code", monospace; }

/* 引流升级弹窗 */
.upgrade-card{background:#fff;border-radius:16px;padding:32px 24px;text-align:center;max-width:320px;width:85%;position:relative}
.upgrade-close{position:absolute;top:12px;right:16px;font-size:18px;color:#999;cursor:pointer}
.upgrade-icon{font-size:48px;margin-bottom:8px}
.btn-upgrade-close{background:#f3f4f6;color:#666;border:none;border-radius:10px;padding:10px 24px;font-size:14px;margin-top:12px;cursor:pointer}

/* === 内容生产步骤指示灯 === */
.chat-steps {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #EFEAE2;
    font-size: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}
.chat-steps .step {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
}
.chat-steps .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #E5E7EB;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 700;
}
.chat-steps .step.active {
    color: #fff;
    background: var(--green);
}
.chat-steps .step.active .step-num {
    background: rgba(255,255,255,0.3);
    color: #fff;
}
.chat-steps .step.done {
    color: var(--green);
}
.chat-steps .step.done .step-num {
    background: var(--green);
    color: #fff;
}
.chat-steps .step-sep { color: #D1D5DB; flex-shrink: 0; }

/* 群响式方向选择 chips */
.type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px 4px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.chips-hint {
    width: 100%;
    font-size: 12px;
    color: #9CA3AF;
    margin-bottom: 2px;
}
.type-chip {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
    border-radius: 16px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}
.type-chip:active { transform: scale(.96); }
.type-chip:hover { background: var(--green); color: #fff; border-color: var(--green); }

/* 草稿操作行 */
.draft-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-self: flex-start;
}
.btn-stage {
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 7px 16px;
    font-size: 13px;
    cursor: pointer;
}
.btn-stage.ghost {
    background: #fff;
    color: var(--green);
    border: 1px solid var(--green);
}

/* 意图驱动决策卡（同意 / 不对重来 / 其他） */
.decision-card {
    align-self: stretch;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 10px 14px;
    margin-top: 4px;
    animation: bubbleIn 0.25s ease-out;
}
.decision-hint {
    font-size: 12px;
    color: #16a34a;
    font-weight: 600;
    margin-bottom: 8px;
}
.decision-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.btn-decision {
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn-decision:hover { background: #0e9f6e; }
.btn-decision:active { transform: scale(.96); }
.btn-decision[data-value="reject"] { background: #fff; color: #ef4444; border: 1px solid #ef4444; }
.btn-decision[data-value="reject"]:hover { background: #fef2f2; }
.btn-decision[data-value="other"] { background: #fff; color: var(--gray-700); border: 1px solid #d1d5db; }
.btn-decision[data-value="other"]:hover { background: #f9fafb; }

/* 过锁报告卡片 / 终稿卡片 */
.chat-card {
    align-self: stretch;
    background: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    animation: bubbleIn 0.25s ease-out;
}
.lock-card { border-left: 4px solid #F59E0B; }
.final-card { border-left: 4px solid var(--green); }
.card-head {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lock-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.lock-badge.ok { background: #D1FAE5; color: #059669; }
.lock-badge.bad { background: #FEE2E2; color: #DC2626; }
.lock-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lock-item {
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: #374151;
}
.lock-item.sub { padding-left: 18px; font-size: 12px; color: #6B7280; }
.lock-item.ok .lock-name { color: #059669; }
.lock-item.bad .lock-name { color: #DC2626; font-weight: 600; }
.lock-detail {
    color: #9CA3AF;
    font-size: 12px;
}
.card-body { font-size: 13px; line-height: 1.65; color: #374151; }
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.final-body {
    font-size: 15px;
    line-height: 1.75;
    color: var(--gray-800);
    white-space: pre-wrap;
    word-break: break-word;
    background: #FAFAF8;
    border-radius: 10px;
    padding: 12px 14px;
    max-height: 420px;
    overflow-y: auto;
}
.btn-copy-final {
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 9px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

