/* AICode 沉浸页：去站顶导航 / 去页脚 / 全黑
 * 左：对话历史 | 中：代码/预览 | 底：紧凑输入
 */

/* —— 全页沉浸（不依赖桌面/手机） —— */
html:has(body.aicode-immersive),
body.aicode-immersive {
  --dkfile-navbar-height: 0px !important;
  background: #0a0b0e !important;
  color: #e8eaed;
  overflow: hidden;
  padding-top: 0 !important;
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
}

body.aicode-immersive .aicode-page-shell {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100%;
  min-height: 100dvh;
  background: #0a0b0e !important;
}

body.aicode-immersive .fullscreen-editor-wrapper {
  top: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: #0a0b0e !important;
}

body.aicode-immersive .aicode-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  margin-right: 2px;
  text-decoration: none;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

body.aicode-immersive .aicode-home-link:hover {
  background: rgba(16, 185, 129, 0.22);
}

body.aicode-immersive .aicode-home-link img {
  display: block;
  width: 16px;
  height: 16px;
}

@media (min-width: 769px) {
  .fullscreen-editor-wrapper.aicode-ide-active {
    --aicode-bg: #0a0b0e;
    --aicode-panel: #12151a;
    --aicode-panel-2: #1a1f27;
    --aicode-border: #2a303a;
    --aicode-text: #e8eaed;
    --aicode-muted: #8b93a1;
    --aicode-green: #10b981;
    --aicode-green-dim: rgba(16, 185, 129, 0.14);
  }

  .fullscreen-editor-wrapper.aicode-ide-active {
    background: var(--aicode-bg);
  }

  /* —— 顶栏：Logo回家 + 标题 + 更多 + 发布 —— */
  .fullscreen-editor-wrapper.aicode-ide-active .editor-top-bar {
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 12px !important;
    background: var(--aicode-panel) !important;
    border-bottom: 1px solid var(--aicode-border) !important;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .editor-title {
    font-size: 13px !important;
    gap: 8px !important;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .editor-title > span:not(.aicode-title-tagline) {
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--aicode-text);
    flex-shrink: 0;
  }

  .editor-title .aicode-title-tagline {
    display: none;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .editor-title .aicode-title-tagline {
    display: inline-block;
    font-weight: 400 !important;
    font-size: 12px !important;
    letter-spacing: 0 !important;
    color: var(--aicode-muted) !important;
    margin-left: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 52vw;
  }

  @media (max-width: 1100px) {
    .fullscreen-editor-wrapper.aicode-ide-active .editor-title .aicode-title-tagline {
      display: none !important;
    }
  }

  .fullscreen-editor-wrapper.aicode-ide-active .editor-actions > .editor-btn,
  .fullscreen-editor-wrapper.aicode-ide-active .editor-actions > .aicode-keep-link,
  .fullscreen-editor-wrapper.aicode-ide-active .editor-publish-hint,
  .fullscreen-editor-wrapper.aicode-ide-active .aicode-mode-badge {
    display: none !important;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .editor-publish-group {
    margin: 0 !important;
    gap: 0 !important;
  }

  .fullscreen-editor-wrapper.aicode-ide-active #topPublishBtn,
  .fullscreen-editor-wrapper.aicode-ide-active .aicode-top-more-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 600;
  }

  /* 已打开文件夹项目：隐藏单页「一键发布」，只留「发布项目」 */
  .fullscreen-editor-wrapper.aicode-ide-active[data-aicode-publish="folder"] #topPublishBtn,
  .fullscreen-editor-wrapper.aicode-ide-active[data-aicode-publish="folder"] .preview-publish-bar .js-publish-html-btn {
    display: none !important;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-top-more-btn {
    background: transparent !important;
    border: 1px solid var(--aicode-border) !important;
    color: var(--aicode-muted) !important;
    margin-right: 8px;
    cursor: pointer;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-top-more-btn:hover {
    color: var(--aicode-text) !important;
    border-color: #3d4554 !important;
    background: var(--aicode-panel-2) !important;
  }

  .fullscreen-editor-wrapper.aicode-ide-active #topPublishBtn {
    background: var(--aicode-green) !important;
    border: none !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    box-shadow: none !important;
  }

  .fullscreen-editor-wrapper.aicode-ide-active #topPublishBtn:hover {
    background: #059669 !important;
  }

  .aicode-top-more-menu {
    position: absolute;
    top: 36px;
    right: 12px;
    min-width: 180px;
    background: var(--aicode-panel-2);
    border: 1px solid var(--aicode-border);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    z-index: 80;
    padding: 4px;
    display: none;
  }

  .aicode-top-more-menu.is-open {
    display: block;
  }

  .aicode-top-more-menu button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    color: var(--aicode-text);
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
  }

  .aicode-top-more-menu button:hover {
    background: var(--aicode-green-dim);
    color: #fff;
  }

  .aicode-top-more-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
  }

  /* 电脑宽屏：工具按钮放在「代码/预览」后；窄屏仍用顶栏「更多」 */
  .aicode-ws-actions {
    display: none;
    align-items: center;
    gap: 2px;
    margin-left: 10px;
    flex-shrink: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .aicode-ws-actions::-webkit-scrollbar {
    display: none;
  }

  .aicode-ws-actions button {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--aicode-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
  }

  .aicode-ws-actions button:hover {
    color: var(--aicode-text);
    background: var(--aicode-panel-2);
  }

  .aicode-ws-actions button i {
    font-size: 11px;
    opacity: 0.9;
  }

  @media (min-width: 1100px) {
    .aicode-ws-actions {
      display: inline-flex;
    }

    .fullscreen-editor-wrapper.aicode-ide-active .aicode-top-more-wrap {
      display: none !important;
    }
  }

  /* 信息面板：沉浸页顶栏高度对齐 + 保证盖在 IDE 之上；open 时强制可见（对抗其它 display:none） */
  body.aicode-immersive .editor-sidebar {
    top: 40px !important;
    z-index: 2200 !important;
    background: #14171c !important;
    border-right: 1px solid #2a2f38 !important;
  }

  body.aicode-immersive .editor-sidebar.open {
    display: block !important;
    visibility: visible !important;
    left: 0 !important;
  }

  body.aicode-immersive .sidebar-overlay.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 2100 !important;
  }

  body.aicode-immersive .sidebar-overlay {
    z-index: 2100 !important;
  }

  body.aicode-immersive .editor-sidebar .sidebar-title {
    color: #e8eaed;
  }

  body.aicode-immersive .editor-sidebar .sidebar-content {
    color: #c8d0d8;
  }

  /* —— 主网格 —— */
  .fullscreen-editor-wrapper.aicode-ide-active .html-editor-container.aicode-ide {
    display: grid !important;
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    height: calc(100vh - 40px);
    height: calc(100dvh - 40px);
    background: var(--aicode-bg);
  }

  .html-editor-sys-notifications {
    max-height: 36px;
  }

  /* —— 左侧：对话 —— */
  .aicode-explorer {
    display: flex;
    flex-direction: column;
    background: var(--aicode-panel);
    border-right: 1px solid var(--aicode-border);
    min-height: 0;
    overflow: hidden;
  }

  .aicode-explorer-top {
    flex-shrink: 0;
    padding: 10px 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid var(--aicode-border);
  }

  .aicode-new-chat-btn {
    width: 100%;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--aicode-border);
    background: var(--aicode-panel-2);
    color: var(--aicode-text) !important;
    -webkit-text-fill-color: var(--aicode-text) !important;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .aicode-new-chat-btn:hover {
    border-color: var(--aicode-green);
    background: var(--aicode-green-dim);
  }

  .aicode-quota-strip {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--aicode-muted);
    font-size: 10px;
    line-height: 1.25;
    cursor: inherit;
    text-align: left;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .aicode-quota-strip.is-empty {
    color: #fca5a5;
  }

  /* Cursor 式左下角账户栏 */
  .aicode-account-bar {
    position: relative;
    flex-shrink: 0;
    margin-top: 0;
    border-top: 1px solid var(--aicode-border);
    background: var(--aicode-panel);
    padding: 8px;
    z-index: 40;
  }

  .aicode-account-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--aicode-text);
    cursor: pointer;
    text-align: left;
  }

  .aicode-account-btn:hover,
  .aicode-account-bar.is-menu-open .aicode-account-btn {
    background: var(--aicode-panel-2);
    border-color: var(--aicode-border);
  }

  .aicode-account-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--aicode-bg);
    border: 1px solid var(--aicode-border);
    flex-shrink: 0;
  }

  .aicode-account-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .aicode-account-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--aicode-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .aicode-account-chevron {
    font-size: 10px;
    color: var(--aicode-muted);
    flex-shrink: 0;
    transition: transform 0.15s ease;
  }

  .aicode-account-bar.is-menu-open .aicode-account-chevron {
    transform: rotate(180deg);
  }

  .aicode-account-menu {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: calc(100% + 4px);
    background: #14171c;
    border: 1px solid var(--aicode-border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    padding: 6px;
    z-index: 50;
    max-height: min(70vh, 360px);
    overflow: auto;
  }

  .aicode-account-menu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 10px;
    border-bottom: 1px solid var(--aicode-border);
    margin-bottom: 4px;
    width: 100%;
    border-left: none;
    border-right: none;
    border-top: none;
    background: transparent;
    color: inherit;
    text-align: left;
    box-sizing: border-box;
  }

  button.aicode-account-menu-head.is-clickable {
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease;
  }

  button.aicode-account-menu-head.is-clickable:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  .aicode-account-menu-cam {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--aicode-muted);
    font-size: 12px;
  }

  button.aicode-account-menu-head.is-clickable:hover .aicode-account-menu-cam {
    color: #34d399;
  }

  .aicode-account-menu-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--aicode-border);
    background: var(--aicode-bg);
    flex-shrink: 0;
  }

  .aicode-account-menu-who {
    min-width: 0;
  }

  .aicode-account-menu-user {
    font-size: 13px;
    font-weight: 700;
    color: var(--aicode-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .aicode-account-menu-sub {
    font-size: 11px;
    color: var(--aicode-muted);
    margin-top: 2px;
  }

  .aicode-account-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--aicode-text) !important;
    -webkit-text-fill-color: var(--aicode-text) !important;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
  }

  .aicode-account-menu-item i {
    width: 16px;
    text-align: center;
    color: var(--aicode-muted);
  }

  .aicode-account-menu-item:hover {
    background: var(--aicode-panel-2);
  }

  .aicode-account-menu-item.is-primary {
    background: #10b981;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-weight: 600;
    margin-bottom: 2px;
  }

  .aicode-account-menu-item.is-primary i,
  .aicode-account-menu-item.is-primary:hover {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  .aicode-account-menu-item.is-primary:hover {
    background: #059669;
  }

  .aicode-account-menu-item.is-danger {
    color: #fca5a5 !important;
    -webkit-text-fill-color: #fca5a5 !important;
  }

  .aicode-account-menu-item.is-danger i {
    color: #fca5a5;
  }

  .aicode-side-tabs {
    display: flex;
    gap: 2px;
    background: var(--aicode-bg);
    border-radius: 8px;
    padding: 2px;
  }

  .aicode-side-tab {
    flex: 1;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--aicode-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
  }

  .aicode-side-tab.is-active {
    background: var(--aicode-panel-2);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  .aicode-side-badge {
    display: inline-block;
    min-width: 16px;
    padding: 0 5px;
    margin-left: 2px;
    border-radius: 999px;
    background: var(--aicode-green);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    vertical-align: middle;
  }

  .aicode-files-summary {
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--aicode-muted);
    border-bottom: 1px solid var(--aicode-border);
    background: var(--aicode-bg);
  }

  .aicode-files-summary.is-ready {
    color: #34d399;
  }

  .aicode-files-summary-folder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--aicode-muted);
  }

  .aicode-files-summary-folder.is-ready {
    color: var(--aicode-muted);
  }

  .aicode-files-summary-folder .aicode-myhtml-refresh {
    margin-left: auto;
  }

  .aicode-folder-access-tip {
    flex-shrink: 0;
    margin: 0;
    padding: 8px 10px;
    border-bottom: 1px solid var(--aicode-border);
    background: rgba(245, 158, 11, 0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .aicode-folder-access-tip[hidden] {
    display: none !important;
  }

  .aicode-access-tip-text {
    font-size: 11px;
    line-height: 1.4;
    color: #fbbf24;
  }

  .aicode-access-tip-actions {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .aicode-access-tip-btn {
    appearance: none;
    height: 24px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid #10b981;
    background: #10b981;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
  }

  .aicode-access-tip-link {
    font-size: 11px;
    font-weight: 600;
    color: #34d399 !important;
    -webkit-text-fill-color: #34d399 !important;
    text-decoration: underline;
  }

  .aicode-chat-list {
    /* 会话列表固定预留高度，多轮消息时不被底部 transcript 挤没 */
    flex: 0 0 auto;
    flex-shrink: 0;
    max-height: min(36vh, 240px);
    min-height: 96px;
    overflow: auto;
    padding: 6px;
    border-bottom: 1px solid var(--aicode-border);
  }

  .aicode-explorer[data-side="files"] .aicode-chat-list,
  .aicode-explorer[data-side="files"] .aicode-chat-transcript {
    display: none;
  }

  .aicode-explorer[data-side="chats"] .aicode-chat-transcript {
    display: flex;
  }

  .aicode-chat-empty {
    padding: 20px 12px;
    color: var(--aicode-muted);
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
  }

  .aicode-chat-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--aicode-muted);
    border: 1px solid transparent;
    margin-bottom: 2px;
  }

  .aicode-chat-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--aicode-text);
  }

  .aicode-chat-item.is-active {
    background: var(--aicode-green-dim);
    border-color: rgba(16, 185, 129, 0.35);
    color: #fff;
  }

  .aicode-chat-item .chat-ico {
    margin-top: 2px;
    font-size: 11px;
    opacity: 0.7;
    flex-shrink: 0;
  }

  .aicode-chat-item .chat-body {
    min-width: 0;
    flex: 1;
  }

  .aicode-chat-item .chat-title {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .aicode-chat-item .chat-meta {
    margin-top: 3px;
    font-size: 10px;
    opacity: 0.65;
  }

  .aicode-chat-item .chat-del {
    opacity: 0;
    border: none;
    background: transparent;
    color: var(--aicode-muted);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .aicode-chat-item:hover .chat-del {
    opacity: 1;
  }

  .aicode-chat-item .chat-del:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
  }

  .aicode-files-panel {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  .aicode-explorer[data-side="files"] .aicode-files-panel {
    display: flex;
  }

  .aicode-explorer[data-side="chats"] .aicode-files-panel {
    display: none;
  }

  .aicode-folder-bind {
    flex-shrink: 0;
    padding: 8px 10px;
    border-bottom: 1px solid var(--aicode-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .aicode-folder-manage-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    height: auto;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #2a2f38;
    background: #1a1f27;
    color: #e8eaed !important;
    -webkit-text-fill-color: #e8eaed;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    line-height: 1.25;
  }

  .aicode-folder-manage-link:hover,
  .aicode-folder-manage-link:focus,
  .aicode-folder-manage-link:visited,
  a.aicode-folder-manage-link:link {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    background: #222831;
    border-color: #34d399;
    text-decoration: none !important;
  }

  .aicode-folder-manage-link i {
    color: #34d399;
    flex-shrink: 0;
    font-size: 14px;
  }

  .aicode-folder-manage-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
  }

  .aicode-folder-manage-title {
    font-size: 12px;
    font-weight: 600;
    color: inherit;
    -webkit-text-fill-color: inherit;
  }

  .aicode-folder-manage-desc {
    font-size: 10px;
    font-weight: 500;
    color: #8b93a1 !important;
    -webkit-text-fill-color: #8b93a1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .aicode-folder-manage-link:hover .aicode-folder-manage-desc {
    color: #a7b0bd !important;
    -webkit-text-fill-color: #a7b0bd;
  }

  .aicode-folder-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--aicode-muted);
    letter-spacing: 0.02em;
  }

  .aicode-folder-bind select,
  .aicode-folder-bind input {
    width: 100%;
    background: var(--aicode-bg);
    border: 1px solid var(--aicode-border);
    color: var(--aicode-text);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 11px;
    outline: none;
  }

  .aicode-current-folder {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--aicode-border);
    background: var(--aicode-bg);
    color: var(--aicode-muted);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: text;
  }

  .aicode-current-folder.is-bound {
    color: var(--aicode-text);
    border-color: rgba(16, 185, 129, 0.35);
  }

  .aicode-folder-bind select:focus,
  .aicode-folder-bind input:focus {
    border-color: var(--aicode-green);
  }

  .aicode-folder-create-row {
    display: flex;
    gap: 6px;
    align-items: center;
  }

  .aicode-folder-create-row input {
    flex: 1;
    min-width: 0;
  }

  .aicode-folder-create-row button {
    flex-shrink: 0;
    height: 28px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid var(--aicode-green);
    background: var(--aicode-green);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
  }

  .aicode-folder-create-row button:hover {
    background: #059669;
  }

  .aicode-folder-bind-actions {
    display: none;
  }

  .aicode-folder-status {
    font-size: 10px;
    color: var(--aicode-muted);
    line-height: 1.4;
  }

  .aicode-folder-status.is-bound {
    color: #34d399;
  }

  .aicode-file-tree {
    flex: 1;
    min-height: 0;
    overflow: auto;
    /* 底部留白：避免最后一项贴着账户栏被挡住、点不到 */
    padding: 4px 0 64px;
    font-size: 12px;
    color: var(--aicode-muted);
  }

  .aicode-file-tree[hidden] {
    display: none !important;
  }

  .aicode-user-html-list {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    font-size: 12px;
    color: var(--aicode-muted);
    display: flex;
    flex-direction: column;
  }

  .aicode-user-html-list[hidden] {
    display: none !important;
  }

  .aicode-myhtml-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px 4px;
    font-size: 11px;
    color: var(--aicode-muted);
    flex-shrink: 0;
  }

  .aicode-myhtml-refresh {
    border: none;
    background: transparent;
    color: var(--aicode-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
  }

  .aicode-myhtml-refresh:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
  }

  .aicode-myhtml-load-more {
    display: block;
    width: calc(100% - 16px);
    margin: 8px 8px 12px;
    padding: 8px 10px;
    border: 1px dashed #2a2f38;
    border-radius: 8px;
    background: transparent;
    color: #9ca3af;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
  }

  .aicode-myhtml-load-more:hover {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.12);
  }

  .aicode-myhtml-all-loaded {
    padding-bottom: 12px !important;
  }

  .aicode-myhtml-items {
    flex: 1;
    min-height: 0;
    overflow: auto;
    /* 滚到底时最后一项完整露出，不被左下角账户栏遮挡 */
    padding: 0 0 72px;
    -webkit-overflow-scrolling: touch;
  }

  .aicode-file-tree .tree-empty,
  .aicode-user-html-list .tree-empty {
    padding: 14px 12px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--aicode-muted);
  }

  .aicode-tree-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    cursor: pointer;
    border-left: 2px solid transparent;
    user-select: none;
  }

  .aicode-tree-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--aicode-text);
  }

  .aicode-tree-item.is-active {
    background: var(--aicode-green-dim);
    border-left-color: var(--aicode-green);
    color: #fff;
  }

  .aicode-tree-item.is-write-target {
    background: rgba(16, 185, 129, 0.08);
  }

  .aicode-tree-item.is-write-target .tree-name {
    color: #34d399;
    font-weight: 600;
  }

  .aicode-tree-chevron {
    width: 12px;
    flex-shrink: 0;
    text-align: center;
    font-size: 9px;
    color: var(--aicode-muted);
  }

  .aicode-tree-chevron-spacer {
    visibility: hidden;
  }

  .aicode-tree-write-badge {
    margin-left: 4px;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #10b981;
    border-radius: 3px;
    padding: 1px 5px;
    line-height: 1.4;
  }

  .aicode-tree-file-count {
    margin-left: auto;
    flex-shrink: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(139, 147, 161, 0.16);
    border: 1px solid rgba(139, 147, 161, 0.28);
    color: #9aa3af;
    font-size: 10px;
    font-weight: 600;
    line-height: 14px;
    text-align: center;
    box-sizing: border-box;
  }

  .aicode-tree-item.is-write-target .aicode-tree-write-badge {
    margin-left: 4px;
  }

  .aicode-tree-item .tree-icon {
    width: 14px;
    text-align: center;
    color: var(--aicode-green);
    font-size: 11px;
    flex-shrink: 0;
  }

  .aicode-tree-item.is-folder .tree-icon {
    color: #fbbf24;
  }

  .aicode-tree-item.is-image .tree-icon {
    color: #34d399;
  }

  .aicode-tree-item .tree-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .aicode-tree-children {
    /* 子级由 padding-left 缩进，不再额外套边框以免拥挤 */
  }

  /* —— 中间主区 —— */
  .aicode-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--aicode-bg);
  }

  .aicode-workspace-header {
    flex-shrink: 0;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 10px;
    background: var(--aicode-panel);
    border-bottom: 1px solid var(--aicode-border);
  }

  .aicode-pane-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--aicode-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .aicode-pane-tab:hover {
    color: var(--aicode-text);
  }

  .aicode-pane-tab.is-active {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: var(--aicode-panel-2);
    box-shadow: inset 0 -2px 0 var(--aicode-green);
  }

  .aicode-workspace-header .aicode-header-spacer {
    flex: 1;
  }

  .aicode-workspace-header .aicode-save-hint {
    font-size: 11px;
    color: var(--aicode-muted);
    margin-right: 8px;
  }

  .aicode-workspace-header .aicode-publish-folder-btn {
    appearance: none;
    border: none;
    background: var(--aicode-green);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 5px;
  }

  .aicode-workspace-header .aicode-publish-folder-btn.is-visible {
    display: inline-flex;
  }

  /* 生成后审查：顶栏细条（替代白底大确认卡） */
  .aicode-review-strip {
    display: none;
    flex-shrink: 0;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 4px 12px;
    background: #12161c;
    border-bottom: 1px solid #2a2f38;
    box-shadow: inset 0 -1px 0 rgba(16, 185, 129, 0.35);
  }

  .aicode-review-strip.is-visible,
  .aicode-review-strip:not([hidden]) {
    display: flex;
  }

  .aicode-review-strip[hidden] {
    display: none !important;
  }

  .aicode-review-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
  }

  .aicode-review-text {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 500;
    color: #c8d0d8;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .aicode-review-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .aicode-review-btn {
    appearance: none;
    height: 26px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }

  .aicode-review-reject {
    border: 1px solid #3a414d;
    background: transparent;
    color: #c8d0d8;
  }

  .aicode-review-reject:hover {
    border-color: #5a6575;
    background: #1a1f27;
    color: #fff;
  }

  .aicode-review-accept {
    border: none;
    background: #10b981;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  .aicode-review-accept:hover {
    background: #059669;
  }

  /* aicode 下隐藏旧白底确认条（桌面） */
  .fullscreen-editor-wrapper.aicode-ide-active #modifyConfirmBar {
    display: none !important;
  }

  .aicode-workspace-header .aicode-publish-folder-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  .aicode-workspace {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: #0b0d10;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .editor-section,
  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .preview-section {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-right: none !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #0b0d10;
  }

  .fullscreen-editor-wrapper.aicode-ide-active[data-aicode-pane="code"] .aicode-workspace .preview-section {
    visibility: hidden;
    pointer-events: none;
    z-index: 0;
  }

  .fullscreen-editor-wrapper.aicode-ide-active[data-aicode-pane="code"] .aicode-workspace .editor-section {
    visibility: visible;
    z-index: 1;
  }

  .fullscreen-editor-wrapper.aicode-ide-active[data-aicode-pane="preview"] .aicode-workspace .editor-section {
    visibility: hidden;
    pointer-events: none;
    z-index: 0;
  }

  .fullscreen-editor-wrapper.aicode-ide-active[data-aicode-pane="preview"] .aicode-workspace .preview-section {
    visibility: visible;
    z-index: 1;
  }

  /* 左侧会话区：会话列表 + 消息流（Cursor 式侧栏，不占工作区页签） */
  .aicode-explorer .aicode-chat-transcript {
    position: relative;
    inset: auto;
    flex: 1 1 0;
    min-height: 0;
    display: none;
    flex-direction: column;
    background: var(--aicode-bg);
    overflow: hidden;
    border-top: none;
  }

  .aicode-chat-transcript-head {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--aicode-border);
    background: var(--aicode-panel);
  }

  .aicode-chat-transcript-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--aicode-text);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .aicode-chat-transcript-hint {
    font-size: 10px;
    color: var(--aicode-muted);
    white-space: nowrap;
  }

  .aicode-chat-transcript-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 10px 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .aicode-chat-transcript-empty {
    margin: auto;
    text-align: center;
    color: var(--aicode-muted);
    max-width: 220px;
    padding: 16px 8px;
  }

  .aicode-chat-transcript-empty i {
    font-size: 22px;
    color: #3d4554;
    margin-bottom: 8px;
  }

  .aicode-chat-transcript-empty p {
    margin: 0 0 4px;
    color: var(--aicode-text);
    font-size: 12px;
    font-weight: 600;
  }

  .aicode-chat-transcript-empty span {
    font-size: 11px;
    line-height: 1.45;
  }

  .aicode-msg {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: 100%;
  }

  .aicode-msg.is-user {
    align-self: stretch;
  }

  .aicode-msg.is-assistant {
    align-self: stretch;
  }

  .aicode-msg-role {
    font-size: 10px;
    font-weight: 600;
    color: var(--aicode-muted);
    padding: 0 2px;
  }

  .aicode-msg.is-assistant .aicode-msg-role {
    color: #a7b0bc;
    letter-spacing: 0.02em;
  }

  .aicode-msg.is-user .aicode-msg-role {
    text-align: left;
    color: #34d399;
  }

  .aicode-msg-bubble {
    border-radius: 8px;
    padding: 8px 9px;
    border: 1px solid var(--aicode-border);
    background: var(--aicode-panel);
  }

  .aicode-msg.is-user .aicode-msg-bubble {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
  }

  .aicode-msg-text {
    font-size: 12px;
    line-height: 1.5;
    color: var(--aicode-text);
    word-break: break-word;
    white-space: pre-wrap;
  }

  .aicode-msg.is-pending .aicode-msg-bubble {
    border-style: dashed;
    color: var(--aicode-muted);
    opacity: 0.9;
  }

  .aicode-msg.is-pending .aicode-msg-role {
    color: #34d399;
  }

  .aicode-msg-apply {
    margin-top: 8px;
    appearance: none;
    border: 1px solid var(--aicode-border);
    background: var(--aicode-panel-2);
    color: var(--aicode-text);
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .aicode-msg-review {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--aicode-border);
  }

  .aicode-msg-review-hint {
    display: block;
    font-size: 11px;
    color: var(--aicode-muted);
    margin-bottom: 6px;
  }

  .aicode-msg-review-actions {
    display: flex;
    gap: 6px;
  }

  .aicode-msg-review-btn {
    appearance: none;
    height: 26px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
  }

  .aicode-msg-review-btn.is-reject {
    border: 1px solid #3a414d;
    background: transparent;
    color: #c8d0d8;
  }

  .aicode-msg-review-btn.is-accept {
    border: none;
    background: var(--aicode-green);
    color: #fff;
  }

  .aicode-result-card {
    font-size: 12px;
    line-height: 1.45;
    color: var(--aicode-text);
  }

  .aicode-result-sec {
    margin-bottom: 8px;
  }

  .aicode-result-label {
    font-size: 11px;
    font-weight: 700;
    color: #34d399;
    margin-bottom: 3px;
  }

  .aicode-result-body {
    color: #c8d0d8;
    word-break: break-word;
  }

  .aicode-result-kw-list {
    margin: 0;
    padding: 0 0 0 14px;
    color: #c8d0d8;
    list-style: disc;
  }

  .aicode-result-kw-list li {
    margin: 0 0 3px;
    padding: 0;
    line-height: 1.4;
    word-break: break-word;
  }

  .aicode-result-kw-list li::marker {
    color: #34d399;
  }

  .aicode-result-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
  }

  .aicode-result-file.muted {
    color: var(--aicode-muted);
    font-family: inherit;
  }

  .aicode-result-fname {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e8eaed;
  }

  .aicode-result-delta .is-add {
    color: #34d399;
  }

  .aicode-result-delta .is-del {
    color: #f87171;
  }

  .aicode-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--aicode-border);
  }

  .aicode-result-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    border: 1px solid #3a414d;
    background: transparent;
    color: #c8d0d8 !important;
    -webkit-text-fill-color: #c8d0d8;
  }

  .aicode-result-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff !important;
    -webkit-text-fill-color: #fff;
  }

  a.aicode-result-btn.is-primary,
  .aicode-result-btn.is-primary {
    border: none;
    background: #10b981;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
  }

  a.aicode-result-btn.is-primary:hover,
  .aicode-result-btn.is-primary:hover {
    background: #059669;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
  }

  .aicode-msg-apply {
    border: none;
    background: #10b981;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  /* 旧顶栏审查条：桌面 aicode 不再使用 */
  .fullscreen-editor-wrapper.aicode-ide-active .aicode-review-strip {
    display: none !important;
  }

  .aicode-msg-apply:hover {
    border-color: var(--aicode-green);
    color: #fff;
    background: var(--aicode-green-dim);
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .editor-section .section-header,
  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .preview-section .section-header,
  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .editor-code-output-label {
    display: none !important;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .editor-code-output-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace #htmlEditor {
    flex: 1;
    min-height: 0;
    height: auto !important;
    border: none !important;
    border-radius: 0 !important;
    background: #0b0d10 !important;
    color: #d6dde8 !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
    padding: 16px 18px !important;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .preview-container {
    flex: 1;
    min-height: 0;
    /* 空态引导为深绿；勿用白底，否则底部会露一条白边 */
    background: #0b0d10;
    position: relative;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .preview-empty-guide {
    z-index: 2;
    padding: 24px 16px;
    overflow: auto;
    align-items: center;
    background:
      radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.14) 0%, rgba(16, 185, 129, 0) 38%),
      radial-gradient(circle at 90% 85%, rgba(5, 150, 105, 0.12) 0%, rgba(5, 150, 105, 0) 40%),
      linear-gradient(160deg, #070b09 0%, #0d1f18 50%, #0a1210 100%);
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace #preview {
    position: relative;
    z-index: 0;
    background: #0b0d10;
  }

  /* 空态：收紧体积，主入口横排 + 次入口四列紧凑 */
  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-content {
    max-width: 560px;
    width: min(560px, 92vw);
    padding: 22px 20px 18px;
    border-radius: 14px;
    margin: auto;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-icon {
    margin-bottom: 8px;
    font-size: 0;
    animation: none;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-icon-svg {
    width: 36px;
    height: 36px;
    stroke-width: 2.2;
    filter: none;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-title {
    font-size: 20px;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-subtitle {
    font-size: 12px;
    line-height: 1.55;
    margin-bottom: 16px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    color: #8b9a94;
    animation: none;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-actions {
    margin-top: 0;
    gap: 8px;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-actions-primary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-actions-secondary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 10px;
    padding: 12px 12px;
    border-radius: 10px;
    margin: 0;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-card:hover {
    transform: translateY(-1px);
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-card.is-primary {
    padding: 14px 14px;
    min-height: 64px;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-card.is-compact {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 10px;
    min-height: 0;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-icon-svg {
    width: 22px;
    height: 22px;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-card.is-compact .guide-action-icon {
    width: 22px;
    height: 22px;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-card.is-compact .guide-action-icon-svg {
    width: 18px;
    height: 18px;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-body {
    min-width: 0;
    flex: 1;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    color: #e8eaed;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-desc {
    font-size: 11px;
    line-height: 1.35;
    color: #8b93a1;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 999px;
    background: #10b981;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-card.is-folder {
    border-color: rgba(16, 185, 129, 0.45);
    background: linear-gradient(160deg, rgba(16, 185, 129, 0.16), rgba(16, 185, 129, 0.05));
  }

  .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-action-card.is-folder .guide-action-title {
    color: #34d399;
  }

  @media (max-width: 720px) {
    .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-actions-primary,
    .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-actions-secondary {
      grid-template-columns: 1fr 1fr;
    }
  }

  @media (max-width: 480px) {
    .fullscreen-editor-wrapper.aicode-ide-active .aicode-workspace .guide-actions-primary {
      grid-template-columns: 1fr;
    }
  }

  /* —— 底部 Composer：一行主输入 —— */
  .aicode-composer {
    flex-shrink: 0;
    max-height: 34vh;
    overflow: auto;
    background: var(--aicode-panel);
    border-top: 1px solid var(--aicode-border);
    padding: 10px 12px 12px;
  }

  .aicode-composer .ai-control-panel {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* 默认收起占空间的控件 */
  .aicode-composer .input-source-selector,
  .aicode-composer .quick-templates-bar,
  .aicode-composer .style-selector,
  .aicode-composer .ai-advanced-details,
  .aicode-composer .ai-secondary-actions,
  .aicode-composer #textInputArea > div[style*="font-size: 11px"] {
    display: none !important;
  }

  /* 输入方式已收到「生成」旁 + 菜单，更多选项里不再展开顶部三按钮 */
  .aicode-composer.is-opts-open .style-selector {
    display: flex !important;
  }

  .aicode-composer.is-opts-open .quick-templates-bar,
  .aicode-composer.is-opts-open .ai-advanced-details {
    display: block !important;
  }

  /* 与顶栏「草稿箱」重复：隐藏输入源「草稿」及冗长提示 */
  .aicode-composer .input-source-btn[data-source="draft"],
  .aicode-composer .input-source-selector > span {
    display: none !important;
  }

  /* 非整页快捷项：减杂乱 */
  .aicode-composer .quick-template-btn[title="导航栏"],
  .aicode-composer .quick-template-btn[title="卡片布局"] {
    display: none !important;
  }

  /* 色系过多：隐藏与粉色/绿色高度近似的两项 */
  .aicode-composer .style-btn[data-color="rosegold"],
  .aicode-composer .style-btn[data-color="gold"] {
    display: none !important;
  }

  .aicode-composer-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .aicode-output-mode-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--aicode-border);
    background: var(--aicode-panel-2);
  }

  .aicode-mode-toggle-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 0 0 auto;
  }

  .aicode-mode-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border-radius: 8px;
    background: var(--aicode-bg);
  }

  .aicode-mode-hint {
    margin: 0;
    padding: 0 2px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--aicode-muted);
    flex: 1 0 100%;
    order: 3;
  }

  .aicode-mode-btn {
    height: 28px;
    padding: 0 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--aicode-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }

  .aicode-mode-btn:hover {
    color: var(--aicode-text);
  }

  .aicode-mode-btn.is-active {
    background: #10b981;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  .aicode-mode-folder-target {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 420px;
    flex-wrap: nowrap;
    border-radius: 8px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    order: 2;
  }

  .aicode-mode-folder-target[hidden] {
    display: none !important;
  }

  .aicode-mode-folder-target.is-need-select {
    /* 红框只套在选择器上，避免整行（含长提示文案）拉出超长描边 */
    background: transparent;
    box-shadow: none;
    padding: 0;
    animation: none;
    flex-wrap: wrap;
    max-width: min(420px, 100%);
  }

  .aicode-mode-folder-target.is-need-select .aicode-folder-picker-trigger {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px #ef4444;
    animation: aicode-write-folder-pulse 1.1s ease-in-out 3;
  }

  .aicode-mode-folder-target.is-need-select .aicode-mode-folder-label {
    color: #fecaca;
    font-weight: 600;
  }

  .aicode-write-folder-hint {
    display: none;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 2px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: #fecaca;
    font-weight: 600;
    white-space: normal;
    box-sizing: border-box;
  }

  .aicode-mode-folder-target.is-need-select .aicode-write-folder-hint {
    display: block;
  }

  @keyframes aicode-write-folder-pulse {
    0%,
    100% {
      box-shadow: 0 0 0 2px #ef4444;
    }
    50% {
      box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.55);
    }
  }

  .aicode-mode-folder-label {
    font-size: 11px;
    color: var(--aicode-muted);
    white-space: nowrap;
  }

  .aicode-mode-folder-target select {
    flex: 1;
    min-width: 120px;
    max-width: 280px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--aicode-border);
    background: var(--aicode-bg);
    color: var(--aicode-text);
    font-size: 12px;
    padding: 0 8px;
  }

  .aicode-folder-select-sr {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .aicode-folder-picker {
    position: relative;
    flex: 1;
    min-width: 160px;
    max-width: 320px;
  }

  .aicode-folder-picker-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--aicode-border);
    background: var(--aicode-bg);
    color: var(--aicode-text) !important;
    -webkit-text-fill-color: var(--aicode-text) !important;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
  }

  .aicode-folder-picker-trigger:hover,
  .aicode-folder-picker.is-open .aicode-folder-picker-trigger {
    border-color: var(--aicode-green);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.16);
  }

  .aicode-folder-picker-icon {
    color: #34d399;
    font-size: 12px;
    flex-shrink: 0;
  }

  .aicode-folder-picker-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .aicode-folder-picker-caret {
    font-size: 10px;
    color: var(--aicode-muted);
    flex-shrink: 0;
    transition: transform 0.18s ease;
  }

  .aicode-folder-picker.is-open .aicode-folder-picker-caret {
    transform: rotate(180deg);
    color: #34d399;
  }

  .aicode-folder-picker-menu {
    position: fixed;
    z-index: 2600;
    left: 0;
    top: auto;
    bottom: auto;
    right: auto;
    width: 240px;
    max-height: min(280px, 42vh);
    overflow-y: auto;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--aicode-border);
    background: #14171c;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(16, 185, 129, 0.08);
  }

  /* 展开时 composer 勿裁切（fixed 菜单兜底；此条再保险） */
  .aicode-composer:has(.aicode-folder-picker.is-open) {
    overflow: visible;
  }

  .aicode-folder-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--aicode-text) !important;
    -webkit-text-fill-color: var(--aicode-text) !important;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
  }

  .aicode-folder-picker-item > span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .aicode-folder-picker-item > i:first-child {
    width: 14px;
    text-align: center;
    color: var(--aicode-muted);
    flex-shrink: 0;
  }

  .aicode-folder-picker-item:hover {
    background: rgba(16, 185, 129, 0.12);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  .aicode-folder-picker-item:hover > i:first-child {
    color: #34d399;
  }

  .aicode-folder-picker-item.is-active {
    background: rgba(16, 185, 129, 0.2);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  .aicode-folder-picker-item.is-active > i:first-child {
    color: #34d399;
  }

  .aicode-folder-picker-check {
    color: #34d399 !important;
    font-size: 11px;
    flex-shrink: 0;
  }

  .aicode-folder-picker-item.is-placeholder {
    color: var(--aicode-muted) !important;
    -webkit-text-fill-color: var(--aicode-muted) !important;
  }

  .aicode-folder-picker-item.is-new {
    margin-top: 4px;
    border-top: 1px solid var(--aicode-border);
    border-radius: 0 0 8px 8px;
    color: #34d399 !important;
    -webkit-text-fill-color: #34d399 !important;
    font-weight: 600;
  }

  .aicode-folder-picker-item.is-new > i:first-child {
    color: #34d399;
  }

  .aicode-folder-picker-item.is-new:hover,
  .aicode-folder-picker-item.is-new.is-active {
    background: rgba(16, 185, 129, 0.16);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  .aicode-input-mode-wrap {
    display: none;
  }

  .aicode-composer .aicode-input-mode-wrap {
    display: block;
    position: relative;
    flex-shrink: 0;
  }

  .aicode-composer .aicode-input-mode-plus {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border-radius: 10px;
    border: 1px solid var(--aicode-border);
    background: var(--aicode-panel-2);
    color: var(--aicode-text) !important;
    -webkit-text-fill-color: var(--aicode-text) !important;
    font-size: 14px;
    cursor: pointer;
  }

  .aicode-composer .aicode-input-mode-plus:hover,
  .aicode-input-mode-wrap.is-open .aicode-input-mode-plus {
    border-color: var(--aicode-green);
    background: var(--aicode-green-dim);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  .aicode-composer .aicode-input-mode-plus.is-alt {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.18);
    color: #34d399 !important;
    -webkit-text-fill-color: #34d399 !important;
  }

  .aicode-input-mode-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 90;
    min-width: 132px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--aicode-border);
    background: #14171c;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  }

  .aicode-input-mode-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--aicode-text) !important;
    -webkit-text-fill-color: var(--aicode-text) !important;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
  }

  .aicode-input-mode-item i {
    width: 14px;
    text-align: center;
    color: var(--aicode-muted);
  }

  .aicode-input-mode-item:hover {
    background: rgba(16, 185, 129, 0.12);
  }

  .aicode-input-mode-item.is-active {
    background: #10b981;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  .aicode-input-mode-item.is-active i {
    color: #fff;
  }

  .aicode-mode-new-folder-btn {
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid var(--aicode-border);
    background: var(--aicode-bg);
    color: var(--aicode-text) !important;
    -webkit-text-fill-color: var(--aicode-text) !important;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }

  .aicode-mode-new-folder-btn:hover {
    border-color: var(--aicode-green);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: #10b981;
  }

  .aicode-composer-toolbar .hint {
    flex: 1;
    font-size: 11px;
    color: var(--aicode-muted);
  }

  .aicode-opts-summary {
    font-size: 10px;
    color: var(--aicode-muted);
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px dashed #3d4554;
    white-space: nowrap;
    opacity: 0.9;
  }

  .aicode-opts-summary[hidden] {
    display: none !important;
  }

  .aicode-composer-toolbar button.aicode-opts-toggle {
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--aicode-border);
    background: var(--aicode-panel-2);
    color: var(--aicode-text);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .aicode-composer-toolbar button.aicode-opts-toggle .aicode-opts-chevron {
    font-size: 10px;
    transition: transform 0.18s ease;
    color: var(--aicode-muted);
  }

  .aicode-composer-toolbar button.aicode-opts-toggle:hover,
  .aicode-composer-toolbar button.aicode-opts-toggle.is-on {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    border-color: var(--aicode-green);
    background: var(--aicode-green-dim);
  }

  .aicode-composer-toolbar button.aicode-opts-toggle.is-on .aicode-opts-chevron {
    transform: rotate(180deg);
    color: #34d399;
  }

  .aicode-composer-toolbar button.aicode-opts-toggle.is-hint {
    animation: aicode-opts-pulse 1.2s ease-in-out 3;
    border-color: var(--aicode-green);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  }

  @keyframes aicode-opts-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.15); }
    50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.28); }
  }

  .aicode-composer #textInputArea.ai-input-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
  }

  /* 展开后：输入区纵向，色系不再挤在「生成」旁 */
  .aicode-composer.is-opts-open #textInputArea.ai-input-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    flex-wrap: nowrap;
  }

  .aicode-composer.is-opts-open #textInputArea.ai-input-bar > #aiPromptInput {
    width: 100%;
    flex: none;
  }

  .aicode-composer.is-opts-open .style-selector {
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--aicode-border);
    background: var(--aicode-bg);
  }

  .aicode-composer.is-opts-open .style-selector-label {
    width: 100%;
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--aicode-muted);
  }

  .aicode-composer.is-opts-open .style-btn {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
  }

  .aicode-composer.is-opts-open .input-source-selector {
    gap: 6px;
    margin-bottom: 8px !important;
    flex-wrap: wrap;
  }

  .aicode-composer.is-opts-open .quick-templates-bar {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px !important;
    padding: 8px 10px !important;
    background: var(--aicode-bg) !important;
    border: 1px solid var(--aicode-border) !important;
    border-radius: 8px !important;
  }

  .aicode-composer.is-opts-open .quick-templates-bar > div,
  .aicode-composer.is-opts-open .quick-templates-row {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px !important;
  }

  .aicode-composer .quick-templates-label {
    font-size: 11px;
    color: var(--aicode-muted);
    font-weight: 600;
    margin-right: 2px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .aicode-composer .quick-templates-row[data-quick-row="folder"] {
    padding-top: 6px;
    border-top: 1px dashed #2a303a;
  }

  .aicode-composer.is-opts-open .ai-primary-row {
    width: 100%;
    justify-content: flex-start;
  }

  .aicode-composer #aiPromptInput {
    flex: 1 1 240px;
    min-height: 44px;
    max-height: 100px;
    background: var(--aicode-bg) !important;
    border: 1px solid var(--aicode-border) !important;
    border-radius: 10px !important;
    color: var(--aicode-text) !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    resize: vertical;
  }

  .aicode-composer #aiPromptInput:focus {
    border-color: var(--aicode-green) !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18) !important;
  }

  .aicode-composer .ai-primary-row {
    display: flex !important;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
  }

  .aicode-composer .ai-generate-btn,
  .aicode-composer .ai-continue-btn {
    height: 40px !important;
    min-width: 72px;
    padding: 0 16px !important;
    border-radius: 10px !important;
    background: var(--aicode-green) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    border: none !important;
    font-weight: 600 !important;
    font-size: 13px !important;
  }

  .aicode-composer .ai-generate-btn:hover {
    background: #059669 !important;
  }
}

