/* ===== 耀发家政AI智能体平台 - 全局样式 ===== */

:root {
    /* 主色调 - 知性优雅的紫蓝色系 */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.4);
    
    /* 辅助色 */
    --accent: #14b8a6;
    --accent-light: #2dd4bf;
    --accent-glow: rgba(20, 184, 166, 0.3);
    
    /* 背景色 */
    --bg-base: #0f0f1e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(255, 255, 255, 0.06);
    
    /* 文字色 */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* 边框 */
    --border: rgba(255, 255, 255, 0.1);
    --border-active: rgba(99, 102, 241, 0.5);
    
    /* 阴影 */
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--primary-glow);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    /* 动画 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme override */
.theme-light {
    --bg-base: #f0f2f8;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --bg-input: rgba(255, 255, 255, 0.8);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== 动态背景 ===== */
.bg-orbs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: -10%; left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #14b8a6, transparent 70%);
    bottom: -10%; right: -5%;
    animation-delay: -7s;
}

.orb-3 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    top: 40%; left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, -40px) scale(1.1); }
    66% { transform: translate(-40px, 30px) scale(0.95); }
}

/* ===== 通用组件 ===== */
.app-container {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-card-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.input-field {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
    outline: none;
}

.input-field:focus {
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-field::placeholder {
    color: var(--text-muted);
}

/* ===== 激活页 ===== */
.activation-view {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 20px;
}

.activation-card {
    width: 100%;
    max-width: 480px;
    padding: 48px 40px;
    text-align: center;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.logo-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px var(--primary-glow);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 10px 40px var(--primary-glow); }
    50% { box-shadow: 0 10px 60px var(--primary-glow), 0 0 30px var(--accent-glow); }
}

.logo-wrapper svg {
    width: 44px;
    height: 44px;
    color: white;
}

.activation-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.activation-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
}

.activation-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activation-features {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.feature-item svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.error-msg {
    color: #ef4444;
    font-size: 14px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    animation: shake 0.4s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* ===== 聊天界面 ===== */
.chat-view {
    display: none;
    height: 100vh;
    flex-direction: column;
}

.chat-view.active {
    display: flex;
}

/* 顶栏：曾因 display:none !important 被整条隐藏，导致右上角导航（模块入口 / 额度 / 退出）全部消失。
   这里恢复为常规 flex 布局，并禁止被压缩（flex-shrink:0），保证下方聊天区滚动时顶栏常驻。 */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: contain;
    background: transparent;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.chat-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

/* ===== 右上角模块导航（各服务端口入口）===== */
/* 端口 / 标题与 F:\yaofaAI\framework\config.py 的 MODULES 一一对应。
   在线 → 绿点；离线 → 中性灰点（不使用红色告警，保持柔和色调）。 */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    max-width: min(72vw, 100%);
}

.top-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.top-nav-btn:hover {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.28);
    border-color: var(--border-active);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--primary-glow);
}

.top-nav-btn.offline {
    opacity: 0.6;
}

.top-nav-btn.probing {
    opacity: 0.55;
    pointer-events: none;
}

.top-nav-port {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

.top-nav-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-muted);
}

.top-nav-dot.online {
    background: #34d399;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.75);
}

.top-nav-dot.offline {
    background: #94a3b8;
    opacity: 0.7;
}

.top-nav-refresh {
    padding: 7px 11px;
    font-size: 15px;
}

.quota-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
}

.quota-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* 侧边栏 */
.chat-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

/* 顶栏导航说明：右上角 chat-header-right 承载「模块导航(#topNav) + 视频工作室 + 额度 + 退出」。
   ⚠️ 不要再给 .chat-header 加 display:none，否则整条顶栏（含右上角全部入口）会一起消失。 */

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.new-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-list::-webkit-scrollbar {
    width: 4px;
}

.conversation-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
}

.conv-item:hover {
    background: var(--bg-card-hover);
}

.conv-item.active {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.conv-item .conv-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.conv-item.active .conv-icon {
    color: var(--primary-light);
}

.conv-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-item.active .conv-title {
    color: var(--text-primary);
}

.conv-delete {
    opacity: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
}

.conv-item:hover .conv-delete {
    opacity: 1;
}

.conv-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* 主聊天区 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 6px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: msgIn 0.3s ease;
}

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

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
}

