:root {
      --bg: #f5f7fa;
      --card: #ffffff;
      --ink: #1f2933;
      --ink-2: #475569;
      --muted: #6b7785;
      --brand: #2563eb;
      --brand-soft: #eff4ff;
      --ok: #16a34a;
      --err: #dc2626;
      --warn: #d97706;
      --border: #e3e8ef;
      --line: #e3e8ef;
      --sidebar-width: 56px;
      --topbar-height: 48px;
    }
    .dark {
      --bg: #0f172a;
      --card: #1e293b;
      --ink: #f1f5f9;
      --ink-2: #cbd5e1;
      --muted: #94a3b8;
      --brand: #3b82f6;
      --brand-soft: #1e3a8a;
      --border: #334155;
      --line: #334155;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
      background: var(--bg);
      color: var(--ink);
      height: 100vh;
      overflow: hidden;
    }

    /* ========== 鐧诲綍閬僵 ========== */
    #loginOverlay {
      position: fixed; inset: 0; background: var(--bg); z-index: 50;
      display: flex; align-items: center; justify-content: center;
    }
    #loginOverlay .login-card {
      background: var(--card); border: 1px solid var(--border); border-radius: 16px;
      padding: 32px; width: 360px; box-shadow: 0 10px 30px rgba(31,41,51,0.08);
    }
    #loginOverlay h2 { margin: 0 0 4px; font-size: 20px; }
    #loginOverlay p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
    #loginOverlay input {
      width: 100%; border: 1px solid var(--border); border-radius: 10px;
      padding: 10px 12px; font-size: 14px; margin-bottom: 12px; font-family: inherit;
      background: var(--card); color: var(--ink);
    }
    #loginOverlay button {
      width: 100%; border: none; background: var(--brand); color: #fff;
      border-radius: 10px; padding: 10px; font-size: 14px; cursor: pointer;
    }
    #loginOverlay .login-status { font-size: 13px; margin-top: 10px; min-height: 18px; }
    #loginOverlay .login-status.err { color: var(--err); }

    /* ========== 涓诲竷灞€ ========== */
    .app-layout {
      display: flex;
      flex-direction: column;
      height: 100vh;
      display: none;
    }
    .app-layout.show { display: flex; }
    /* 宸茬櫥褰曠姸鎬侊細鎻愬墠闅愯棌鐧诲綍椤碉紝鏄剧ず搴旂敤甯冨眬锛岄伩鍏嶉棯鐑侊紙鎰熻鍍忔墦寮€涓ゆ锛?*/
    html.logged-in #loginOverlay { display: none !important; }
    html.logged-in .app-layout { display: flex !important; }

    /* ========== 椤堕儴瀵艰埅鏍?========== */
    .topbar {
      height: var(--topbar-height);
      background: var(--card);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      padding: 0 16px;
      gap: 12px;
      flex-shrink: 0;
    }
    .topbar-brand {
      font-weight: 700;
      font-size: 15px;
      color: var(--brand);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .topbar-brand .logo {
      width: 28px;
      height: 28px;
      background: var(--brand);
      color: #fff;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
    }
    .topbar-nav {
      display: flex;
      gap: 4px;
      margin-left: 24px;
    }
    .topbar-nav-item {
      padding: 6px 12px;
      border-radius: 8px;
      font-size: 13px;
      color: var(--ink-2);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: all 0.15s;
    }
    .topbar-nav-item:hover {
      background: var(--bg);
      color: var(--ink);
    }
    .topbar-nav-item.active {
      background: var(--brand-soft);
      color: var(--brand);
      font-weight: 600;
    }
    .topbar-spacer { flex: 1; }
    .topbar-user {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 6px 10px;
      border-radius: 10px;
      cursor: pointer;
      transition: background 0.15s;
    }
    .topbar-user:hover { background: var(--bg); }
    .topbar-avatar {
      width: 32px;
      height: 32px;
      background: var(--brand-soft);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
    }
    .topbar-phone { font-size: 13px; font-weight: 500; color: var(--ink); }
    .lang-switcher { display: flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
    .lang-btn { padding: 4px 10px; font-size: 12px; cursor: pointer; border: none; background: transparent; color: var(--ink-2); font-weight: 500; transition: all 0.15s; }
    .lang-btn.active { background: var(--brand); color: #fff; }
    .lang-btn:hover:not(.active) { background: var(--bg); }

    /* ========== 涓讳綋鍐呭鍖?========== */
    /* overflow 蹇呴』涓?hidden锛氱害鏉熷唴閮?.messages / .sidebar 鍚勮嚜婊氬姩锛?
       鍘熺敓 <select> 寮瑰眰鐢辨祻瑙堝櫒缁樺埗鍦ㄩ《灞傦紝涓嶅彈姝よ鍓奖鍝嶃€?*/
    .main-area {
      flex: 1;
      display: flex;
      min-height: 0;
      overflow: hidden;
      max-width: 1400px;
      margin: 0 auto;
      width: 100%;
    }

    /* ========== 宸︿晶渚ц竟鏍?========== */
    .sidebar {
      width: 200px;
      background: var(--card);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      padding: 12px 8px;
      gap: 2px;
      flex-shrink: 0;
      overflow-y: auto;
    }
    .sidebar-section {
      margin-bottom: 8px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border);
    }
    .sidebar-section-title {
      font-size: 11px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 4px 8px;
      margin-bottom: 4px;
    }
    .folder-cwd {
      font-size: 11px; color: var(--muted);
      padding: 0 8px 4px; margin-bottom: 2px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .folder-list {
      max-height: 220px; overflow-y: auto;
      padding: 0 4px;
    }
    .folder-item {
      display: flex; align-items: center; gap: 8px;
      padding: 6px 8px; border-radius: 6px;
      font-size: 12px; color: var(--ink-2);
      cursor: pointer; transition: all 0.12s;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .folder-item:hover { background: var(--brand-soft); color: var(--brand); }
    .folder-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
    .folder-item .fi-ico { flex-shrink: 0; }
    .folder-item .fi-more { margin-left: auto; font-size: 11px; opacity: 0.6; }
    .sidebar-icon {
      width: 100%;
      height: 36px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 0 8px;
      cursor: pointer;
      color: var(--ink-2);
      transition: all 0.15s;
      position: relative;
      font-size: 13px;
    }
    .sidebar-icon .icon {
      font-size: 16px;
      width: 20px;
      text-align: center;
      flex-shrink: 0;
    }
    .sidebar-icon .label {
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .sidebar-icon .badge {
      font-size: 10px;
      padding: 2px 6px;
      border-radius: 10px;
      background: var(--brand-soft);
      color: var(--brand);
      font-weight: 600;
      flex-shrink: 0;
    }
    .sidebar-icon:hover {
      background: var(--bg);
      color: var(--ink);
    }
    .sidebar-icon.active {
      background: var(--brand-soft);
      color: var(--brand);
      font-weight: 600;
    }
    .sidebar-icon.active::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 3px;
      height: 20px;
      background: var(--brand);
      border-radius: 0 2px 2px 0;
    }
    .sidebar-spacer { flex: 1; }
    .sidebar-pin {
      font-size: 10px;
      color: var(--warn);
      flex-shrink: 0;
    }
    .task-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 12px;
      transition: background 0.15s;
    }
    .task-item:hover { background: var(--bg); }
    .task-item.active { background: var(--brand-soft); }
    .task-item .task-icon { font-size: 14px; }
    .task-item .task-title {
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: var(--ink-2);
    }
    .task-item.active .task-title { color: var(--brand); }
    .task-item .task-bridge { color: var(--brand); font-size: 12px; margin-left: 2px; flex-shrink: 0; }
    .task-item .task-actions {
      display: none;
      gap: 4px;
      font-size: 11px;
    }
    .task-item:hover .task-actions { display: flex; }
    .task-item .task-actions button {
      padding: 2px 4px;
      border: none;
      background: transparent;
      cursor: pointer;
      border-radius: 4px;
      font-size: 10px;
    }
    .task-item .task-actions button:hover { background: var(--border); }
    .task-item .task-actions .delete-btn:hover { background: #fee2e2; color: var(--err); }
    .task-item .task-actions .stop-btn:hover { background: #fff3cd; color: var(--warn); }
    .task-pinned { color: var(--warn); }
    /* 触屏设备无 hover：任务操作按钮（置顶/停止/删除）始终可见，否则手机上无法停止/删除任务 */
    @media (hover: none) {
      .task-item .task-actions { display: flex; }
    }

    /* ========== 涓棿瀵硅瘽鍖?========== */
    .chat-area {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
      background: var(--bg);
    }

    /* ========== 浠诲姟涓婁笅鏂囧ご閮?========== */
    .task-context-header {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      background: var(--card);
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .tch-left { flex: 1; min-width: 0; }
    .tch-title { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tch-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tch-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
    .tch-time { font-size: 12px; color: var(--muted); }

    /* ========== 鎬濈淮閾捐矾绾跨▼ ========== */
    .messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; padding-right: 4px; }
    .step { max-width: 92%; font-size: 13.5px; line-height: 1.6; word-break: break-word; }
    .step.created {
      align-self: stretch; background: var(--bg); border: 1px dashed var(--border);
      border-radius: 10px; padding: 8px 12px; color: var(--muted); font-size: 12.5px;
    }
    .step.reasoning {
      align-self: flex-start; background: var(--card); border: 1px solid var(--border);
      border-left: 3px solid var(--brand); border-radius: 10px; padding: 10px 14px;
      white-space: pre-wrap; color: var(--ink-2);
    }
    .step.reasoning .reasoning-head { font-size: 11px; color: var(--brand); font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
    .step.toolcall {
      align-self: flex-start; background: #fffbeb; border: 1px solid #fde68a;
      border-radius: 10px; padding: 8px 12px; color: #92400e; font-size: 12.5px;
    }
    .dark .step.toolcall { background: #3a2f12; color: #fcd34d; border-color: #5b4a1f; }
    .step.toolcall .tc-name { font-weight: 600; }
    .step.toolcall .tc-args {
      color: var(--muted); font-size: 12px; margin-top: 2px; white-space: pre-wrap; word-break: break-word;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    }
    .step.result {
      align-self: flex-start; background: var(--card); border: 1px solid var(--border);
      border-radius: 10px; padding: 8px 12px; color: var(--ink-2); font-size: 12.5px; max-width: 92%;
    }
    .step.result .res-head { font-weight: 600; display: flex; align-items: center; gap: 6px; }
    .step.result.ok .res-head { color: var(--ok); }
    .step.result.fail .res-head { color: var(--err); }
    .step.result .res-out {
      margin-top: 4px; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow-y: auto;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; color: var(--muted);
    }
    .step.note { align-self: stretch; background: var(--bg); border-radius: 8px; padding: 6px 12px; color: var(--muted); font-size: 12px; }
    /* 瀵硅瘽娴佷笌鎬濈淮閾捐矾鍒嗛殧鏍囬 */
    .conv-divider {
      align-self: stretch; text-align: center; font-size: 11px; color: var(--muted);
      border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px;
    }
    .step.final {
      align-self: flex-end; background: var(--ok); color: #fff; border-radius: 12px;
      padding: 12px 16px; white-space: pre-wrap; word-break: break-word; max-width: 92%;
      position: relative;
    }
    .step.final .final-head { font-size: 11px; opacity: 0.85; margin-bottom: 4px; font-weight: 600; }
    .step.final .final-actions {
      position: absolute; top: 8px; right: 8px; display: flex; gap: 4px;
      opacity: 0.85; transition: opacity 0.2s;
      background: rgba(0,0,0,0.18); border-radius: 8px; padding: 2px 4px;
    }
    .step.final:hover .final-actions { opacity: 1; background: rgba(0,0,0,0.32); }
    .step.final .final-actions button {
      background: transparent; border: none; color: #fff;
      border-radius: 4px; padding: 3px 7px; font-size: 11px; cursor: pointer;
      transition: background 0.15s;
    }
    .step.final .final-actions button:hover { background: rgba(255,255,255,0.28); }
    .step.error {
      align-self: flex-end; background: var(--err); color: #fff; border-radius: 12px;
      padding: 12px 16px; white-space: pre-wrap; word-break: break-word; max-width: 92%;
    }

    /* 瀵硅瘽娑堟伅鍖?*/
    .conv {
      flex: 1;
      display: flex;
      flex-direction: column;
      padding: 16px;
      gap: 12px;
      overflow: hidden;
    }
    .messages {
      flex: 1;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding-right: 4px;
    }
    .msg {
      padding: 10px 14px;
      border-radius: 12px;
      font-size: 13.5px;
      line-height: 1.6;
      max-width: 85%;
      white-space: pre-wrap;
      word-break: break-word;
      position: relative;
      user-select: text;
      -webkit-user-select: text;
      cursor: text;
    }
    .msg-actions {
      position: absolute;
      bottom: 4px;
      right: 8px;
      display: flex;
      gap: 4px;
      background: rgba(255,255,255,0.92);
      border-radius: 6px;
      padding: 2px 4px;
      box-shadow: 0 1px 6px rgba(0,0,0,0.08);
      opacity: 0.35;
      transition: opacity 0.2s ease;
      user-select: none;
      z-index: 2;
    }
    .msg:hover .msg-actions {
      opacity: 1;
    }
    .msg-action-btn {
      background: none;
      border: none;
      padding: 5px 10px;
      font-size: 12px;
      cursor: pointer;
      border-radius: 4px;
      color: var(--ink-2);
      white-space: nowrap;
    }
    .msg-action-btn:hover {
      background: var(--brand-soft);
      color: var(--brand);
    }
    .msg.user {
      background: var(--brand-soft);
      align-self: flex-end;
    }
    .msg.assistant {
      background: var(--card);
      border: 1px solid var(--border);
      align-self: flex-start;
    }
    /* ========== 鎬濊€冭繃绋嬫皵娉★紙Cursor 椋庢牸锛?========== */
    .msg.assistant.thinking-msg {
      background: var(--card);
      border: 1px solid var(--border);
      border-left: 3px solid var(--brand);
      position: relative;
      padding: 10px 12px;
    }
    .thinking-header {
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      user-select: none;
      padding: 2px 0;
      border-radius: 4px;
      transition: background 0.15s;
    }
    .thinking-header:hover {
      background: var(--brand-soft);
    }
    .thinking-arrow {
      font-size: 10px;
      color: var(--ink-2);
      transition: transform 0.2s;
      flex-shrink: 0;
      width: 14px;
      text-align: center;
    }
    .thinking-label {
      font-size: 12px;
      font-weight: 600;
      color: var(--ink);
      flex-shrink: 0;
    }
    .thinking-summary {
      font-size: 11px;
      color: var(--muted);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .thinking-body {
      margin-top: 8px;
      border-top: 1px solid var(--line);
      padding-top: 6px;
    }
    .thinking-step {
      display: flex;
      align-items: flex-start;
      gap: 6px;
      padding: 3px 0;
      font-size: 12px;
      color: var(--ink-2);
      line-height: 1.5;
    }
    .thinking-step-icon {
      flex-shrink: 0;
      width: 16px;
      text-align: center;
      font-size: 11px;
    }
    .thinking-step-text {
      flex: 1;
      word-break: break-word;
    }
    .thinking-step-text code {
      font-size: 11px;
      background: var(--brand-soft);
      padding: 1px 4px;
      border-radius: 3px;
      color: var(--brand);
    }
    .thinking-step-detail {
      font-size: 11px;
      color: var(--muted);
      cursor: pointer;
      margin-left: 22px;
      padding: 1px 6px;
      border-radius: 3px;
      background: var(--bg);
      display: inline-block;
    }
    .thinking-step-detail:hover {
      background: var(--brand-soft);
    }
    .thinking-args {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 11px;
      color: var(--muted);
      margin: 4px 0 4px 22px;
      padding: 6px 8px;
      background: var(--bg);
      border-radius: 4px;
      overflow-x: auto;
      white-space: pre-wrap;
      word-break: break-all;
      display: none;
    }
    .thinking-args.show {
      display: block;
    }
    .thinking-reply {
      font-size: 13px;
      line-height: 1.7;
      color: var(--ink);
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid var(--line);
    }
    /* 鎬濊€冧腑鐘舵€佹寚绀?*/
    .thinking-indicator {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 4px 0;
      font-size: 12px;
      color: var(--ink-2);
    }
    @keyframes pulse-dot {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.3; }
    }
    .thinking-indicator .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--brand);
      animation: pulse-dot 1.2s infinite;
    }
    .thinking-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
    .thinking-indicator .dot:nth-child(3) { animation-delay: 0.4s; }
    .dark .msg.assistant { background: #1e293b; }
    .msg.sys {
      background: #f1f5f9;
      align-self: flex-start;
      color: var(--ink-2);
    }
    .dark .msg.sys { background: #334155; }
    .msg .artifact { color: var(--brand); text-decoration: underline; cursor: pointer; }
    /* 鍐呴儴鎵ц杩囩▼锛氶粯璁ゆ姌鍙狅紝閬垮厤"涓€鐩撮兘鍦ㄨ皟鐢?楠岃瘉"鐨勫櫔澹帮紱鐐瑰嚮灞曞紑鏌ョ湅鎬濊€冧笌宸ュ叿璋冪敤 */
    .proc-details {
      align-self: stretch; margin-top: 6px; border-top: 1px dashed var(--line);
      padding: 8px 0 2px; display: flex; flex-direction: column; gap: 8px;
    }
    .proc-summary {
      cursor: pointer; font-size: 12px; color: var(--muted); user-select: none;
      padding: 4px 6px; border-radius: 6px; background: var(--card);
      border: 1px solid var(--border); width: fit-content;
    }
    .proc-summary:hover { color: var(--brand); border-color: var(--brand); }
    .proc-details[open] .proc-summary { color: var(--brand); margin-bottom: 6px; }
    .final-msg { border-left: 3px solid var(--ok); align-self: flex-start; }
    .error-msg { border-left: 3px solid var(--err); align-self: flex-start; color: var(--err); }
    .msg .artifact:hover { opacity: 0.8; }

    /* 杈撳叆鏍?*/
    .input-area {
      padding: 0 16px 16px;
      flex-shrink: 0;
    }
    .input-bar {
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 12px;
      background: var(--card);
      box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    }
    .input-bar textarea {
      width: 100%;
      border: none;
      margin: 0;
      min-height: 60px;
      resize: none;
      background: transparent;
      color: var(--ink);
      font-size: 14px;
      font-family: inherit;
    }
    .input-bar textarea:focus { outline: none; }
    .input-toolbar {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 10px;
      flex-wrap: wrap;
    }
    .input-toolbar .spacer { flex: 1; }
.conn-pill {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: #eef2f7; color: var(--muted); border: 1px solid transparent;
  transition: all .2s; white-space: nowrap;
}
.conn-pill:hover { border-color: var(--brand); }
.conn-pill.off { background: #eef2f7; color: #98a2b3; }
.conn-pill.local { background: rgba(16,185,129,.12); color: #10b981; }
.conn-pill.cloud { background: rgba(59,130,246,.12); color: #3b82f6; }

    .pill {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 5px 10px;
      font-size: 12.5px;
      background: var(--card);
      color: var(--ink-2);
      cursor: pointer;
      user-select: none;
    }
    .pill:hover { border-color: var(--brand); }
    .voice-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--err); font-size: 12px; }

    /* 宸ヤ綔鍖烘潯 */
    .workspace-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 0;
      font-size: 13px;
      color: var(--muted);
    }
    .wb-select {
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      padding: 5px 10px;
      border-radius: 8px;
      background: var(--bg);
      border: 1px solid var(--border);
      font-size: 13px;
      color: var(--ink);
      max-width: 320px;
      transition: border-color 0.15s;
    }
    .wb-select:hover { border-color: var(--brand); }
    .wb-icon { font-size: 15px; }
    .wb-label {
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .wb-arrow { font-size: 10px; color: var(--muted); }
    .wb-perm {
      display: flex;
      align-items: center;
      gap: 5px;
      cursor: pointer;
      padding: 5px 10px;
      border-radius: 8px;
      background: var(--bg);
      border: 1px solid var(--border);
      font-size: 13px;
      color: var(--ink);
      transition: border-color 0.15s;
    }
    .wb-perm:hover { border-color: var(--brand); }
    .wb-mode {
      display: flex;
      align-items: center;
      gap: 5px;
      cursor: pointer;
      padding: 5px 10px;
      border-radius: 8px;
      background: var(--bg);
      border: 1px solid var(--border);
      font-size: 13px;
      color: var(--ink);
      transition: border-color 0.15s, background 0.15s;
      user-select: none;
    }
    .wb-mode:hover { border-color: var(--brand); }
    .wb-mode.autonomous {
      border-color: #f59e0b;
      background: rgba(245, 158, 11, 0.08);
      color: #d97706;
    }
    .wb-mode.autonomous:hover { border-color: #f59e0b; background: rgba(245, 158, 11, 0.15); }

    /* 閫氳瘽鏍?*/
    .call-bar {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 0;
      border-top: 1px solid var(--border);
      margin-top: 8px;
    }
    .call-hint { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
    .call-btn {
      border: 1px solid var(--border);
      background: var(--brand-soft);
      color: var(--brand);
      border-radius: 8px;
      padding: 7px 12px;
      cursor: pointer;
      font-size: 13px;
      font-weight: 600;
    }
    .call-btn:hover { filter: brightness(0.97); }
    .call-btn.hangup { background: #fee2e2; color: var(--err); border-color: #fecaca; }
    .call-status { font-size: 12px; color: var(--muted); margin-left: auto; }

    /* 瑙嗛閫氳瘽绐楀彛 */
    .video-call-window {
      position: fixed;
      bottom: 100px;
      right: 20px;
      width: 240px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
      box-shadow: 0 8px 32px rgba(0,0,0,0.2);
      z-index: 100;
    }
    .video-call-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 8px 12px;
      background: var(--brand);
      color: #fff;
      font-size: 13px;
      font-weight: 600;
    }
    .video-call-close {
      background: none;
      border: none;
      color: #fff;
      cursor: pointer;
      font-size: 14px;
      padding: 0;
      line-height: 1;
    }
    .video-call-snapshot {
      background: rgba(255,255,255,0.2);
      border: none;
      color: #fff;
      cursor: pointer;
      font-size: 14px;
      padding: 2px 6px;
      border-radius: 4px;
      line-height: 1;
    }
    .video-call-snapshot:hover { background: rgba(255,255,255,0.35); }
    .video-call-window video {
      width: 100%;
      display: block;
      background: #000;
    }

    /* 搴曢儴宸ュ叿鏍?*/
    .chat-footbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 8px 16px;
      background: var(--card);
      border-top: 1px solid var(--border);
      font-size: 13px;
    }
    .model-label { font-size: 13px; color: var(--muted); }
    .sync-exec-end {
      font-size: 12px; font-weight: 600;
      padding: 4px 10px; border-radius: 999px;
      background: var(--brand-soft); color: var(--brand);
      border: 1px solid rgba(51,112,255,.16);
      white-space: nowrap; flex-shrink: 0;
    }
    .model-select {
      padding: 6px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--card);
      color: var(--ink);
      font-size: 13px;
    }
    .ghost-btn {
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--ink-2);
      border-radius: 8px;
      padding: 6px 9px;
      cursor: pointer;
      font-size: 14px;
    }
    .ghost-btn:hover { background: var(--brand-soft); }

    /* 鏂板缓浠诲姟鎸夐挳锛堜晶杈规爮锛?*/
    .new-task-btn {
      border: 1px solid var(--border);
      background: var(--brand);
      color: #fff;
      border-radius: 8px;
      padding: 3px 8px;
      cursor: pointer;
      font-size: 11px;
      font-weight: 600;
      line-height: 1.6;
    }
    .new-task-btn:hover { opacity: 0.88; }

    /* 鏂板缓瀵硅瘽浠诲姟寮圭獥 */
    .nt-form { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
    .nt-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 4px; }
    .nt-form textarea, .nt-form select {
      width: 100%; box-sizing: border-box; padding: 8px 10px; font-size: 13px;
      border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
      color: var(--ink); resize: vertical; font-family: inherit;
    }
    .nt-form select { cursor: pointer; }
    .nt-row { display: flex; gap: 12px; }
    .nt-row > div { flex: 1; }
    .nt-hint { font-size: 12px; color: var(--muted); }

    /* ========== 鍙充晶闈㈡澘 ========== */
    .right-panel {
      width: 320px;
      background: var(--card);
      border-left: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      overflow: hidden;
    }
    .right-panel.collapsed { width: 0; border: none; }
    .right-tabs {
      display: flex;
      gap: 4px;
      padding: 12px 12px 0;
      border-bottom: 1px solid var(--line);
    }
    .right-tab {
      padding: 8px 14px;
      font-size: 13px;
      color: var(--muted);
      cursor: pointer;
      border-bottom: 2px solid transparent;
    }
    .right-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
    .right-body { flex: 1; overflow-y: auto; padding: 12px; }
    .preview-panel { display: none; }
    .preview-panel.active { display: block; }
    .preview-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
    .preview-content {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px;
      font-size: 12.5px;
      overflow-x: auto;
    }
    .preview-content pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

    /* 鐢佃剳鎿嶄綔闈㈡澘 */
    .computer-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
    .screen-preview {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
      margin-bottom: 12px;
      min-height: 150px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .screen-preview img { width: 100%; height: auto; display: block; cursor: crosshair; }
    .computer-actions {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 10px;
    }
    .computer-actions .pill {
      padding: 5px 10px;
      font-size: 12px;
      border: 1px solid var(--border);
      background: var(--card);
      border-radius: 6px;
      cursor: pointer;
    }
    .computer-actions .pill:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

    /* 浠诲姟璇︽儏 */
    .detail-ops {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-bottom: 14px;
    }
    .detail-ops .secondary {
      border: 1px solid var(--border);
      background: var(--brand-soft);
      color: var(--brand);
      border-radius: 8px;
      padding: 7px 11px;
      cursor: pointer;
      font-size: 12.5px;
      font-weight: 600;
    }
    .detail-ops .secondary:hover { filter: brightness(0.97); }
    .artifact-list { display: flex; flex-direction: column; gap: 4px; }
    .artifact-file {
      padding: 6px 8px;
      border: 1px solid var(--border);
      border-radius: 6px;
      font-size: 12.5px;
      color: var(--ink-2);
      cursor: pointer;
      background: var(--bg);
    }
    .artifact-file:hover { background: var(--brand-soft); color: var(--brand); }

    /* ========== 鍔熻兘椤甸潰 ========== */
    .page-view {
      flex: 1;
      display: none;
      flex-direction: column;
      padding: 24px;
      overflow-y: auto;
    }
    .page-view.active { display: flex; }
    .page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
    .page-head h2 { margin: 0; font-size: 20px; }
    .page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
    .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
    .tile {
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px;
      cursor: pointer;
      background: var(--card);
      transition: all 0.15s;
    }
    .tile:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(37,99,235,0.12); }
    .tile .icon { font-size: 24px; }
    .tile .title { font-weight: 600; margin: 8px 0 4px; font-size: 14px; }
    .tile .desc { color: var(--muted); font-size: 12px; line-height: 1.5; }
    .tile .ops { display: flex; gap: 6px; margin-top: 12px; }
    .tile .ops button { padding: 6px 12px; font-size: 12px; flex: 1; }
    /* 棰勭疆鎸囦护鍗＄墖锛氬甫娓愬彉杈规锛屽拰鐢ㄦ埛鑷畾涔夊尯鍒?*/
    .tile.builtin-tile {
      background: linear-gradient(135deg, var(--card) 0%, rgba(37,99,235,0.03) 100%);
      border: 1px solid var(--brand-soft);
    }
    .tile.builtin-tile:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(37,99,235,0.15); }
    .tile.builtin-tile .ops { flex-wrap: wrap; }
    .tile.builtin-tile .ops button { flex: 1 1 auto; }

    /* ========== 浜у搧鍙戝竷鏁呬簨椤甸潰 ========== */
    .release-container { max-width: 900px; margin: 0 auto; }
    .release-hero {
      text-align: center;
      padding: 48px 24px;
      background: linear-gradient(135deg, var(--brand-soft) 0%, rgba(37,99,235,0.08) 100%);
      border-radius: 20px;
      margin-bottom: 40px;
    }
    .release-badge {
      display: inline-block;
      padding: 6px 16px;
      background: var(--brand);
      color: #fff;
      border-radius: 20px;
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 16px;
    }
    .release-title {
      font-size: 48px;
      font-weight: 800;
      margin: 0 0 12px;
      background: linear-gradient(135deg, var(--brand), #6366f1);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    .release-subtitle {
      font-size: 18px;
      color: var(--ink-2);
      margin: 0 0 8px;
    }
    .release-tagline {
      font-size: 16px;
      color: var(--muted);
      font-style: italic;
      margin: 16px 0 32px;
    }
    .release-stats {
      display: flex;
      justify-content: center;
      gap: 32px;
      flex-wrap: wrap;
    }
    .stat-item {
      text-align: center;
    }
    .stat-num {
      display: block;
      font-size: 28px;
      font-weight: 700;
      color: var(--brand);
    }
    .stat-label {
      font-size: 12px;
      color: var(--muted);
    }
    .section-title {
      font-size: 28px;
      font-weight: 700;
      margin: 48px 0 24px;
      text-align: center;
    }
    .release-timeline { margin-bottom: 48px; }
    .timeline {
      position: relative;
      padding-left: 40px;
    }
    .timeline::before {
      content: '';
      position: absolute;
      left: 15px;
      top: 0;
      bottom: 0;
      width: 2px;
      background: linear-gradient(to bottom, var(--brand), var(--brand-soft));
    }
    .timeline-item {
      position: relative;
      margin-bottom: 32px;
    }
    .timeline-dot {
      position: absolute;
      left: -32px;
      top: 4px;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: var(--brand-soft);
      border: 2px solid var(--brand);
    }
    .timeline-dot.active {
      background: var(--brand);
      box-shadow: 0 0 0 4px rgba(37,99,235,0.2);
    }
    .timeline-date {
      font-size: 13px;
      color: var(--brand);
      font-weight: 600;
      margin-bottom: 4px;
    }
    .timeline-content h3 {
      margin: 0 0 8px;
      font-size: 18px;
    }
    .timeline-content p {
      color: var(--ink-2);
      line-height: 1.6;
      margin: 0 0 8px;
    }
    .timeline-quote {
      font-style: italic;
      color: var(--muted);
      border-left: 3px solid var(--brand-soft);
      padding-left: 12px;
      margin: 12px 0;
    }
    .timeline-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
    .tag {
      padding: 4px 10px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 12px;
      font-size: 11px;
      color: var(--muted);
    }
    .release-team { margin-bottom: 48px; }
    .team-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 20px;
    }
    .team-card {
      text-align: center;
      padding: 24px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 16px;
    }
    .team-avatar { font-size: 48px; margin-bottom: 12px; }
    .team-card h3 { margin: 0 0 8px; font-size: 16px; }
    .team-card p { color: var(--ink-2); font-size: 13px; line-height: 1.5; margin: 0 0 12px; }
    .team-role {
      font-size: 12px;
      color: var(--brand);
      font-weight: 600;
    }
    .release-challenges { margin-bottom: 48px; }
    .challenges-list { display: flex; flex-direction: column; gap: 16px; }
    .challenge-item {
      display: flex;
      gap: 16px;
      padding: 20px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
    }
    .challenge-icon { font-size: 28px; flex-shrink: 0; }
    .challenge-item h4 { margin: 0 0 4px; font-size: 15px; }
    .challenge-item p { color: var(--ink-2); font-size: 13px; margin: 0; }
    .release-features { margin-bottom: 48px; }
    .features-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 16px;
    }
    .feature-card {
      text-align: center;
      padding: 24px 16px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      transition: all 0.15s;
    }
    .feature-card:hover {
      border-color: var(--brand);
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(37,99,235,0.12);
    }
    .feature-icon { font-size: 32px; margin-bottom: 12px; }
    .feature-card h4 { margin: 0 0 6px; font-size: 14px; }
    .feature-card p { color: var(--muted); font-size: 12px; margin: 0; }
    .release-quote {
      text-align: center;
      padding: 40px 24px;
      background: linear-gradient(135deg, var(--brand-soft), rgba(99,102,241,0.1));
      border-radius: 16px;
      margin-bottom: 48px;
    }
    .release-quote blockquote {
      font-size: 20px;
      font-style: italic;
      color: var(--ink);
      margin: 0 0 16px;
      line-height: 1.6;
    }
    .release-quote cite {
      font-size: 14px;
      color: var(--muted);
    }
    .release-cta {
      text-align: center;
      padding: 48px 24px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 20px;
    }
    .release-cta h2 { margin: 0 0 24px; font-size: 28px; }
    .cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
    .cta-btn {
      display: inline-block;
      padding: 12px 28px;
      border-radius: 10px;
      font-size: 15px;
      font-weight: 600;
      text-decoration: none;
      transition: all 0.15s;
    }
    .cta-btn.primary {
      background: var(--brand);
      color: #fff;
    }
    .cta-btn.primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
    .cta-btn.secondary {
      background: transparent;
      color: var(--brand);
      border: 2px solid var(--brand);
    }
    .cta-btn.secondary:hover { background: var(--brand-soft); }
    .cta-sub { color: var(--muted); font-size: 13px; }

    /* ========== 閫氱敤鏍峰紡 ========== */
    .card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 20px;
      box-shadow: 0 8px 24px rgba(31,41,51,0.06);
    }
    label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
    input[type="text"], textarea, select {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px 12px;
      font-size: 14px;
      font-family: inherit;
      margin-bottom: 12px;
      background: var(--card);
      color: var(--ink);
    }
    textarea { min-height: 80px; resize: vertical; }
    button {
      border: none;
      background: var(--brand);
      color: #fff;
      border-radius: 10px;
      padding: 9px 16px;
      font-size: 14px;
      cursor: pointer;
    }
    button:hover { filter: brightness(1.05); }
    button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--border); }
    button.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--border); }
    button.danger { background: var(--err); }
    button:disabled { opacity: 0.5; cursor: not-allowed; }
    .row { display: flex; gap: 8px; }
    .row > * { flex: 1; }
    .muted { color: var(--muted); font-size: 12.5px; }
    .empty { color: var(--muted); font-size: 13px; text-align: center; padding: 18px; }
    .badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
    .badge.queued { background: #eef2f7; color: var(--muted); }
    .badge.running { background: var(--brand-soft); color: var(--brand); }
    .badge.done { background: #f0fdf4; color: var(--ok); }
    .badge.failed { background: #fef2f2; color: var(--err); }

    /* ========== 妯℃€佹 ========== */
    .mask {
      position: fixed;
      inset: 0;
      background: rgba(15,23,42,0.45);
      z-index: 60;
      display: none;
      align-items: center;
      justify-content: center;
    }
    .mask.show { display: flex; }
    .modal {
      background: var(--card);
      border-radius: 16px;
      padding: 24px;
      width: 520px;
      max-width: 92vw;
      max-height: 88vh;
      overflow-y: auto;
      box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    }
    .modal h3 { margin: 0 0 6px; font-size: 18px; }
    .modal .hint { color: var(--muted); font-size: 12.5px; margin: 0 0 16px; }
    .modal .footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
    .close-x { float: right; cursor: pointer; color: var(--muted); font-size: 18px; }

    /* ========== 涓嬫媺鑿滃崟 ========== */
    .dropdown { position: relative; }
    .dropdown-menu {
      position: absolute;
      bottom: 100%;
      left: 0;
      margin-bottom: 6px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.12);
      min-width: 180px;
      display: none;
      z-index: 55;
      padding: 6px 0;
    }
    .dropdown-menu.show { display: block; }
    .dropdown-item { padding: 9px 14px; font-size: 13px; color: var(--ink-2); cursor: pointer; display: flex; align-items: center; gap: 8px; }
    .dropdown-item:hover { background: var(--bg); }
    .dropdown-divider { height: 1px; background: var(--line); margin: 6px 0; }

    /* ========== 鏉冮檺绐楀彛 ========== */
    .perm-section { margin-bottom: 14px; }
    .perm-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
    .perm-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
    .perm-row input[type="checkbox"] { width: auto; margin: 0; }
    .perm-row label { margin: 0; color: var(--ink-2); }

    /* ========== 鏅鸿兘浣撻€夋嫨 ========== */
    .agent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .agent-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; text-align: center; cursor: pointer; }
    .agent-card:hover, .agent-card.selected { border-color: var(--brand); background: var(--brand-soft); }
    .agent-card .icon { font-size: 24px; }
    .agent-card .title { font-size: 13px; font-weight: 600; margin-top: 6px; }

    /* ========== 澶фā鍨嬬鐞?========== */
    .model-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-height: 200px; overflow-y: auto; }
    .model-item {
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      gap: 10px;
      background: var(--bg);
    }
    .model-item .mi-name { font-weight: 600; color: var(--ink); font-size: 13px; }
    .model-item .mi-base { font-size: 11px; color: var(--muted); word-break: break-all; }
    .model-item .mi-default { font-size: 11px; color: var(--ok); border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 6px; padding: 1px 6px; }
    .model-item .mi-actions { margin-left: auto; display: flex; gap: 6px; }
    .model-item .mi-actions button {
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--ink-2);
      border-radius: 6px;
      padding: 4px 8px;
      cursor: pointer;
      font-size: 12px;
    }
    .model-item .mi-actions button:hover { background: var(--brand-soft); }
    .model-item .mi-actions button.danger { color: var(--err); }
    .model-form { border-top: 1px solid var(--line); padding-top: 14px; }
    .form-row { display: flex; gap: 10px; }
    .form-row .form-field { flex: 1; }
    .form-field { margin-bottom: 10px; }
    .form-field label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 5px; }
    .form-field input {
      width: 100%;
      padding: 8px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--card);
      color: var(--ink);
      font-size: 13px;
      box-sizing: border-box;
      margin: 0;
    }
    .form-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
    .model-form-msg { font-size: 12px; color: var(--ok); }
    .model-form-msg.err { color: var(--err); }
    .primary { background: var(--brand); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 600; }
    .ghost { background: var(--card); color: var(--ink-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 13px; }
    .primary.sm, .ghost.sm { padding: 5px 12px; font-size: 12px; }

    /* ========== 璁剧疆闈㈡澘 ========== */
    .settings-layout { display: flex; gap: 0; min-height: 360px; }
    .settings-nav { flex: 0 0 130px; border-right: 1px solid var(--line); padding-right: 8px; }
    .settings-cat { padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
    .settings-cat:hover { background: var(--bg); }
    .settings-cat.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
    .settings-body { flex: 1; padding: 4px 4px 4px 16px; overflow-y: auto; }
    .settings-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 10px;
      margin-bottom: 10px;
      cursor: pointer;
      background: var(--card);
    }
    .settings-item:hover { background: var(--brand-soft); }
    .settings-item .si-icon { font-size: 18px; }
    .settings-item .si-main { flex: 1; }
    .settings-item .si-title { font-weight: 600; font-size: 13.5px; color: var(--ink); }
    .settings-item .si-desc { font-size: 12px; color: var(--muted); }
    .settings-item .si-arrow { color: var(--muted); }

    /* ========== 璁剧疆路澶фā鍨嬬鐞嗭紙绠€娲佸崱鐗囬锛?========== */
    .model-manage { margin-top: 4px; }
    .mm-list { display: flex; flex-direction: column; gap: 8px; }
    .mm-empty {
      padding: 28px 16px;
      text-align: center;
      color: var(--muted);
      font-size: 13px;
      background: var(--bg);
      border: 1px dashed var(--border);
      border-radius: 10px;
    }
    .mm-empty .mm-empty-icon { font-size: 28px; margin-bottom: 6px; opacity: 0.6; }
    .mm-empty .mm-empty-hint { font-size: 12px; margin-top: 4px; color: var(--muted); }
    .mm-card {
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: 12px 14px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--card);
      transition: border-color 0.15s;
    }
    .mm-card:hover { border-color: var(--brand); }
    .mm-card-head { display: flex; align-items: center; gap: 8px; }
    .mm-card-name { font-weight: 600; font-size: 14px; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mm-default-tag {
      font-size: 11px;
      padding: 1px 7px;
      border-radius: 99px;
      background: var(--brand-soft);
      color: var(--brand);
      font-weight: 500;
      flex: 0 0 auto;
    }
    .mm-card-url {
      font-size: 12px;
      color: var(--muted);
      word-break: break-all;
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .mm-card-url::before { content: '馃敆'; font-size: 11px; opacity: 0.7; }
    .mm-card-meta { font-size: 11px; color: var(--muted); }
    .mm-card-actions {
      display: flex;
      gap: 4px;
      justify-content: flex-end;
      margin-top: 2px;
      border-top: 1px solid var(--line);
      padding-top: 8px;
    }
    .mm-act {
      font-size: 12px;
      padding: 4px 10px;
      border-radius: 6px;
      background: transparent;
      border: 1px solid var(--border);
      color: var(--ink-2);
      cursor: pointer;
      transition: all 0.15s;
    }
    .mm-act:hover { background: var(--bg); color: var(--ink); }
    .mm-act-primary { color: var(--brand); border-color: var(--brand-soft); }
    .mm-act-primary:hover { background: var(--brand-soft); }
    .mm-act-danger { color: var(--muted); }
    .mm-act-danger:hover { color: var(--err); background: transparent; }
    /* 鍒嗛殧 */
    .mm-divider {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 16px 0 10px;
      font-size: 12px;
      color: var(--muted);
    }
    .mm-divider::before, .mm-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--line);
    }
    /* 琛ㄥ崟 */
    .mm-form {
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 14px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--bg);
    }
    .mm-form-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
    .mm-form input, .mm-form textarea {
      margin: 0;
      padding: 8px 10px;
      font-size: 13px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--card);
      transition: border-color 0.15s;
    }
    .mm-form input:focus, .mm-form textarea:focus {
      outline: none;
      border-color: var(--brand);
    }
    .mm-form textarea { resize: vertical; min-height: 56px; font-family: inherit; }
    .mm-form-actions { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
    .mm-form-actions .mm-form-msg { font-size: 12px; color: var(--muted); margin-left: auto; }
    .mm-form-actions .mm-form-msg.err { color: var(--err); }

    /* ========== 鐢ㄦ埛鑿滃崟锛堝彸渚т晶杈规爮鏍峰紡锛?========== */
    .bottom-sheet-mask {
      position: fixed;
      inset: 0;
      background: rgba(15,23,42,0.35);
      z-index: 70;
      display: none;
      justify-content: flex-end;
    }
    .bottom-sheet-mask.show { display: flex; }
    .bottom-sheet {
      background: var(--card);
      border-radius: 16px 0 0 16px;
      width: 280px;
      max-width: 85vw;
      max-height: 100vh;
      overflow-y: auto;
      padding: 16px 0;
      box-shadow: -10px 0 40px rgba(0,0,0,0.15);
      transform: translateX(100%);
      transition: transform 0.25s ease;
    }
    .bottom-sheet-mask.show .bottom-sheet { transform: translateX(0); }
    .sheet-header { padding: 8px 20px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
    .sheet-item { padding: 12px 20px; display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
    .sheet-item:hover { background: var(--bg); }
    .sheet-item .icon { width: 22px; text-align: center; }
    .sheet-item .right { margin-left: auto; font-size: 12px; color: var(--muted); }

    /* ========== 宸ヤ綔鍖?========== */
    .workspace-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--bg); }
    .workspace-cwd { font-size: 12px; color: var(--ink-2); word-break: break-all; margin-bottom: 8px; }
    .workspace-input { display: flex; gap: 6px; }
    .workspace-input input { flex: 1; margin: 0; font-size: 12px; padding: 6px 8px; }
    .workspace-input button { padding: 6px 10px; font-size: 12px; }
    .file-tree { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
    .file-item { padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
    .file-item:hover { background: var(--brand-soft); }
    .file-item.dir { font-weight: 500; }
    .file-item.drive-switcher { flex-direction: column; align-items: flex-start; padding: 8px; background: var(--bg); border: 1px dashed var(--border); }
    .drive-option { padding: 3px 10px; margin-top: 4px; border-radius: 4px; font-size: 11px; cursor: pointer; color: var(--ink-2); }
    .drive-option:hover { background: var(--brand-soft); color: var(--brand); }

    /* ========== 鏂囦欢鑺墖 ========== */
    .file-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand); padding: 4px 8px; border-radius: 6px; font-size: 12px; cursor: pointer; }
    .file-chip:hover { opacity: 0.85; }
    /* 杈撳叆鍖郝峰緟鍙戦€侀檮浠舵殏瀛橈紙鐐瑰彂閫佹椂缁熶竴涓婁紶缁?AI锛?*/
    .staged-area {
      display: none;
      flex-wrap: wrap;
      gap: 6px;
      padding: 0 0 8px 0;
      border-bottom: 1px dashed var(--border);
      margin-bottom: 8px;
    }
    .staged-area.show { display: flex; }
    .staged-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 4px 4px 8px;
      background: var(--brand-soft);
      color: var(--brand);
      border-radius: 6px;
      font-size: 12px;
      max-width: 240px;
    }
    .staged-chip .staged-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
    .staged-chip .staged-size { color: var(--muted); font-size: 11px; }
    .staged-chip .staged-remove {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: transparent;
      border: none;
      color: var(--brand);
      cursor: pointer;
      font-size: 14px;
      line-height: 1;
      padding: 0;
    }
    .staged-chip .staged-remove:hover { background: rgba(0,0,0,.08); }
    .staged-hint {
      font-size: 11px;
      color: var(--muted);
      align-self: center;
      margin-left: 4px;
    }

    /* ========== 鎴浘閬僵 ========== */
    .crop-overlay { position: fixed; inset: 0; z-index: 9999; background: #000; cursor: crosshair; }
    .crop-tip { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: #fff; padding: 8px 18px; border-radius: 20px; font-size: 13px; pointer-events: none; z-index: 10001; }
    .crop-selection { position: fixed; border: 2px dashed #00ffcc; background: rgba(0,255,204,0.08); box-shadow: 0 0 0 9999px rgba(0,0,0,0.5); pointer-events: none; z-index: 10000; display: none; }

    /* ========== Toast ========== */
    .toast {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%);
      background: #1f2933;
      color: #fff;
      padding: 10px 18px;
      border-radius: 10px;
      font-size: 13px;
      z-index: 80;
      opacity: 0;
      transition: 0.25s;
      pointer-events: none;
    }
    .toast.show { opacity: 1; }

    /* ========== 闅愯棌鏂囦欢杈撳叆 ========== */
    input[type="file"] { display: none; }

    /* ========== 璁板繂绯荤粺 ========== */
    .stat-card { text-align: center; padding: 16px; }
    .stat-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
    .stat-value { font-size: 24px; font-weight: 700; color: var(--brand); }
    .stat-date { font-size: 13px; color: var(--ink-2); font-weight: 400; }
    .memory-content { max-height: 60vh; overflow-y: auto; white-space: pre-wrap; font-family: "SF Mono", Monaco, monospace; font-size: 12.5px; line-height: 1.7; }
    .memory-content h1, .memory-content h2, .memory-content h3 { color: var(--brand); margin-top: 0; }
    .memory-content pre { background: var(--bg); padding: 12px; border-radius: 8px; overflow-x: auto; }
    .memory-content code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 12px; }

    /* ========== 娆㈣繋寮曞寮圭獥 ========== */
    #welcomeGuideModal .modal { width: 480px; }
    .welcome-guide-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
    .welcome-guide-header .icon { font-size: 32px; }
    .welcome-guide-header h3 { margin: 0; font-size: 18px; }
    .welcome-guide-header p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
    .welcome-task-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
    .welcome-task-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--bg);
      cursor: pointer;
      transition: all 0.15s;
    }
    .welcome-task-item:hover {
      border-color: var(--brand);
      background: var(--brand-soft);
    }
    .welcome-task-index {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--brand);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 700;
      flex-shrink: 0;
    }
    .welcome-task-content { flex: 1; min-width: 0; }
    .welcome-task-title { font-size: 13px; font-weight: 600; color: var(--ink); }
    .welcome-task-desc { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .welcome-task-run {
      padding: 4px 10px;
      border: 1px solid var(--brand);
      background: transparent;
      color: var(--brand);
      border-radius: 6px;
      font-size: 11px;
      cursor: pointer;
      flex-shrink: 0;
      transition: all 0.15s;
    }
    .welcome-task-run:hover {
      background: var(--brand);
      color: #fff;
    }
    .empty-welcome {
      text-align: center;
      padding: 20px;
      color: var(--muted);
      font-size: 13px;
    }

/* ========== 鍚庣鏈嶅姟鏂繛鎻愮ず妯箙 ========== */
.backend-offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(90deg, #c62828, #e53935);
  color: #fff;
  padding: 9px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  animation: bob-slide-down 0.25s ease;
}
.backend-offline-banner .bob-icon { font-size: 16px; flex-shrink: 0; }
.backend-offline-banner .bob-text { flex: 1; min-width: 0; }
.backend-offline-banner .bob-reconnect {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 3px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  transition: background 0.15s;
}
.backend-offline-banner .bob-reconnect:hover {
  background: rgba(255, 255, 255, 0.3);
}
.backend-offline-banner .bob-reconnect:active {
  transform: scale(0.96);
}
@keyframes bob-slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ========== P2-1: 璁捐绋胯浆浠ｇ爜 ========== */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.design-result-tab.active {
  background: var(--accent, #2d5a3d) !important;
  color: #fff !important;
  border-color: var(--accent, #2d5a3d) !important;
}
#designDropZone:hover {
  border-color: var(--accent, #2d5a3d);
  background: var(--card, #f5f5f5);
}


/* ===== 文字选择优化（精确选择、长按复制、不跳开） ===== */
.msg, .msg * {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}
.msg {
  cursor: text;
}
.msg ::selection, .msg::selection {
  background: rgba(79, 110, 247, 0.25);
  color: inherit;
}
.msg ::-moz-selection {
  background: rgba(79, 110, 247, 0.25);
}
/* 代码块内文字也可选择 */
pre, code, .code-block, .code-block * {
  -webkit-user-select: text !important;
  user-select: text !important;
}

/* ========== Cline 控制台页 ========== */
.cline-status-bar { margin: 4px 0 14px; padding: 10px 14px; border-radius: 8px; background: #f6f8fa; border: 1px solid #e1e4e8; font-size: 13px; color: #57606a; }
.cline-status-bar.ok { background: #e6f4ea; border-color: #b7e1c3; color: #188038; }
.cline-status-bar.warn { background: #fef7e0; border-color: #f3e2a8; color: #b26a00; }
.cline-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.cline-form textarea { width: 100%; min-height: 96px; padding: 10px 12px; border: 1px solid #d0d7de; border-radius: 8px; font-size: 14px; font-family: inherit; resize: vertical; background: #fff; }
.cline-form-row { display: flex; gap: 10px; }
.cline-form-row input { flex: 1; padding: 9px 12px; border: 1px solid #d0d7de; border-radius: 8px; font-size: 13px; }
.cline-form-row button { padding: 9px 18px; border: 0; border-radius: 8px; background: #1f6feb; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.cline-form-row button:disabled { opacity: .6; cursor: not-allowed; }
.cline-result { border: 1px solid #d0d7de; border-radius: 8px; overflow: hidden; }
.cline-result-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: #f6f8fa; border-bottom: 1px solid #e1e4e8; font-weight: 600; font-size: 13px; }
.cline-result-time { font-weight: 400; color: #6e7781; font-size: 12px; }
.cline-result pre { margin: 0; padding: 14px; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.6; max-height: 60vh; overflow: auto; background: #fff; }
/* ==========================================================
   豆包式界面主题（Doubao-style Theme Overlay）
   对标豆包桌面版：蓝紫主色 · 大圆角气泡 · 胶囊输入区 · 欢迎卡片
   晋江市飞虹智科技企业管理有限公司 · 飞扬企源研发中心 · 负责人：吴赐虹
   ========================================================== */
:root {
  --brand: #4e5bff;
  --brand-2: #7b5bff;
  --brand-soft: #eef0ff;
  --bg: #f7f8fa;
  --bubble-user: linear-gradient(135deg, #4e5bff 0%, #6a5bff 100%);
  --bubble-ai: #f5f6f8;
}
.dark {
  --brand: #6b7bff;
  --brand-soft: #2a2f55;
  --bubble-ai: #1b2333;
}

/* ---- 对话消息气泡（豆包式：用户右侧蓝紫渐变 / AI 左侧浅灰+头像） ---- */
.messages { gap: 14px; padding: 20px 24px; }
.msg { border-radius: 18px; font-size: 14px; padding: 10px 16px; }
.msg.user {
  background: var(--bubble-user);
  color: #fff;
  border-radius: 18px 18px 6px 18px;
  align-self: flex-end;
  box-shadow: 0 2px 8px rgba(78,91,255,0.18);
  max-width: 78%;
}
.msg.user .msg-actions { background: rgba(255,255,255,0.18); }
.msg.user .msg-action-btn { color: rgba(255,255,255,0.92); }
.msg.user .msg-action-btn:hover { background: rgba(255,255,255,0.24); color: #fff; }
.msg.assistant {
  background: var(--bubble-ai);
  border: none;
  border-radius: 18px 18px 18px 6px;
  align-self: flex-start;
  margin-left: 42px;
  max-width: 82%;
}
.msg.assistant::before {
  content: '虹';
  position: absolute; left: -42px; top: 0;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4e5bff, #7b5bff);
  color: #fff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(78,91,255,0.30);
}
.msg.sys {
  align-self: center; background: transparent; border: none;
  color: var(--muted); font-size: 12px; text-align: center;
  max-width: 92%; padding: 4px 12px;
}
.msg.error-msg { background: #fff2f0; border-left: 3px solid var(--err); }
.dark .msg.error-msg { background: #3a1d1d; }

/* ---- 输入区：豆包胶囊输入框 ---- */
.input-area { padding: 0 24px 20px; }
.input-bar {
  border-radius: 24px;
  border: 1.5px solid transparent;
  background: #f2f3f7;
  padding: 14px 16px 10px;
  box-shadow: 0 2px 10px rgba(31,41,51,0.04);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.input-bar:focus-within {
  background: var(--card);
  border-color: var(--brand);
  box-shadow: 0 4px 18px rgba(78,91,255,0.12);
}
.input-bar textarea { font-size: 14.5px; min-height: 56px; }
.input-toolbar { margin-top: 8px; }
.pill {
  border: none; border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px;
  background: #eef0f4; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.pill:hover { background: var(--brand-soft); color: var(--brand); }
.dark .pill { background: #262f42; }

#sendBtn {
  width: 42px; height: 42px; padding: 0;
  border: none; border-radius: 50%;
  background: linear-gradient(135deg, #4e5bff 0%, #6a5bff 100%);
  color: #fff; font-size: 19px; font-weight: 700; line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(78,91,255,0.35);
  transition: filter .15s, transform .05s, box-shadow .2s;
  display: inline-flex; align-items: center; justify-content: center;
}
#sendBtn:hover { filter: brightness(1.08); box-shadow: 0 4px 14px rgba(78,91,255,0.45); }
#sendBtn:active { transform: scale(0.94); }
#sendBtn:disabled { background: #c9cede; box-shadow: none; cursor: not-allowed; filter: none; }

/* ---- 欢迎空状态（豆包式问候 + 推荐提示词卡片） ---- */
.doubao-hero {
  align-self: center;
  margin: auto;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 30px 16px 10px; max-width: 560px; width: 100%;
  text-align: center;
}
.doubao-hero .hero-logo {
  width: 56px; height: 56px; border-radius: 18px;
  background: linear-gradient(135deg, #4e5bff, #7b5bff);
  color: #fff; font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(78,91,255,0.35);
}
.doubao-hero img.hero-logo {
  background: #fff; object-fit: contain;
}
.doubao-hero .hero-title { font-size: 22px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.doubao-hero .hero-sub { font-size: 13px; color: var(--muted); }
.doubao-chips {
  margin-top: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%;
}
.doubao-chips .chip {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--card);
  padding: 12px 14px; font-size: 13px; color: var(--ink-2);
  cursor: pointer; text-align: left; line-height: 1.5;
  transition: border-color .15s, box-shadow .15s, transform .1s, color .15s;
}
.doubao-chips .chip:hover {
  border-color: var(--brand); color: var(--brand);
  box-shadow: 0 4px 14px rgba(78,91,255,0.10);
}
.doubao-chips .chip:active { transform: scale(0.98); }

/* ---- 顶栏 / 侧栏豆包化（胶囊导航 + 圆角选中态） ---- */
.topbar { background: transparent; border-bottom: none; }
.topbar-brand .logo { background: linear-gradient(135deg, #4e5bff, #7b5bff); border-radius: 9px; }
.topbar-brand img.logo { background: #fff; object-fit: contain; border-radius: 8px; }
.topbar-nav-item { border-radius: 999px; padding: 6px 14px; }
.topbar-nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sidebar-icon { border-radius: 12px; }
.sidebar-icon.active { background: var(--brand-soft); }
.sidebar-icon.active .label { color: var(--brand); font-weight: 600; }