@media (max-width: 768px) {
  .aicode-explorer,
  .aicode-workspace-header,
  .aicode-composer-toolbar,
  .aicode-top-more-wrap,
  .aicode-review-strip {
    display: none !important;
  }

  .aicode-main {
    display: contents;
  }

  .aicode-workspace {
    display: contents;
  }

  body.aicode-immersive .modify-confirm-bar.modify-confirm-bar-mobile {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #14171c !important;
    border: 1px solid #2a2f38 !important;
    border-left: 3px solid #10b981 !important;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }

  body.aicode-immersive .modify-confirm-bar.modify-confirm-bar-mobile .modify-confirm-hint {
    flex: 1;
    text-align: left;
    font-size: 12px;
    color: #c8d0d8 !important;
    font-weight: 500;
  }

  body.aicode-immersive .modify-confirm-bar.modify-confirm-bar-mobile .modify-confirm-btns {
    width: auto;
    flex-shrink: 0;
    gap: 8px;
  }

  body.aicode-immersive .modify-confirm-bar.modify-confirm-bar-mobile .btn-reject,
  body.aicode-immersive .modify-confirm-bar.modify-confirm-bar-mobile .btn-accept {
    flex: none;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 13px;
  }

  body.aicode-immersive .modify-confirm-bar.modify-confirm-bar-mobile .btn-reject {
    background: transparent;
    border-color: #3a414d;
    color: #c8d0d8;
  }

  body.aicode-immersive .modify-confirm-bar.modify-confirm-bar-mobile .btn-accept {
    background: #10b981;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    box-shadow: none;
  }
}

/* SEO landing：可抓取正文，不挡 IDE */
body.aicode-immersive .aicode-seo-landing {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  color: #c8d0d8;
  background: #0b0d10;
  font-size: 14px;
  line-height: 1.65;
}
body.aicode-immersive .aicode-seo-landing h1 {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
}
body.aicode-immersive .aicode-seo-landing h2 {
  color: #e8eef2;
  font-size: 16px;
  margin: 20px 0 8px;
}
body.aicode-immersive .aicode-seo-landing h3 {
  color: #d5dde4;
  font-size: 14px;
  margin: 14px 0 6px;
}
body.aicode-immersive .aicode-seo-landing ul {
  margin: 10px 0;
  padding-left: 1.2em;
}
body.aicode-immersive .aicode-seo-landing li {
  margin: 6px 0;
}
body.aicode-immersive .aicode-seo-landing strong {
  color: #34d399;
}

/* —— aicode 沉浸页：弹窗 / Toast 与暗黑主色统一（覆盖 dkfile-modal 内联白底 !important） —— */
body.aicode-immersive #dkfile-modal-container {
  background: rgba(0, 0, 0, 0.72) !important;
}