.message.assistant .msg-avatar {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.message.user .msg-avatar {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.msg-bubble {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.message.assistant .msg-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
}

.message.user .msg-bubble {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-top-right-radius: 4px;
}

/* ===== 助手回答「复制」按钮（2026-09-25 新增）=====
   .msg-body 只做「定位参考系 + 纵向排列」，本身不产生视觉；
   按钮绝对定位贴在它的右下角（即回答框的右下角），
   气泡底部预留 34px 内边距给按钮让位 —— 这样按钮永远不会压住正文。 */
.msg-body {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
}

.message.assistant .msg-bubble {
    padding-bottom: 34px;
}

.msg-copy-btn {
    position: absolute;
    right: 10px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-input);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;
    cursor: pointer;
    opacity: 0.72;
    transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.msg-copy-btn:hover {
    opacity: 1;
    color: var(--primary);
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.msg-copy-btn:active {
    transform: translateY(1px);
}

/* 复制成功后的 1.6 秒反馈态（绿点色，沿用顶栏模块在线色） */
.msg-copy-btn.is-done {
    opacity: 1;
    color: #34d399;
    border-color: #34d399;
}

/* 流式生成中：按钮禁用，避免复制到半截答案 */
.msg-copy-btn.is-waiting,
.msg-copy-btn:disabled {
    opacity: 0.38;
    cursor: progress;
    pointer-events: none;
}

.msg-copy-icon {
    display: inline-flex;
    align-items: center;
}

.msg-copy-btn svg {
    display: block;
}

/* 打字指示器 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* 空状态 */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    width: 64px;
    height: 64px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    text-align: center;
}

.suggestion-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 12px;
}

.suggestion-chip {
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-chip:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

/* 输入区 */
.chat-input-area {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    max-width: 900px;
    margin: 0 auto;
}

.chat-input {
    flex: 1;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 15px;
    resize: none;
    min-height: 48px;
    max-height: 120px;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
    line-height: 1.5;
}

.chat-input:focus {
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    z-index: 9999;
    transition: var(--transition);
    opacity: 0;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { border-color: var(--accent); }
.toast.error { border-color: #ef4444; }

/* ===== 加载动画 ===== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 侧边栏 · 功能模块导航 ===== */
.module-nav {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    padding: 10px 12px 14px;
    max-height: 50%;
    overflow-y: auto;
}

.module-nav::-webkit-scrollbar { width: 4px; }
.module-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.module-nav-title {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-secondary);
    text-transform: uppercase;
    opacity: 0.7;
}

.module-nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 2px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.module-nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.8;
}

.module-nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.module-nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.08));
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.module-nav-item.active svg {
    opacity: 1;
    color: var(--primary);
}

/* 新增入口分组分隔线 + 分组标签（2026-09-24 由「一人公司AI团队」风格导航并入 6 项时使用） */
.module-nav-sep {
    height: 1px;
    background: var(--border);
    margin: 8px 8px 6px;
    opacity: 0.7;
}

.module-nav-group {
    padding: 2px 8px 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-secondary);
    opacity: 0.55;
    text-transform: uppercase;
}

/* ===== 模块视图（嵌入式 iframe 容器） ===== */
.module-view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    z-index: 5;
}

.module-view[hidden] { display: none; }

.module-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    flex-shrink: 0;
}

.module-view-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.module-view-title svg {
    color: var(--primary);
}

#moduleFrame {
    flex: 1;
    width: 100%;
    border: 0;
    background: transparent;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .activation-card {
        padding: 32px 24px;
    }
    
    .activation-title {
        font-size: 22px;
    }
    
    .message {
        max-width: 95%;
    }
    
    .chat-input-area {
        padding: 12px 16px 16px;
    }
}

/* =========================================================================
   一人公司工作流引导（首页空状态）— 2026-09-16 新增
   -------------------------------------------------------------------------
   把升级方案的五步建设进度直接摊在首页：哪步做完了、点哪去补。
   颜色沿用平台紫，状态用翠绿(完成)/琥珀(待办)，**不用红色**避免误读为报错。
   ========================================================================= */
.workflow-guide {
    width: 100%;
    max-width: 760px;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    padding: 16px 18px;
}