body.aicode-immersive #dkfile-modal-container .dkfile-modal,
body.aicode-immersive #dkfile-modal-container .dkfile-modal-header,
body.aicode-immersive #dkfile-modal-container .dkfile-modal-body,
body.aicode-immersive #dkfile-modal-container .dkfile-modal-footer {
  background: #14171c !important;
  color: #e8eaed !important;
  -webkit-text-fill-color: #e8eaed !important;
  border-color: #2a2f38 !important;
}

body.aicode-immersive #dkfile-modal-container .dkfile-modal {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55) !important;
  border: 1px solid #2a2f38 !important;
}

body.aicode-immersive #dkfile-modal-container .dkfile-modal-header {
  border-bottom: 1px solid #2a2f38 !important;
}

body.aicode-immersive #dkfile-modal-container .dkfile-modal-icon,
body.aicode-immersive #dkfile-modal-container .dkfile-modal-icon i {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.aicode-immersive #dkfile-modal-container .dkfile-modal-footer {
  border-top: 1px solid #2a2f38 !important;
}

body.aicode-immersive #dkfile-modal-container .dkfile-modal-title,
body.aicode-immersive #dkfile-modal-container .dkfile-modal-body p,
body.aicode-immersive #dkfile-modal-container .dkfile-modal-body label,
body.aicode-immersive #dkfile-modal-container .dkfile-modal-body span,
body.aicode-immersive #dkfile-modal-container .dkfile-modal-body div {
  color: #e8eaed !important;
  -webkit-text-fill-color: #e8eaed !important;
}

/* —— 粘贴代码弹窗（浅色默认，暗色在下方 body.aicode-immersive 覆盖） —— */
#dkfile-modal-container .dk-paste-modal-root {
  padding: 4px 2px 8px;
  box-sizing: border-box;
}
#dkfile-modal-container .dk-paste-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #ecfdf5;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-left: 3px solid #10b981;
}
#dkfile-modal-container .dk-paste-tip-icon {
  color: #059669;
  font-size: 15px;
  margin-top: 2px;
  flex-shrink: 0;
}
#dkfile-modal-container .dk-paste-tip-body {
  flex: 1;
  min-width: 0;
}
#dkfile-modal-container .dk-paste-tip-title {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 700;
  color: #065f46;
  -webkit-text-fill-color: #065f46;
}
#dkfile-modal-container .dk-paste-tip-text {
  font-size: 12px;
  line-height: 1.5;
  color: #047857;
  -webkit-text-fill-color: #047857;
}
#dkfile-modal-container .dk-paste-textarea {
  width: 100%;
  min-height: 200px;
  max-height: min(42vh, 360px);
  padding: 12px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  background: #f9fafb;
  color: #111827;
  -webkit-text-fill-color: #111827;
  box-sizing: border-box;
  outline: none !important;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-overflow-scrolling: touch;
}
#dkfile-modal-container .dk-paste-textarea:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}
#dkfile-modal-container .dk-paste-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#dkfile-modal-container .dk-paste-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#dkfile-modal-container .dk-paste-btn {
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
#dkfile-modal-container .dk-paste-btn:active {
  transform: scale(0.98);
}
#dkfile-modal-container .dk-paste-btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.28);
}
#dkfile-modal-container .dk-paste-btn-primary,
#dkfile-modal-container .dk-paste-btn-primary *,
#dkfile-modal-container .dk-paste-btn-publish,
#dkfile-modal-container .dk-paste-btn-publish * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
#dkfile-modal-container .dk-paste-btn-outline {
  background: #ffffff;
  border: 1.5px solid #10b981;
}
#dkfile-modal-container .dk-paste-btn-outline,
#dkfile-modal-container .dk-paste-btn-outline * {
  color: #059669 !important;
  -webkit-text-fill-color: #059669 !important;
}
#dkfile-modal-container .dk-paste-btn-publish {
  width: 100%;
  min-height: 48px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
}
#dkfile-modal-container .dk-paste-tip-muted {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f3f4f6;
  border-radius: 10px;
  font-size: 12px;
  color: #6b7280;
  -webkit-text-fill-color: #6b7280;
  text-align: center;
  line-height: 1.45;
}