.workflow-guide-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.workflow-guide-head .wg-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.workflow-guide-head .wg-progress {
    font-size: 12px;
    color: var(--text-muted);
}

.wf-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wf-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(124, 58, 237, .03);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.wf-step:hover {
    border-color: var(--border-active, #c4b5fd);
    background: rgba(124, 58, 237, .07);
}

.wf-step .wf-dot {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: #fff;
}

.wf-step.done .wf-dot {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #059669;
}

.wf-step.todo .wf-dot {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #b45309;
}

.wf-step .wf-main {
    flex: 1;
    min-width: 0;
}

.wf-step .wf-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.wf-step .wf-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wf-step .wf-go {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--primary);
    opacity: .8;
}

.wf-empty-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
    text-align: center;
}


/* ============================================================
 * 官网色彩统一覆盖层（2026-11-21）
 * 与耀发家政官网一致：米黄 #F9F2E4 / 焦糖金 #C99447 / 标题#333 正文#555 / 灰蓝#627890
 * 追加在文件末尾以覆盖前面的深色紫蓝主题；删除本段即可回滚。
 * ============================================================ */
:root {
  --primary:#C99447; --primary-dark:#A97833; --primary-light:#E7D2A8;
  --primary-glow:rgba(201,148,71,.28);
  --accent:#627890; --accent-light:#7C90A8; --accent-glow:rgba(98,120,144,.25);
  --bg-base:#F9F2E4; --bg-card:#FDFAF2; --bg-card-hover:#FFFFFF; --bg-input:#FFFFFF;
  --text-primary:#333333; --text-secondary:#555555; --text-muted:#8C8578;
  --border:#E7DDC7; --border-active:#C99447;
  --shadow-lg:0 12px 36px rgba(120,95,45,.12);
  --shadow-glow:0 0 28px rgba(201,148,71,.18);
}
/* 背景光球改为淡金/灰蓝，避免深色底 */
.bg-orbs{opacity:.5}
.orb-1,.orb-2,.orb-3{filter:saturate(.6)}
/* 主体与卡片 */
body,.chat-view,.app-container{background:var(--bg-base);color:var(--text-primary)}
.glass-card{background:#FDFAF2;border:1px solid var(--border);box-shadow:0 8px 30px rgba(120,95,45,.10)}
/* 顶部栏 */
.chat-header{background:#FDFAF2;border-bottom:1px solid var(--border)}
.header-title,.header-subtitle{color:var(--text-primary)}
.header-subtitle{color:var(--text-muted)}
/* 侧栏与模块导航 */
.sidebar,.module-nav{background:#FDFAF2;border-color:var(--border)}
.sidebar-header,.module-nav-title,.conv-title,.module-nav-item,.wf-step .wf-name{color:var(--text-primary)}
.conv-item{border-color:var(--border);color:var(--text-secondary)}
.conv-item:hover,.conv-item.active{background:var(--gold-bg,#F6E9CE);border-color:var(--primary)}
.module-nav-item{color:var(--text-secondary)}
.module-nav-item:hover,.module-nav-item.active{background:#F6E9CE;color:#A97833}
.new-chat-btn{background:var(--primary);color:#fff;border:none}
.new-chat-btn:hover{background:var(--primary-dark)}
/* 对话气泡：助手=白卡，用户=焦糖金实心白字 */
.message.assistant .msg-bubble{background:#FFFFFF;border:1px solid var(--border);color:var(--text-primary)}
.message.user .msg-bubble{background:linear-gradient(135deg,#C99447,#A97833);color:#fff}
.message.assistant .msg-avatar{background:linear-gradient(135deg,#C99447,#A97833);color:#fff}
.message.user .msg-avatar{background:#F6E9CE;color:#A97833;border:1px solid var(--border)}
/* 输入区 */
.chat-input-area,.chat-input-wrapper{background:#FDFAF2;border-color:var(--border)}
.chat-input{background:#FFFFFF;color:var(--text-primary);border:1px solid var(--border)}
.chat-input::placeholder{color:var(--text-muted)}
.send-btn{background:var(--primary);color:#fff}
.send-btn:hover{background:var(--primary-dark)}
/* 按钮 */
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-dark)}
.btn-ghost{background:transparent;color:var(--text-primary);border:1px solid var(--border)}
.btn-ghost:hover{border-color:var(--primary);color:var(--primary-dark)}
.quota-badge{background:#F6E9CE;color:#A97833;border-color:var(--line,#E7DDC7)}
/* 空状态与建议 */
.empty-state,.suggestion-chip{color:var(--text-secondary)}
.suggestion-chip{background:#FFFFFF;border:1px solid var(--border)}
.suggestion-chip:hover{background:#F6E9CE;border-color:var(--primary)}
/* 工作台/模块视图 */
.module-view,.workflow-guide{background:#FDFAF2;color:var(--text-primary)}
.input-field{background:#FFFFFF;color:var(--text-primary);border:1px solid var(--border)}
.input-field:focus{border-color:var(--primary)}

/* ============================================================
 * 整页字体放大覆盖层（2026-11-21 用户要求：字号增加一倍）
 * 放末尾以覆盖前面所有定义；删除本段即可回滚。
 * 顶栏字号在 mode.js 内单独放大。
 * ============================================================ */
body{font-size:30px}
/* 提问框与按钮 */
.chat-input,.input-field{font-size:28px !important;line-height:1.5;padding:16px 20px}
.chat-input::placeholder{font-size:26px}
.send-btn{width:60px;height:60px}
.send-btn svg{width:32px;height:32px}
.chat-input-area{padding:20px 28px 26px}
/* 消息气泡与头像 */
.msg-bubble{font-size:28px !important;line-height:1.65;padding:18px 24px}
.msg-avatar{font-size:26px;width:52px;height:52px}
.message{gap:16px}
.messages-area{gap:32px;padding:28px}
/* 空状态 / 建议项 */
.empty-state{font-size:30px !important}
.suggestion-chip{font-size:26px;padding:14px 22px}
/* 聊天头（admin 完整模式可见） */
.header-title{font-size:34px !important}
.header-subtitle{font-size:24px !important}
.header-logo{width:60px;height:60px}
.chat-header{padding:18px 28px}
/* 侧栏与模块导航（admin 完整模式可见） */
.sidebar{width:360px}
.new-chat-btn,.conv-title,.module-nav-title,.module-nav-item,.wf-step .wf-name{font-size:26px}
.conv-item,.conv-item-title,.conv-preview{font-size:24px}
.module-nav-item{padding:14px 18px}
.module-nav-item svg{width:26px;height:26px}
/* 通用按钮 */
.btn,.btn-primary,.btn-ghost{font-size:26px;padding:14px 22px}
.btn-sm{font-size:22px;padding:10px 16px}

/* ============================================================
 * 输入框强化（2026-11-21 用户要求：增大且明显可见）
 * 浅金底 + 焦糖金描边 + 阴影，让输入区一眼可见；删本段可回滚。
 * ============================================================ */
.chat-input-area{
  padding:26px 40px 34px !important;
  background:#FDF6E7 !important;
  border-top:2px solid #E3C88E !important;
  box-shadow:0 -10px 30px rgba(201,148,71,.10);
}
.chat-input-wrapper{
  max-width:1100px;
  background:#FFFFFF !important;
  border:3px solid #C99447 !important;
  border-radius:20px !important;
  padding:12px 16px;
  box-shadow:0 8px 26px rgba(201,148,71,.20);
  transition:box-shadow .2s,border-color .2s;
}
.chat-input-wrapper:focus-within{
  border-color:#A97833 !important;
  box-shadow:0 0 0 6px rgba(201,148,71,.18),0 8px 26px rgba(201,148,71,.22);
}
.chat-input{
  font-size:30px !important;
  line-height:1.5 !important;
  min-height:56px;
  padding:14px 18px !important;
  border:none !important;
  background:transparent !important;
}
.chat-input::placeholder{color:#9A8B72 !important;font-size:27px !important}
.send-btn{
  width:72px !important;height:72px !important;
  flex-shrink:0;
  border-radius:50% !important;
  background:linear-gradient(135deg,#C99447,#A97833) !important;
  box-shadow:0 6px 18px rgba(201,148,71,.40);
}
.send-btn svg{width:38px;height:38px}
.send-btn:disabled{opacity:.55;box-shadow:none}