/* 粘贴代码弹窗：暗色 IDE 覆盖 */
body.aicode-immersive #dkfile-modal-container .dk-paste-tip {
  background: #12261e !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  border-left-color: #10b981 !important;
}
body.aicode-immersive #dkfile-modal-container .dk-paste-tip,
body.aicode-immersive #dkfile-modal-container .dk-paste-tip span,
body.aicode-immersive #dkfile-modal-container .dk-paste-tip strong,
body.aicode-immersive #dkfile-modal-container .dk-paste-tip i,
body.aicode-immersive #dkfile-modal-container .dk-paste-tip div {
  color: #d1fae5 !important;
  -webkit-text-fill-color: #d1fae5 !important;
}
body.aicode-immersive #dkfile-modal-container .dk-paste-tip .dk-paste-tip-icon {
  color: #34d399 !important;
  -webkit-text-fill-color: #34d399 !important;
}
body.aicode-immersive #dkfile-modal-container .dk-paste-tip-title {
  color: #ecfdf5 !important;
  -webkit-text-fill-color: #ecfdf5 !important;
}
body.aicode-immersive #dkfile-modal-container .dk-paste-tip-muted {
  background: #1a1f27 !important;
  color: #9aa3af !important;
  -webkit-text-fill-color: #9aa3af !important;
}
body.aicode-immersive #dkfile-modal-container .dk-paste-tip-muted * {
  color: #9aa3af !important;
  -webkit-text-fill-color: #9aa3af !important;
}
body.aicode-immersive #dkfile-modal-container #mobilePasteCodeTextarea.dk-paste-textarea {
  background: #0a0b0e !important;
  color: #e8eaed !important;
  -webkit-text-fill-color: #e8eaed !important;
  border-color: #2a2f38 !important;
  outline: none !important;
}
body.aicode-immersive #dkfile-modal-container #mobilePasteCodeTextarea.dk-paste-textarea:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22) !important;
}
body.aicode-immersive #dkfile-modal-container .dk-paste-btn-outline {
  background: #14171c !important;
  border-color: #10b981 !important;
}
body.aicode-immersive #dkfile-modal-container .dk-paste-btn-outline,
body.aicode-immersive #dkfile-modal-container .dk-paste-btn-outline * {
  color: #34d399 !important;
  -webkit-text-fill-color: #34d399 !important;
}
body.aicode-immersive #dkfile-modal-container .dk-paste-btn-primary,
body.aicode-immersive #dkfile-modal-container .dk-paste-btn-primary *,
body.aicode-immersive #dkfile-modal-container .dk-paste-btn-publish,
body.aicode-immersive #dkfile-modal-container .dk-paste-btn-publish * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

@media (max-width: 576px) {
  #dkfile-modal-container .dk-paste-textarea {
    min-height: 160px;
    max-height: min(36vh, 280px);
    font-size: 12.5px;
  }
  #dkfile-modal-container .dk-paste-modal-root {
    padding: 0 0 4px;
  }
}

body.aicode-immersive #dkfile-modal-container .dkfile-modal-close {
  color: #9aa3af !important;
  background: transparent !important;
}

body.aicode-immersive #dkfile-modal-container .dkfile-modal-close:hover {
  background: #1e232b !important;
  color: #fff !important;
}

body.aicode-immersive #dkfile-modal-container input,
body.aicode-immersive #dkfile-modal-container textarea,
body.aicode-immersive #dkfile-modal-container select {
  background: #0a0b0e !important;
  color: #e8eaed !important;
  -webkit-text-fill-color: #e8eaed !important;
  border: 1px solid #2a2f38 !important;
}

body.aicode-immersive #dkfile-modal-container .dkfile-modal-btn {
  border-color: #2a2f38 !important;
}

body.aicode-immersive #dkfile-modal-container .dkfile-modal-btn-cancel,
body.aicode-immersive #dkfile-modal-container .dkfile-modal-btn[data-action="cancel"] {
  background: #1e232b !important;
  color: #e8eaed !important;
  -webkit-text-fill-color: #e8eaed !important;
}

body.aicode-immersive #dkfile-modal-container .dkfile-modal-btn-primary,
body.aicode-immersive #dkfile-modal-container .dkfile-modal-btn-confirm,
body.aicode-immersive #dkfile-modal-container .dkfile-modal-btn-success {
  background: #10b981 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #10b981 !important;
}

body.aicode-immersive #dkfile-modal-container .dkfile-modal-btn-danger {
  background: #dc2626 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Toast */
body.aicode-immersive .dkfile-toast {
  background: #14171c !important;
  border-color: #2a2f38 !important;
  color: #e8eaed !important;
  -webkit-text-fill-color: #e8eaed !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
}

body.aicode-immersive .dkfile-toast-generation {
  background: linear-gradient(180deg, #14171c 0%, #0f1a16 100%) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

body.aicode-immersive .dkfile-toast-title {
  color: #34d399 !important;
  -webkit-text-fill-color: #34d399 !important;
}

body.aicode-immersive .dkfile-toast-message {
  color: #e8eaed !important;
  -webkit-text-fill-color: #e8eaed !important;
}

body.aicode-immersive .dkfile-toast-icon-success {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.15) !important;
}

body.aicode-immersive .dkfile-toast-icon-warning {
  color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.12) !important;
}

body.aicode-immersive .dkfile-toast-icon-error {
  color: #f87171 !important;
  background: rgba(248, 113, 113, 0.12) !important;
}

body.aicode-immersive .dkfile-toast-icon-info,
body.aicode-immersive .dkfile-toast-icon-generation {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.15) !important;
}

/* Bootstrap / 页内模态（发布结果、二维码等） */
body.aicode-immersive .modal-content,
body.aicode-immersive .upload-success-modal .modal-content,
body.aicode-immersive .qr-modal-content {
  background: #14171c !important;
  color: #e8eaed !important;
  border: 1px solid #2a2f38 !important;
}

body.aicode-immersive .modal-header,
body.aicode-immersive .modal-footer,
body.aicode-immersive .upload-success-modal .modal-header,
body.aicode-immersive .qr-modal-header,
body.aicode-immersive .qr-modal-footer {
  background: #14171c !important;
  color: #e8eaed !important;
  border-color: #2a2f38 !important;
}

body.aicode-immersive .modal-title,
body.aicode-immersive .modal-body,
body.aicode-immersive .qr-modal-body {
  color: #e8eaed !important;
}

body.aicode-immersive .modal-backdrop.show {
  background-color: #000 !important;
  opacity: 0.72 !important;
}

body.aicode-immersive .btn-close {
  filter: invert(1) grayscale(1);
}

/* —— 发布成功弹窗：与 IDE 暗色统一（去掉刺眼白底卡片） —— */
body.aicode-immersive #publishResultModal .modal-dialog {
  max-width: 640px;
}

body.aicode-immersive #publishResultModal .modal-content {
  background: #14171c !important;
  border: 1px solid #2a2f38 !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55) !important;
  overflow: hidden;
}

body.aicode-immersive #publishResultModal .modal-header {
  background: #0a0b0e !important;
  border-bottom: 1px solid #2a2f38 !important;
  padding: 1rem 1.25rem !important;
}

body.aicode-immersive #publishResultModal .modal-header.bg-success {
  background: #0a0b0e !important;
}

body.aicode-immersive #publishResultModal .modal-title {
  color: #e8eaed !important;
  font-size: 1.05rem !important;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.aicode-immersive #publishResultModal .modal-title .fa-check-circle {
  color: #34d399 !important;
}

body.aicode-immersive #publishResultModal .modal-body {
  background: #14171c !important;
  color: #e8eaed !important;
  padding: 1.15rem 1.25rem 0.85rem !important;
  max-height: min(68vh, 560px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.aicode-immersive #publishResultModal .publish-success-lead,
body.aicode-immersive #publishResultModal .modal-body .text-dark,
body.aicode-immersive #publishResultModal .modal-body h6 {
  color: #a7b0bc !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  margin-bottom: 0.75rem !important;
}

body.aicode-immersive #publishResultModal .publish-success-lead i,
body.aicode-immersive #publishResultModal .modal-body h6 i {
  color: #34d399 !important;
}

body.aicode-immersive #publishResultModal .tool-url-card {
  background: #0a0b0e !important;
  border: 1px solid #2a2f38 !important;
  border-radius: 12px !important;
  padding: 1rem 1.1rem !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

body.aicode-immersive #publishResultModal .tool-url-card:hover {
  border-color: #3a424e !important;
  box-shadow: none !important;
  transform: none !important;
}

body.aicode-immersive #publishResultModal .tool-url-card .tool-name {
  color: #e8eaed !important;
  font-size: 0.88rem;
  margin-bottom: 0.65rem;
  word-break: break-all;
}

body.aicode-immersive #publishResultModal .tool-url-card .tool-name i {
  color: #34d399 !important;
}

body.aicode-immersive #publishResultModal .tool-url-input-group {
  gap: 0.45rem;
  flex-wrap: wrap;
}

body.aicode-immersive #publishResultModal .tool-url-input-group input,
body.aicode-immersive #publishResultModal .tool-url-input-group .form-control {
  flex: 1 1 180px;
  min-width: 0;
  background: #14171c !important;
  border: 1px solid #2a2f38 !important;
  color: #e8eaed !important;
  border-radius: 8px !important;
  font-size: 0.8rem !important;
  padding: 0.55rem 0.75rem !important;
}

body.aicode-immersive #publishResultModal .tool-url-input-group input:focus {
  border-color: #10b981 !important;
  background: #14171c !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18) !important;
  color: #e8eaed !important;
}

body.aicode-immersive #publishResultModal .tool-url-input-group .btn-copy,
body.aicode-immersive #publishResultModal .tool-qrcode-actions .btn-outline-success {
  background: transparent !important;
  border: 1px solid #2a2f38 !important;
  color: #34d399 !important;
  -webkit-text-fill-color: #34d399 !important;
  border-radius: 8px !important;
}

body.aicode-immersive #publishResultModal .tool-url-input-group .btn-copy:hover,
body.aicode-immersive #publishResultModal .tool-qrcode-actions .btn-outline-success:hover {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
  -webkit-text-fill-color: #34d399 !important;
}

body.aicode-immersive #publishResultModal .tool-url-input-group .btn-visit,
body.aicode-immersive #publishResultModal .btn-success,
body.aicode-immersive #publishResultModal a.btn-success,
body.aicode-immersive #publishResultModal a.btn-success:link,
body.aicode-immersive #publishResultModal a.btn-success:visited,
body.aicode-immersive #publishResultModal a.btn-success:hover,
body.aicode-immersive #publishResultModal a.btn-success:focus,
body.aicode-immersive #publishResultModal a.btn-success:active {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

body.aicode-immersive #publishResultModal .tool-qrcode-wrapper-container {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid #2a2f38 !important;
  gap: 0.65rem;
  align-items: stretch;
  height: auto;
}

body.aicode-immersive #publishResultModal .tool-qrcode-container {
  /* 禁止 flex 收缩把二维码挤出边框（此前 min-height:0 + flex-shrink 导致掉出） */
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #14171c !important;
  border: 1px solid #2a2f38 !important;
  border-radius: 10px !important;
  min-height: auto;
  height: auto;
  overflow: visible;
  padding: 0.85rem 0.75rem 1rem !important;
}

body.aicode-immersive #publishResultModal .tool-qrcode-title {
  color: #e8eaed !important;
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}

body.aicode-immersive #publishResultModal .tool-qrcode-title i {
  color: #34d399 !important;
}

body.aicode-immersive #publishResultModal .tool-qrcode-desc {
  color: #8b949e !important;
  margin-bottom: 0.55rem;
}

body.aicode-immersive #publishResultModal .tool-qrcode-wrapper {
  display: inline-block;
  background: #ffffff !important;
  border: 1px solid #2a2f38 !important;
  border-radius: 8px !important;
  padding: 0.55rem !important;
  box-shadow: none !important;
  margin: 0 auto 0.55rem;
  line-height: 0;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

body.aicode-immersive #publishResultModal .tool-qrcode-wrapper img,
body.aicode-immersive #publishResultModal .tool-qrcode-wrapper canvas {
  width: 120px !important;
  height: 120px !important;
  max-width: 100%;
  object-fit: contain;
  display: block;
  vertical-align: top;
}

body.aicode-immersive #publishResultModal .tool-qrcode-ready {
  padding: 0 !important;
  display: block;
  width: 100%;
  text-align: center;
}

body.aicode-immersive #publishResultModal .tool-qrcode-loading,
body.aicode-immersive #publishResultModal .tool-qrcode-error {
  color: #8b949e !important;
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 1.25rem 0.5rem;
  text-align: center;
}

body.aicode-immersive #publishResultModal .tool-qrcode-error {
  color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.25);
  margin: 0.35rem 0;
}

body.aicode-immersive #publishResultModal .modal-footer,
body.aicode-immersive #publishResultModal .upload-modal-footer {
  background: #0a0b0e !important;
  border-top: 1px solid #2a2f38 !important;
  padding: 1rem 1.25rem !important;
}

body.aicode-immersive #publishResultModal .upload-modal-footer .btn {
  min-width: 128px;
  padding: 0.65rem 1.15rem;
  font-weight: 600;
  border-radius: 10px;
}

body.aicode-immersive #publishResultModal .btn-outline-success,
body.aicode-immersive #publishResultModal a.btn-outline-success,
body.aicode-immersive #publishResultModal a.btn-outline-success:link,
body.aicode-immersive #publishResultModal a.btn-outline-success:visited,
body.aicode-immersive #publishResultModal a.btn-outline-success:hover,
body.aicode-immersive #publishResultModal a.btn-outline-success:focus,
body.aicode-immersive #publishResultModal a.btn-outline-success:active {
  background: transparent !important;
  border: 1px solid #10b981 !important;
  color: #34d399 !important;
  -webkit-text-fill-color: #34d399 !important;
}

body.aicode-immersive #publishResultModal .btn-outline-success:hover,
body.aicode-immersive #publishResultModal a.btn-outline-success:hover {
  background: rgba(16, 185, 129, 0.12) !important;
}

@media (max-width: 576px) {
  body.aicode-immersive #publishResultModal .tool-url-input-group .btn-copy,
  body.aicode-immersive #publishResultModal .tool-url-input-group .btn-visit {
    flex: 1 1 auto;
  }
}

/* 生成意图二次确认（对齐 Cursor 问意图） */
.aicode-intent-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.aicode-intent-dialog {
  width: 100%;
  max-width: 440px;
  background: #14171c;
  border: 1px solid #2a2f38;
  border-radius: 12px;
  padding: 18px 18px 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  color: #e8eaed;
}
.aicode-intent-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #f3f4f6;
}
.aicode-intent-summary {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.5;
  color: #9ca3af;
}
.aicode-intent-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.aicode-intent-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #2a2f38;
  border-radius: 10px;
  cursor: pointer;
  background: #0a0b0e;
}
.aicode-intent-option:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}
.aicode-intent-option input {
  margin-top: 3px;
  accent-color: #10b981;
}
.aicode-intent-option:has(input:checked) {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.14);
}
.aicode-intent-option-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.aicode-intent-option-title {
  font-size: 13px;
  font-weight: 600;
  color: #f3f4f6;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.aicode-intent-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #10b981;
  line-height: 1.5;
}
.aicode-intent-option.is-recommended:not(:has(input:checked)) {
  border-color: rgba(16, 185, 129, 0.45);
}
.aicode-intent-option-desc {
  font-size: 11px;
  line-height: 1.45;
  color: #9ca3af;
}
.aicode-intent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.aicode-intent-btn {
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid #2a2f38;
  background: #1a1d23;
  color: #e8eaed;
}
.aicode-intent-btn-cancel:hover {
  border-color: #4b5563;
}
.aicode-intent-btn-ok {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 600;
}
.aicode-intent-btn-ok:hover {
  background: #059669;
  border-color: #059669;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
