:root {
  --brand-primary: #4a7cfd;
  --brand-secondary: #8154fc;
  --brand-gradient: linear-gradient(to right, #4a7cfd, #8154fc);
  --ld-send-size: 35px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f8f9fb;
  overflow: hidden;
}

.app {
  display: flex;
  width: 100%;
  height: 100vh;
  min-height: 0;
}

/* ============ Sidebar ============ */
.sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  transition: width 0.25s ease;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 60px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .logo-sub,
.sidebar.collapsed .new-chat-btn span,
.sidebar.collapsed .nav-item .label,
.sidebar.collapsed .sidebar-history,
.sidebar.collapsed .sidebar-history-title,
.sidebar.collapsed .history-item span {
  display: none;
}

.sidebar.collapsed .logo-area {
  padding: 16px 0;
  justify-content: center;
}

.sidebar.collapsed .nav-list {
  margin: 0 12px;
}

.sidebar.collapsed .new-chat-btn {
  margin: 8px 12px 16px;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.sidebar.collapsed .nav-item {
  padding: 0;
  height: 38px;
  justify-content: center;
  align-items: center;
  margin: 2px 0;
  border-radius: 8px;
  display: flex;
}

.sidebar.collapsed .nav-item .icon {
  width: auto;
  text-align: center;
}

.sidebar.collapsed .sidebar-history-list {
  display: none;
}

.sidebar-history {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 12px;
  border-top: 1px solid #f0f0f0;
}

.sidebar-history-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #999;
  padding: 6px 4px 4px;
  cursor: pointer;
  user-select: none;
}

.sidebar-history-title>span {
  margin-right: auto;
}

.sidebar-history-toggle {
  width: 22px;
  height: 22px;
  margin-left: 2px;
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #b1b5bf;
  font-size: 10px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .2s ease;
}

.sidebar-history-toggle:hover {
  background: #f0f0f4;
  color: #4a7cfd;
}

.sidebar-history.is-collapsed {
  flex: 0 0 auto;
  min-height: 34px;
}

.sidebar-history.is-collapsed .sidebar-history-list {
  display: none;
}

.sidebar-history.is-collapsed .sidebar-history-toggle {
  transform: rotate(-90deg);
}

.sidebar-history-refresh {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #bbb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.15s;
}

.sidebar-history-refresh:hover {
  background: #f0f0f4;
  color: #4a7cfd;
}

.sidebar-history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 4px;
}

.history-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  padding-right: 30px;
  border-radius: 6px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  overflow: hidden;
}

.history-item i {
  font-size: 13px;
  color: #bbb;
  flex-shrink: 0;
}

.history-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item:hover {
  background: #f5f5f8;
  color: #333;
}
.history-item.active {
  border-color: #dce5ff;
  background: #eef3ff;
  color: #315fe8;
}
.history-item.active>i { color: #4a7cfd; }

.history-item:hover>i {
  color: #4a7cfd;
}

/* 三点操作按钮 */
.history-item .history-more {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  opacity: 0;
  transition: all 0.15s;
  flex-shrink: 0;
}

.history-item:hover .history-more {
  opacity: 1;
}

.history-item .history-more:hover {
  background: #e8ebf0;
  color: #4a7cfd;
}

/* 历史记录滚动条 */
.sidebar-history-list::-webkit-scrollbar {
  width: 4px;
}

.sidebar-history-list::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 2px;
  transition: background 0.3s;
}

.sidebar-history-list:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-history-list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 10px 12px 14px;
  border-top: 1px solid #f0f0f0;
}

.sidebar-collapse-btn {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #fafbfe;
  color: #666;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.sidebar-collapse-btn:hover {
  background: #f0edff;
  border-color: #c9bdff;
  color: #4a7cfd;
}

.sidebar-collapse-btn i {
  font-size: 12px;
  transition: transform 0.25s;
}

.sidebar.collapsed .sidebar-footer {
  padding: 10px 8px 14px;
}

.sidebar.collapsed .sidebar-collapse-btn {
  padding: 9px;
  justify-content: center;
  border-radius: 10px;
}

.sidebar.collapsed .collapse-label {
  display: none;
}

.sidebar.collapsed .sidebar-collapse-btn i {
  transform: rotate(180deg);
}

.logo-area {
  padding: 16px 14px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 16px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 24px;
  font-weight: 600;
  color: #4a7cfd;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 11px;
  color: #999;
}

.new-chat-btn {
  margin: 8px 10px 10px;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: #f0edff;
  color: #4a7cfd;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  width: calc(100% - 20px);
}

.new-chat-btn:hover {
  background: #e6dfff;
}

.new-chat-btn.active {
  background: #e6dfff;
}

.new-chat-btn i {
  font-size: 12px;
}

.nav-list {
  flex-shrink: 0;
  padding: 0;
  margin: 0 10px;
}

.nav-list .nav-item:last-child {
  margin-bottom: 0;
}

.sidebar a:not(.nav-item) {
  text-decoration: none;
  color: inherit;
  display: block;
}

.sidebar .new-chat-btn {
  text-decoration: none;
  color: inherit;
}

.nav-item {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #555;
  font-size: 14px;
  margin-bottom: 2px;
  transition: all 0.15s;
  width: 100%;
  text-decoration: none !important;
  box-sizing: border-box;
}

.nav-item:hover {
  background: #f5f5f5;
  color: #333;
}

.nav-item.active {
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  color: white;
}

.nav-item .icon {
  width: 20px;
  font-size: 15px;
  text-align: center;
}

.nav-item .label {
  flex: 1;
}

/* ============ Main Content ============ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex: 0 0 64px;
  z-index: 30;
  background: #fff;

}

.topbar> :first-child {
  min-width: 0;
}

.topbar> :last-child {
  margin-left: auto;
}

.topbar-left-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.sidebar-toggle:hover {
  background: #eef0f4;
  color: #4a7cfd;
}

.topbar-transparent {
  background: #fff;
}

.topbar-with-title {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.topbar-title span {
  font-size: 12px;
  color: #999;
  font-weight: 400;
  margin-left: 8px;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.standard-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.standard-topbar-actions .icon-btn,
.topbar .icon-btn {
  background: #fff;
  border: 1px solid #e8ebf2;
}

.standard-credit {
  height: 36px;
  padding: 0 13px;
  border: 1px solid #e8ebf2;
  border-radius: 18px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #50586a;
  font: inherit;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(34, 50, 100, .04);
}

.standard-credit i,
.standard-credit b {
  color: #ffad0a;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  font-size: 16px;
  transition: all 0.15s;
}

.topbar-transparent .icon-btn {
  background: #fff;
  border: 1px solid #eee;
}

.topbar-with-title .icon-btn {
  background: #fff;
  border: 1px solid #eee;
}

.icon-btn:hover {
  color: #4a7cfd;
  border-color: #8154fc;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9a9e, #fad0c4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.15s;
}

.user-avatar:hover {
  transform: scale(1.05);
}

/* 二级页面统一返回按钮：复用课件生成主页的 64px 干净头部 */
.subpage-back-btn {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #dfe4f3;
  border-radius: 8px;
  background: #fff;
  color: #4a7cfd;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: .16s;
}

.subpage-back-btn:hover {
  border-color: #8154fc;
  background: #f4f6ff;
}

.topbar .subpage-back-btn {
  margin: 0;
}

.global-profile-link {
  text-decoration: none;
}

.standard-topbar-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.page {
  display: none;
  height: 100%;
}

.page.active {
  display: flex;
  flex-direction: column;
}

/* ============ 未开发功能页 ============ */
.development-main {
  background: #f7f8fc;
}

.development-home-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #667085;
  text-decoration: none;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  transition: all 0.15s;
}

.development-home-link:hover {
  color: #4a7cfd;
  border-color: #aebcff;
}

.sidebar-history-refresh.active {
  color: #4a7cfd;
  background: #eef1ff;
}

.development-page {
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 48px 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(111, 134, 255, 0.12), transparent 270px),
    linear-gradient(180deg, #fafbff 0%, #f5f7fc 100%);
}

.development-illustration {
  position: relative;
  width: 112px;
  height: 112px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 32px;
  color: #fff;
  font-size: 38px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  box-shadow: 0 18px 40px rgba(79, 109, 246, 0.24);
}

.development-orbit {
  position: absolute;
  border: 1px solid rgba(79, 109, 246, 0.24);
  border-radius: 50%;
  pointer-events: none;
}

.development-orbit.orbit-one {
  width: 146px;
  height: 146px;
}

.development-orbit.orbit-two {
  width: 184px;
  height: 184px;
  border-style: dashed;
}

.development-page h1 {
  color: #202536;
  font-size: 25px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.development-page p {
  color: #8a91a3;
  font-size: 14px;
  margin-bottom: 26px;
}

.development-primary-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9px;
  color: #fff;
  text-decoration: none;
  background: #4a7cfd;
  box-shadow: 0 8px 18px rgba(79, 109, 246, 0.2);
  transition: transform 0.15s, background 0.15s;
}

.development-primary-link:hover {
  background: #405fe7;
  transform: translateY(-1px);
}

/* ============ 开启新会话页面 ============ */
.page-new-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 0;
}

.greeting {
  font-size: 40px;
  font-weight: 700;
  color: #333;
  margin-bottom: 40px;
}

.greeting .username {
  color: #333;
}

.center-input-wrapper {
  width: 100%;
  max-width: 780px;
}

.center-input-box {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 18px;
  padding: 16px 20px 14px;
  box-shadow: 0 2px 12px rgba(108, 92, 231, 0.06);
  transition: all 0.2s;
}

.center-input-box:focus-within {
  border-color: #8154fc;
  box-shadow: 0 4px 24px rgba(108, 92, 231, 0.14);
}

.center-textarea {
  width: 100%;
  border: none;
  outline: none;
  font-size: 16px;
  color: #333;
  resize: none;
  min-height: 44px;
  max-height: 140px;
  font-family: inherit;
  line-height: 1.6;
}

.center-textarea::placeholder {
  color: #bbb;
}

.input-toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.input-tool-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.input-tool-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.model-select {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
}

.model-select:hover {
  border-color: #8154fc;
}

.model-select .model-name {
  color: #4a7cfd;
  font-weight: 500;
}

.model-select .caret {
  font-size: 10px;
  color: #999;
}

.tool-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
}

.tool-chip:hover {
  border-color: #8154fc;
  color: #4a7cfd;
}

.tool-chip i {
  font-size: 13px;
}

.icon-btn-small {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #888;
  font-size: 16px;
  transition: all 0.15s;
}

.icon-btn-small:hover {
  color: #4a7cfd;
  border-color: #8154fc;
}

.send-btn-main {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 10px rgba(108, 92, 231, 0.3);
}

.send-btn-main:hover {
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.4);
}

/* Quick entries row */
.quick-entries {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.quick-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.quick-entry:hover {
  border-color: #8154fc;
  color: #4a7cfd;
  box-shadow: 0 2px 10px rgba(108, 92, 231, 0.1);
  transform: translateY(-1px);
}

.quick-entry .qe-icon {
  font-size: 16px;
  color: #4a7cfd;
}

.quick-entry .qe-label {
  font-weight: 500;
}

.quick-entry .new-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4757;
  color: white;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}

/* ============ Floating actions ============ */
.floating-actions {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.float-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  font-size: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  transition: all 0.15s;
}

.float-btn:hover {
  border-color: #8154fc;
  color: #4a7cfd;
}

.float-btn .icon {
  font-size: 15px;
  margin-bottom: 2px;
}

/* ============ 登录弹窗 ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-overlay.show {
  display: flex;
}

.login-modal {
  width: 420px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from {
    transform: translateY(-20px) scale(0.97);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.login-header {
  position: relative;
  padding: 28px 32px 0;
  text-align: center;
}

.login-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 22px;
  margin: 0 auto 14px;
}

.login-header h2 {
  font-size: 22px;
  color: #333;
  margin-bottom: 4px;
}

.login-header p {
  font-size: 13px;
  color: #999;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f5f5f5;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 14px;
}

.modal-close:hover {
  background: #eee;
  color: #666;
}

.login-tabs {
  display: flex;
  padding: 0 32px;
  margin-top: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.login-tab {
  flex: 1;
  padding: 12px 0;
  text-align: center;
  font-size: 15px;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.login-tab.active {
  color: #4a7cfd;
  font-weight: 600;
  border-bottom-color: #4a7cfd;
}

.login-body {
  padding: 24px 32px 28px;
}

.login-panel {
  display: none;
}

.login-panel.active {
  display: block;
}

.form-group {
  margin-bottom: 16px;
}

.form-input-wrap {
  position: relative;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  transition: all 0.15s;
}

.form-input-wrap:focus-within {
  border-color: #8154fc;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.form-input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #bbb;
  font-size: 15px;
}

.form-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
}

.form-input::placeholder {
  color: #bbb;
}

.form-toggle-pwd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #bbb;
  cursor: pointer;
  font-size: 14px;
  background: none;
  border: none;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 13px;
}

.form-options label {
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-options .forgot {
  color: #4a7cfd;
  cursor: pointer;
  text-decoration: none;
}

.form-options .forgot:hover {
  text-decoration: underline;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  width: 100%;
  padding: 13px;
  border: 1px solid #4a7cfd;
  border-radius: 10px;
  background: #fff;
  color: #4a7cfd;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-outline:hover {
  background: #f0edff;
}

.divider {
  display: flex;
  align-items: center;
  margin: 22px 0 16px;
  font-size: 12px;
  color: #bbb;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #eee;
}

.divider span {
  padding: 0 12px;
}

.third-party-login {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.tp-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.tp-btn:hover {
  border-color: #8154fc;
  transform: translateY(-2px);
}

.tp-btn i {
  font-size: 18px;
}

.tp-wechat {
  color: #07C160;
}

.tp-qq {
  color: #12B7F5;
}

.tp-weibo {
  color: #E6162D;
}

.tp-phone {
  color: #4a7cfd;
}

/* 注册面板 */
.form-row {
  display: flex;
  gap: 10px;
}

.form-row .form-input-wrap {
  flex: 1;
}

.btn-code {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 12px;
  font-size: 12px;
  background: #f0edff;
  color: #4a7cfd;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-code:hover {
  background: #e6dfff;
}

.captcha-refresh { padding: 2px 5px; background: #fff; }
.captcha-refresh img { display: block; width: 96px; height: 34px; object-fit: contain; }

/* 扫码面板 */
.qrcode-panel {
  text-align: center;
}

.qrcode-box {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.qrcode-box svg {
  width: 100%;
  height: 100%;
}

.qrcode-tip {
  margin-top: 16px;
  font-size: 14px;
  color: #666;
}

.qrcode-tip strong {
  color: #4a7cfd;
}

.qrcode-refresh {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 14px;
  font-size: 12px;
  color: #999;
  cursor: pointer;
}

.qrcode-refresh:hover {
  color: #4a7cfd;
}

.qrcode-refresh i {
  margin-right: 4px;
}

/* 扫码成功动效 */
.qrcode-scanned {
  position: absolute;
  inset: 12px;
  background: rgba(108, 92, 231, 0.9);
  border-radius: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
}

.qrcode-scanned.show {
  display: flex;
  animation: scanFade 0.4s ease;
}

@keyframes scanFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.qrcode-scanned i {
  font-size: 40px;
  margin-bottom: 8px;
}

.user-info-bar {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 160px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: none;
  overflow: hidden;
  z-index: 50;
}

.user-dropdown.show {
  display: block;
}

.user-dropdown-item {
  padding: 10px 16px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-dropdown-item:hover {
  background: #f8f8fa;
  color: #4a7cfd;
}

.user-dropdown-item i {
  width: 16px;
  font-size: 13px;
  text-align: center;
}

.user-dropdown-divider {
  height: 1px;
  background: #f0f0f0;
}

/* ============ Chat Pages ============ */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  padding: 0 24px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 12px;
}

.welcome-msg {
  text-align: center;
  padding: 40px 20px;
}

.welcome-msg .big-title {
  font-size: 32px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}

.welcome-msg .big-title span {
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-msg .sub-text {
  color: #888;
  font-size: 14px;
}

.msg {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
}

.msg.ai {
  flex-direction: row;
}

.msg.user {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 15px;
}

.msg.user .msg-avatar {
  background: linear-gradient(135deg, #ff9a9e, #fad0c4);
}

.msg-bubble {
  max-width: 70%;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.7;
}

.msg.ai .msg-bubble {
  background: #fff;
  border: 1px solid #eee;
  color: #333;
  border-top-left-radius: 4px;
}

.msg.user .msg-bubble {
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  color: white;
  border-top-right-radius: 4px;
}

.tag-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 12px;
  background: #f0edff;
  color: #4a7cfd;
  border-radius: 14px;
  font-size: 12px;
}

.tag.active {
  background: #4a7cfd;
  color: white;
}

.structure-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 18px;
  margin-top: 14px;
}

.structure-card .chapter-title {
  font-weight: 600;
  color: #333;
  font-size: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f5f5f5;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-item {
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fafafa;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.module-title {
  font-size: 14px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-actions .copy-btn {
  color: #bbb;
  font-size: 14px;
  cursor: pointer;
}

.module-content {
  font-size: 13px;
  color: #888;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.module-content li {
  list-style: none;
}

.module-content li::before {
  content: "• ";
  color: #bbb;
}

.add-module {
  border: 1px dashed #4a7cfd;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafaff;
}

.add-module .label {
  font-size: 13px;
  color: #4a7cfd;
  font-weight: 500;
  margin-bottom: 8px;
}

.add-module .btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.add-module .btn {
  padding: 5px 12px;
  font-size: 12px;
  border: 1px solid #e0d8ff;
  background: #fff;
  color: #4a7cfd;
  border-radius: 6px;
  cursor: pointer;
}

.gen-btn {
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 13px;
  width: 100%;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.input-area {
  padding: 14px 0 6px;
  flex-shrink: 0;
}

.input-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tool-btn {
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 18px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn:hover {
  border-color: #8154fc;
  color: #4a7cfd;
}

.tool-btn.active {
  background: #f0edff;
  border-color: #4a7cfd;
  color: #4a7cfd;
}

.input-wrapper {
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  border: 1px solid #eee;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.input-box {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 14px;
  font-size: 14px;
  resize: none;
  max-height: 120px;
  min-height: 44px;
  font-family: inherit;
}

.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

/* ============ 教材百科 ============ */
.qa-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}

.feature-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  text-align: left;
}

.feature-card .f-icon {
  font-size: 22px;
  margin-bottom: 10px;
  color: #4a7cfd;
}

.feature-card .f-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.feature-card .f-desc {
  font-size: 12px;
  color: #888;
}

/* ============ 教学设计 ============ */
.design-layout {
  display: flex;
  gap: 24px;
  height: 100%;
  min-height: 0;
  padding: 0 24px;
}

.design-left {
  width: 380px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.design-right {
  flex: 1;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.design-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.design-tab {
  flex: 1;
  padding: 14px;
  text-align: center;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.design-tab.active {
  color: #4a7cfd;
  border-bottom-color: #4a7cfd;
  font-weight: 600;
}

.outline-list {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.outline-item {
  padding: 11px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #555;
  font-size: 14px;
  margin-bottom: 2px;
}

.outline-item:hover {
  background: #f5f5f5;
}

.outline-item.active {
  background: #f0edff;
  color: #4a7cfd;
  font-weight: 500;
}

.outline-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  flex-shrink: 0;
}

.outline-item.active .dot {
  background: #4a7cfd;
}

.outline-item.done .dot {
  background: #52c41a;
}

.outline-item.done {
  color: #52c41a;
}

.chapter-info {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}

.chapter-info .course-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #fff;
  border-radius: 6px;
  font-size: 12px;
  color: #555;
  margin-bottom: 10px;
}

.chapter-info h3 {
  font-size: 16px;
  color: #333;
}

.design-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px;
}

.design-section {
  margin-bottom: 30px;
}

.design-section-title {
  font-size: 17px;
  font-weight: 600;
  color: #333;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.design-section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  border-radius: 2px;
}

.design-section p {
  font-size: 14px;
  color: #444;
  line-height: 1.9;
}

.design-section .highlight-text {
  background: linear-gradient(180deg, transparent 60%, #f0edff 60%);
  padding: 0 3px;
}

.design-section ul {
  padding-left: 22px;
}

.design-section li {
  font-size: 14px;
  color: #444;
  line-height: 1.9;
  margin-bottom: 6px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 2px;
  transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

*:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

/* ===== GoldDim-style home ===== */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 60;
}

.bg-blob-1 {
  top: -140px;
  left: -100px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #D6DCFF, transparent 70%);
}

.bg-blob-2 {
  top: -80px;
  right: -100px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, #C9E8FF, transparent 70%);
}

.bg-blob-3 {
  bottom: -140px;
  left: 20%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #D7F0FF, transparent 70%);
}

.home-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--app-content-top-gap, 14px) 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-header {
  text-align: center;
  margin-bottom: 20px;
}

.home-header .hero-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(79, 109, 246, 0.3);
}

.home-header h1 {
  font-size: 30px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
}

.home-header h1 .brand {
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-header p {
  font-size: 14px;
  color: #888;
  line-height: 1.8;
}

.home-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 28px;
}

.home-action-btn {
  padding: 9px 18px;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 22px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s;
}

.home-action-btn:hover {
  border-color: #B5C1FC;
  color: #4a7cfd;
  transform: translateY(-1px);
}

.home-action-btn.active {
  background: #EAF0FF;
  border-color: #C3D2FF;
  color: #4a7cfd;
}

.home-action-btn-new {
  position: relative;
}

.cw-path-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.cw-path-new-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #C3D2FF;
  background: #fff;
  color: #4a7cfd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.cw-path-new-btn:hover {
  background: #EAF0FF;
  transform: scale(1.06);
}

.cw-path-line {
  font-size: 13px;
  color: #666;
  line-height: 1;
}

.cw-path-label {
  color: #999;
  margin-right: 2px;
}

.cw-path-arrow {
  font-size: 9px;
  color: #c6c9d2;
  margin: 0 6px;
}

.cw-path-line span:last-child {
  color: #4a7cfd;
}

/* AI 回复卡片视觉 — 和用户右侧气泡明显区分 */
.cw-ai-body {
  max-width: 720px;
}

.cw-user-bubble {
  border-radius: 14px;
}

.badge-new {
  display: inline-block;
  font-size: 10px;
  padding: 0 5px;
  height: 14px;
  line-height: 14px;
  border-radius: 7px;
  background: linear-gradient(135deg, #ff5a7a, #ff9a6c);
  color: #fff;
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
}

/* ===== 课件生成 - 聊天模式 ===== */
.cw-chat {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  /* background: #f5f6fa; */
  overflow: hidden;
}

/* 非 split-mode：消息区独立滚动，底部输入框固定在当前工作区。 */
.cw-chat-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.cw-chat-col::-webkit-scrollbar {
  width: 4px;
}

.cw-chat-col::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 2px;
  transition: background 0.3s;
}

.cw-chat-col:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

.cw-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.cw-chat-messages::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 2px;
  transition: background 0.3s;
}

.cw-chat-messages:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

.cw-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 0 20px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* 生成后双栏布局 —— 直接 fixed 钉住，外层滚不影响 */
.cw-chat.split-mode {
  position: fixed;
  top: 0;
  left: 60px;
  /* 侧边栏收起后宽 60px */
  right: 0;
  bottom: 0;
  z-index: 50;
  flex-direction: row;
  background: transparent;
  height: 100vh;
  width: calc(100vw - 60px);
}

.cw-chat.split-mode .cw-chat-col {
  flex: 0 0 45%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(232, 232, 232, 0.6);
  overflow: hidden;
  height: 100%;
  min-height: 0;
  min-width: 0;
  background: rgba(255, 255, 255, 0.85);
}

.cw-chat.split-mode .cw-preview-col {
  flex: 1;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  min-width: 0;
  background: rgba(255, 255, 255, 0.78);
}

.cw-chat.split-mode .cw-chat-messages {
  width: 100%;
  max-width: none;
  padding: 20px 24px 12px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.cw-chat.split-mode .cw-chat-input {
  padding: 0 0 8px;
  flex-shrink: 0;
  max-width: none;
  margin: 0;
  width: auto;
  position: static;
  z-index: auto;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

.cw-chat.split-mode .cw-chat-input::before {
  display: none;
}

.cw-chat.split-mode .cw-chat-inner {
  max-width: none;
  padding: 0;
}

.cw-chat.split-mode .cw-chat-input-row {
  padding: 6px 24px 0;
}

.cw-chat.split-mode .cw-path-row {
  display: none;
}

/* AI 靠左（固定 500px），用户靠右 */
.cw-chat.split-mode .cw-ai-msg {
  padding: 0;
  justify-content: flex-start;
}

.cw-chat.split-mode .cw-user-msg {
  padding: 0;
  justify-content: flex-end;
}

.cw-chat.split-mode .cw-ai-body {
  width: 320px;
  max-width: 320px;
}

.cw-chat.split-mode .cw-user-bubble {
  max-width: 60%;
}

/* split-mode 时隐藏 topbar */
body.split-mode-active #topbar {
  display: flex !important;
}

/* 右侧课件预览面板 */
.cw-preview-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  min-width: 0;
  overflow: hidden;
}

.cw-preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #eef0f4;
  flex-shrink: 0;
  background: #fff;
}

.cw-preview-topbar .left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cw-preview-topbar .cw-preview-directory-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid #e6e8ef;
  border-radius: 8px;
  background: #f8f9fc;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: all 0.15s;
}

.cw-preview-topbar .cw-preview-directory-btn:hover {
  background: #eef0f6;
  border-color: #d6dae4;
}

.cw-preview-topbar .right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cw-preview-topbar .cw-preview-edit-btn,
.cw-preview-topbar .cw-preview-download-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.cw-preview-topbar .cw-preview-edit-btn {
  background: #f4f5f8;
  color: #555;
}

.cw-preview-topbar .cw-preview-edit-btn:hover {
  background: #e8eaf0;
  color: #333;
}

.cw-preview-topbar .cw-preview-download-btn {
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  color: #fff;
}

.cw-preview-topbar .cw-preview-download-btn:hover {
  filter: brightness(1.05);
}

.cw-preview-topbar .cw-preview-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #e6e8ef;
  background: #fff;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.15s;
}

.cw-preview-topbar .cw-preview-close-btn:hover {
  background: #fff0f0;
  border-color: #ffd4d4;
  color: #ff4d4f;
}

.cw-preview-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.cw-preview-sidebar {
  width: 130px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.55);
  padding: 16px 12px;
  overflow-y: auto;
  display: block;
  border-right: 1px solid rgba(229, 230, 235, 0.8);
}

.cw-preview-sidebar::-webkit-scrollbar {
  width: 4px;
}

.cw-preview-sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 2px;
  transition: background 0.3s;
}

.cw-preview-sidebar:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
}

.cw-preview-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* 目录列表 */
.cw-preview-dir-list {
  position: relative;
  padding: 8px 0;
}

/* 贯穿竖线：从第一个 marker 中心到最后一个 marker 中心 */
.cw-preview-dir-list::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 26px;
  /* 第一个 marker 中心 */
  bottom: 14px;
  /* 最后一个 marker 中心 */
  width: 2px;
  background: #e4e7ee;
  border-radius: 1px;
}

.cw-preview-dir-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 6px 8px 30px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.cw-preview-dir-item:hover {
  color: #4a7cfd;
  background: transparent;
}

.cw-preview-dir-item.active {
  color: #4a7cfd;
  font-weight: 600;
}

/* 左侧圆点/对勾容器 — 叠在贯穿竖线上 */
.cw-preview-dir-item .dir-marker {
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #e4e7ee;
  color: #e4e7ee;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
  transition: all 0.2s;
}

.cw-preview-dir-item.done .dir-marker {
  background: #4a7cfd;
  border-color: #4a7cfd;
  color: #fff;
}

.cw-preview-dir-item.active .dir-marker {
  background: #4a7cfd;
  border-color: #4a7cfd;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(79, 109, 246, 0.15);
}

.cw-preview-dir-item.generating .dir-marker {
  background: #a0b4f9;
  border-color: #a0b4f9;
  color: #fff;
}

/* loading 小圆点 */
.cw-preview-dir-item .loader {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4a7cfd;
  animation: cw-pulse 1s ease-in-out infinite;
  vertical-align: middle;
}

.cw-preview-main {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px;
  background: transparent;
  min-width: 0;
}

.cw-preview-main::-webkit-scrollbar {
  width: 4px;
}

.cw-preview-main::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 2px;
  transition: background 0.3s;
}

.cw-preview-main:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
}

.cw-preview-main::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.cw-preview-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 32px 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eef0f4;
}

.cw-preview-module-block:first-child .cw-preview-title {
  margin-top: 0;
}

.cw-preview-module-block p {
  font-size: 15px;
  color: #555;
  line-height: 1.9;
  margin: 0 0 6px;
}

/* 确认生成卡片 */
.cw-confirm-card {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.cw-confirm-text {
  font-size: 14px;
  color: #333;
  margin-bottom: 14px;
}

.cw-confirm-doc {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f0f3ff, #e8edff);
  border-radius: 10px;
}

.cw-confirm-doc-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.cw-confirm-doc-info {
  flex: 1;
  min-width: 0;
}

.cw-confirm-doc-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-confirm-doc-meta {
  font-size: 12px;
  color: #888;
}

.cw-confirm-doc-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.cw-confirm-doc-actions button {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: #4a7cfd;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.cw-confirm-doc-actions button:hover {
  background: #fff;
}

.cw-user-msg {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  padding: 0;
}

.cw-user-bubble {
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px 4px 14px 14px;
  font-size: 13px;
  line-height: 1.9;
  max-width: 60%;
  box-shadow: 0 2px 8px rgba(79, 109, 246, 0.2);
}

.cw-user-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.cw-user-row span {
  color: #fff;
  font-weight: 500;
}

.cw-ai-msg {
  display: flex;
  margin-bottom: 20px;
  padding: 0;
}

.cw-ai-body {
  width: 500px;
  max-width: 365px;
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.cw-chapter-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #F8FAFF;
  border: 1px solid #E0E7FF;
  border-radius: 10px;
  margin-bottom: 16px;
}

.cw-chapter-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.cw-chapter-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.cw-module-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.cw-module-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 10px;
  font-size: 14px;
  color: #333;
  transition: all 0.15s;
}

.cw-module-item:hover {
  border-color: #D6DCFF;
  background: #FAFBFF;
}

.cw-module-drag {
  color: #ccc;
  cursor: grab;
  font-size: 12px;
  padding: 6px 4px;
  border-radius: 6px;
  outline: none;
  touch-action: none;
}

.cw-module-drag:hover,
.cw-module-drag:focus-visible {
  color: #4a7cfd;
  background: #edf2ff;
}

.cw-module-item.dragging {
  opacity: .48;
  border-color: #7f9cff;
  background: #eef3ff;
  box-shadow: 0 8px 20px rgba(74, 124, 253, .18);
}

.cw-module-item.dragging .cw-module-drag {
  cursor: grabbing;
}

.cw-module-list.dragging-list {
  user-select: none;
}

.cw-module-name {
  flex: 1;
}

.cw-module-del {
  color: #bbb;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
}

.cw-module-del:hover {
  color: #ff5a5a;
  background: #fff0f0;
}

.cw-add-module {
  background: #F8FAFF;
  border: 1px dashed #C3D2FF;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.cw-add-label {
  font-size: 13px;
  color: #4a7cfd;
  font-weight: 600;
  margin-bottom: 10px;
}

.cw-add-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cw-add-btn {
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #e0d8ff;
  border-radius: 14px;
  font-size: 12px;
  color: #4a7cfd;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.cw-add-btn i {
  font-size: 10px;
}

.cw-add-btn:hover {
  background: #F0F3FF;
  border-color: #B5C1FC;
}

.cw-add-btn.added {
  background: #F0F3FF;
  border-color: #B5C1FC;
  opacity: 0.5;
  cursor: default;
}

.cw-add-btn.added:hover {
  background: #F0F3FF;
}

.cw-add-btn.added i::before {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
}

.cw-gen-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(79, 109, 246, 0.3);
}

.cw-gen-btn:hover {
  box-shadow: 0 6px 24px rgba(79, 109, 246, 0.4);
  transform: translateY(-1px);
}

.cw-chat-input {
  flex: 0 0 auto;
  padding: 16px 0 20px;
  border-top: none;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 5;
  isolation: isolate;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -12px 28px rgba(255, 255, 255, 0.92);
}

.cw-chat-input::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  top: -72px;
  height: 72px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.78) 58%, rgba(255, 255, 255, 0.98) 100%);
}

.cw-chat-inner {
  position: relative;
  z-index: 1;
  padding: 0;
}

.cw-chat-input-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 0px;
  background: #fff;
  border: 1px solid #B5C1FC;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(79, 109, 246, 0.12);
  transition: all 0.2s;
}

.cw-chat-input-row:focus-within {
  border-color: #B5C1FC;
  box-shadow: 0 4px 20px rgba(79, 109, 246, 0.12);
}

.cw-chat-input-row textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 14px;
  color: #1a1a1a;
  min-height: 60px;
  max-height: 180px;
  font-family: inherit;
  line-height: 1.7;
  padding: 4px 0;
}

.cw-chat-input-row textarea::placeholder {
  color: #bbb;
}

.cw-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  border-top: 1px solid #f4f4f7;
}

.cw-input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cw-polish-btn {
  height: 38px;
  font-size: 13px;
  padding: 0 18px;
  border-radius: 10px;
  background: #f4f5f8;
  border: none;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.cw-polish-btn i {
  font-size: 13px;
}

.cw-polish-btn:hover {
  background: #EAF0FF;
  color: #4a7cfd;
}

.home-model-select i {
  font-size: 13px;
  color: #4a7cfd;
}

.home-input-wrap {
  width: 100%;
  max-width: 780px;
  margin-bottom: 24px;
}

.home-input-box {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 18px;
  padding: 16px 20px 12px;
  box-shadow: 0 2px 12px rgba(79, 109, 246, 0.05);
  transition: all 0.2s;
}

.home-input-box:focus-within {
  border-color: #B5C1FC;
  box-shadow: 0 4px 24px rgba(79, 109, 246, 0.12);
}

.home-textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 15px;
  color: #1a1a1a;
  min-height: 44px;
  max-height: 140px;
  font-family: inherit;
  line-height: 1.7;
  background: transparent;
}

.home-textarea::placeholder {
  color: #bbb;
}

.home-input-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.home-input-foot .left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.home-input-foot .right {
  display: flex;
  gap: 6px;
  align-items: center;
}

.home-chip {
  padding: 5px 12px;
  background: #F0F3FF;
  border: none;
  border-radius: 14px;
  font-size: 12px;
  color: #4a7cfd;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.home-chip:hover {
  background: #E0E4FC;
}

.home-chip.secondary {
  background: #f5f6fb;
  color: #555;
}

.home-chip.secondary:hover {
  color: #4a7cfd;
}

/* ===== 课件生成 - 链式标签输入 ===== */
.courseware-input-wrap {
  width: 100%;
  max-width: 1000px;
  margin-bottom: 24px;
  position: relative;
}

.courseware-input-box {
  background: #fff;
  border: 1px solid #B5C1FC;
  border-radius: 18px;
  padding: 14px 20px 12px;
  box-shadow: 0 4px 24px rgba(79, 109, 246, 0.12);
  transition: all 0.2s;
}

.courseware-input-box:focus-within {
  border-color: #B5C1FC;
  box-shadow: 0 4px 24px rgba(79, 109, 246, 0.12);
}

.chain-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f5f6fb;
}

.chain-label {
  font-size: 15px;
  font-weight: 700;
  color: #4a7cfd;
}

.chain-sep {
  width: 1px;
  height: 14px;
  background: #e5e7ed;
  margin: 0 4px;
}

.chain-chip {
  padding: 4px 10px;
  background: #F0F3FF;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  color: #4a7cfd;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  font-weight: 500;
}

.chain-chip:hover {
  background: #E0E4FC;
  border-color: #D6DCFF;
}

.chain-chip.active {
  background: #fff;
  border-color: #4a7cfd;
  color: #4a7cfd;
  box-shadow: 0 2px 8px rgba(79, 109, 246, 0.15);
}

.chain-chip.fixed {
  background: transparent;
  border: none;
  color: #333;
  cursor: default;
  font-weight: 500;
}

.chain-chip.fixed:hover {
  background: #f5f6fb;
  color: #333;
  border: none;
}

.chain-chip i {
  font-size: 9px;
  opacity: 0.6;
}

.chain-chip.active i {
  opacity: 1;
}

.courseware-textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 14px;
  color: #1a1a1a;
  min-height: 36px;
  max-height: 120px;
  font-family: inherit;
  line-height: 1.7;
  background: transparent;
}

.courseware-textarea::placeholder {
  color: #bbb;
}

.courseware-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.courseware-foot .left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.courseware-foot .right {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* 链式下拉面板 */
.chain-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
  display: none;
  overflow: hidden;
  z-index: 60;
  animation: chainDrop 0.18s ease;
}

.chain-dropdown.show {
  display: block;
}

@keyframes chainDrop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chain-dropdown-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #f5f6fb;
  background: #fafbfd;
}

.chain-dropdown-search i {
  font-size: 13px;
  color: #aaa;
}

.chain-dropdown-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: #333;
  background: transparent;
}

.chain-dropdown-search input::placeholder {
  color: #bbb;
}

.chain-dropdown-body {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px 0;
}

.chain-dropdown-body::-webkit-scrollbar {
  width: 6px;
}

.chain-dropdown-body::-webkit-scrollbar-thumb {
  background: #e0e0e0;
  border-radius: 3px;
}

/* 层级列表项 */
.chain-item {
  padding: 9px 16px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.1s;
}

.chain-item:hover {
  background: #F0F3FF;
}

.chain-item.selected {
  color: #4a7cfd;
  background: #F9FAFF;
  font-weight: 500;
}

.cw-term-btns {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.cw-term-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid #e2e6f0;
  color: #888;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.cw-term-btn:hover {
  border-color: #4a7cfd;
  color: #4a7cfd;
}

.cw-term-btn.active {
  background: #4a7cfd;
  color: #fff;
  border-color: #4a7cfd;
}

.toast {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translate(-50%, -20px);
  padding: 10px 20px;
  border-radius: 10px;
  background: #fff;
  color: #333;
  font-size: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
  border: 1px solid #f0f0f4;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-error {
  color: #e54d42;
  border-left: 3px solid #e54d42;
}

.toast-error i {
  color: #e54d42;
  font-size: 16px;
}

.toast-success {
  color: #22a06b;
  border-left: 3px solid #22a06b;
}

.toast-success i {
  color: #22a06b;
}

.toast-info {
  color: #4a7cfd;
  border-left: 3px solid #4a7cfd;
}

.toast-info i {
  color: #4a7cfd;
}

.chain-item.selected::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-left: auto;
  font-size: 11px;
  color: #4a7cfd;
}

.chain-item .caret {
  font-size: 10px;
  color: #bbb;
  margin-left: auto;
  transition: transform 0.15s;
}

.chain-item .caret.open {
  transform: rotate(90deg);
  color: #4a7cfd;
}

.chain-group-title {
  padding: 10px 16px 4px;
  font-size: 11px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.chain-children {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.chain-children.open {
  max-height: 2000px;
}

.chain-child {
  padding: 7px 16px 7px 40px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.1s;
}

.chain-child:hover {
  background: #f5f6fb;
  color: #333;
}

.chain-child.selected {
  color: #4a7cfd;
  font-weight: 500;
}

.chain-child.selected::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-left: auto;
  font-size: 10px;
}

.chain-subchildren {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.chain-subchildren.open {
  max-height: 2000px;
}

.chain-subchild {
  padding: 6px 16px 6px 56px;
  font-size: 12px;
  color: #888;
  cursor: pointer;
  display: block;
  transition: all 0.1s;
}

.chain-subchild:hover {
  background: #f5f6fb;
  color: #555;
}

.chain-subchild.selected {
  color: #4a7cfd;
  font-weight: 500;
  background: #F9FAFF;
}

.home-model-select {
  position: relative;
}

.home-model-btn {
  padding: 5px 12px;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 14px;
  font-size: 12px;
  color: #4a7cfd;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
  font-weight: 500;
}

.home-model-btn:hover {
  border-color: #B5C1FC;
  background: #F0F3FF;
}

.home-model-btn .model-caret {
  font-size: 9px;
  color: #999;
  margin-left: 2px;
}

.home-model-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: none;
  overflow: hidden;
  z-index: 50;
}

.home-model-dropdown.show {
  display: block;
  animation: modelDrop 0.15s ease;
}

@keyframes modelDrop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.model-group {
  padding: 6px 0;
}

.model-group-label {
  padding: 6px 14px;
  font-size: 11px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.model-option {
  padding: 9px 14px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.1s;
}

.model-option:hover {
  background: #f5f6fb;
}

.model-option.active {
  color: #4a7cfd;
  background: #F9FAFF;
  font-weight: 500;
}

.model-option.active::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-left: auto;
  font-size: 11px;
}

.model-option .model-tag {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 8px;
  background: #F0F3FF;
  color: #4a7cfd;
  margin-left: auto;
  font-weight: 500;
}

.model-option.active .model-tag {
  margin-left: 0;
}

.model-option .model-tag.pro {
  background: #FFF3E0;
  color: #ef6c00;
}

.model-option .model-tag.fast {
  background: #E8F5E9;
  color: #2e7d32;
}

.model-option .model-tag.vision {
  background: #FCE4EC;
  color: #c2185b;
}

.model-sep {
  height: 1px;
  background: #f0f0f0;
  margin: 4px 0;
}

.home-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.15s;
}

.home-icon-btn:hover {
  color: #4a7cfd;
  background: #f5f6fb;
}

.home-send-btn {
  width: var(--ld-send-size);
  min-width: var(--ld-send-size);
  height: var(--ld-send-size);
  flex: 0 0 var(--ld-send-size);
  padding: 0;
  border-radius: 10px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(79, 109, 246, 0.3);
}

.home-send-btn i {
  font-size: 15px;
}

.home-send-btn:hover {
  box-shadow: 0 4px 16px rgba(79, 109, 246, 0.4);
}

.home-recommend {
  padding: 10px 22px;
  background: #EEF5FF;
  border-radius: 20px;
  font-size: 13px;
  color: #2B6CB0;
  margin-bottom: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}

.home-recommend:hover {
  background: #DCEBFF;
}

.home-recommend i {
  font-size: 13px;
}

.home-cats {
  display: flex;
  gap: 28px;
  margin-bottom: 26px;
  width: 100%;
  flex-wrap: wrap;
}

.home-cat {
  font-size: 14px;
  color: #888;
  cursor: pointer;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.home-cat:hover {
  color: #4a7cfd;
}

.home-cat.active {
  color: #4a7cfd;
  font-weight: 600;
  border-bottom-color: #4a7cfd;
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

.home-card {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.home-card:hover {
  box-shadow: 0 6px 24px rgba(79, 109, 246, 0.1);
  transform: translateY(-2px);
  border-color: #D6DCFF;
}

.home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.home-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.home-card-title i {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #F0F3FF;
  color: #4a7cfd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.home-card-do {
  padding: 4px 12px;
  background: #F0F3FF;
  border: none;
  border-radius: 12px;
  font-size: 12px;
  color: #4a7cfd;
  cursor: pointer;
}

.home-card-do:hover {
  background: #E0E4FC;
}

.home-card-img {
  width: 100%;
  height: 175px;
  border-radius: 10px;
  margin-bottom: 12px;
  background-size: cover;
  background-position: center;
}

.home-card-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 12px;
  min-height: 38px;
}

.home-card-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #aaa;
  padding-top: 10px;
  border-top: 1px solid #f5f6fb;
}

/* Register link style */
.register-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: #999;
}

.register-link a {
  color: #4a7cfd;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}

.register-link a:hover {
  text-decoration: underline;
}

/* btn-outline */
.btn-outline {
  width: 100%;
  padding: 13px;
  border: 1px solid #4a7cfd;
  border-radius: 10px;
  background: #fff;
  color: #4a7cfd;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-outline:hover {
  background: #F0F3FF;
}


/* ============ 生成动画 ============ */
.cw-preview-generating-note {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #71809c;
  font-size: 14px;
}

.cw-preview-generating-note span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4a7cfd;
  box-shadow: 14px 0 0 rgba(74, 124, 253, .55), 28px 0 0 rgba(74, 124, 253, .25);
  margin-right: 28px;
  animation: cw-generating-dots 1s ease-in-out infinite;
}

.cw-preview-module-block.is-generating::after {
  content: '▊';
  display: inline-block;
  margin-left: 3px;
  color: #4a7cfd;
  animation: cw-blink .8s step-end infinite;
}

.cw-stream-item {
  animation: cw-stream-in .24s ease both;
}

@keyframes cw-generating-dots {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

@keyframes cw-stream-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cw-preview-dir-item.hidden {
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
}

.cw-preview-dir-item {
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s;
}

.cw-preview-dir-item.generating {
  background: rgba(79, 109, 246, 0.06);
}

.cw-preview-dir-item.generating .dir-marker i {
  display: none;
}

.cw-preview-dir-item.generating .loader {
  display: block;
  margin-right: 0;
}

.cw-preview-dir-item.done .loader {
  display: none;
}

.cw-preview-dir-item.done .dir-marker i {
  display: inline-block;
}

@keyframes cw-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.7);
  }
}

/* 打字光标闪烁 */
.typing-area.typing::after {
  content: '▊';
  display: inline-block;
  color: #4a7cfd;
  margin-left: 2px;
  animation: cw-blink 0.8s step-end infinite;
  font-weight: 700;
}

@keyframes cw-blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* 模块淡入 */
.cw-preview-module {
  animation: cw-fade-in 0.3s ease;
}

@keyframes cw-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ============ 右侧思维导图 ============ */
.cw-preview-main {
  overflow-y: auto;
  padding: 28px 36px;
  background: transparent;
}

.cw-mindmap {
  padding: 20px 0;
}

.mm-branch {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #eef0f4;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s;
}

.mm-branch:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.mm-branch.mm-hidden {
  display: none;
}

/* 左侧模块中心框 */
.mm-center {
  flex-shrink: 0;
  width: 96px;
  padding: 12px 10px;
  background: linear-gradient(to right, #4a7cfd, #8154fc);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(79, 109, 246, 0.3);
  position: relative;
  word-break: break-all;
}

.mm-center::after {
  content: '';
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 2px;
  background: #c3cdee;
}

/* 右侧要点容器 */
.mm-leaves {
  flex: 1;
  position: relative;
  padding-left: 0;
}

/* 贯穿竖线 */
.mm-leaves::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: #c3cdee;
  border-radius: 1px;
}

.mm-leaf {
  position: relative;
  padding: 10px 16px 10px 20px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid #dfe4ef;
  border-radius: 10px;
  transition: all 0.25s ease;
  opacity: 1;
  transform: none;
}

.mm-leaf.mm-leaf-hidden {
  opacity: 0;
  transform: translateX(12px);
}

.mm-leaf:hover {
  border-color: #4a7cfd;
  box-shadow: 0 2px 8px rgba(79, 109, 246, 0.12);
}

/* 连接横线 */
.mm-leaf::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 2px;
  background: #c3cdee;
}

/* 连接圆点 */
.mm-leaf::after {
  content: '';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4a7cfd;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #c3cdee;
  z-index: 1;
}

.mm-leaf-label {
  font-size: 13px;
  font-weight: 600;
  color: #4a7cfd;
  margin-bottom: 4px;
}

.mm-leaf-text {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}

/* 最后一个要点去掉下边距 */
.mm-leaves .mm-leaf:last-child {
  margin-bottom: 0;
}

/* ===== 左侧历史记录最终布局：与主导航对齐 ===== */
.sidebar-history {
  padding: 0 10px;
}

.sidebar-history-title {
  width: 100%;
  min-height: 40px;
  padding: 0 8px 0 14px;
  border-radius: 8px;
  color: #555;
  font-size: 14px;
  cursor: default;
}

.sidebar-history-title:hover {
  background: #f7f7fa;
}

.sidebar-history-title .sidebar-history-entry,
.sidebar a.sidebar-history-entry:not(.nav-item) {
  flex: 1;
  width: auto;
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.sidebar-history-title .sidebar-history-entry.active {
  color: #4a7cfd;
}

.sidebar-history-icon {
  width: 20px;
  flex: 0 0 20px;
  text-align: center;
  font-size: 15px;
}

.sidebar-history-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.sidebar-history-toggle {
  flex: 0 0 22px;
  margin-left: 2px;
}

.sidebar-history-list {
  gap: 6px;
  padding: 5px 2px 8px;
}

.history-item {
  min-height: 32px;
  padding: 6px 30px 6px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  flex-shrink: 0;
}

.history-item:hover {
  border-color: #eceef5;
  background: #f7f8fc;
}

.sidebar-history.is-collapsed {
  min-height: 41px;
}

.sidebar-history.is-collapsed .sidebar-history-title {
  margin-bottom: 0;
}

/* 多角色登录、学校注册 */
.register-school-wrap select { appearance:none; cursor:pointer; padding-right:36px; }
.register-school-tip { margin:6px 4px 0; color:#9aa1b2; font-size:12px; line-height:1.5; }
.role-choice-overlay,.school-notice-overlay { z-index:1500; }
.role-choice-panel { position:relative; width:min(920px,calc(100vw - 42px)); padding:36px; border-radius:24px; background:#fff; box-shadow:0 30px 90px rgba(32,45,95,.22); }
.role-choice-brand { display:flex; align-items:center; gap:10px; color:#4a7cfd; font-size:18px; font-weight:800; }
.role-choice-brand img { width:42px; height:42px; border-radius:12px; }
.role-choice-panel h2 { margin:22px 0 8px; color:#151927; font-size:28px; }
.role-choice-panel>p { margin:0 0 28px; color:#8b92a4; font-size:14px; }
.role-choice-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.role-choice-card { position:relative; min-height:230px; padding:28px; overflow:hidden; border:1px solid #e3e8f4; border-radius:20px; text-align:left; cursor:pointer; transition:.22s ease; }
.role-choice-card.school { background:linear-gradient(135deg,#eef5ff,#f5fbff); }
.role-choice-card.teacher { background:linear-gradient(135deg,#eefcf7,#f5fffa); }
.role-choice-card:hover { transform:translateY(-4px); border-color:#8fa3ff; box-shadow:0 18px 42px rgba(79,109,246,.15); }
.role-choice-copy { position:relative; z-index:2; display:flex; flex-direction:column; max-width:58%; }
.role-choice-copy small { color:#7d879e; font-size:13px; }
.role-choice-copy b { margin:10px 0; color:#171c2c; font-size:24px; }
.role-choice-copy em { color:#747d91; font-size:13px; font-style:normal; line-height:1.7; }
.role-choice-visual { position:absolute; right:28px; bottom:28px; width:150px; height:145px; display:grid; place-items:center; border-radius:28px; color:#fff; font-size:68px; }
.school .role-choice-visual { background:linear-gradient(to right, #4a7cfd, #8154fc); }
.teacher .role-choice-visual { background:linear-gradient(135deg,#35c88a,#75dfb3); }
.role-choice-arrow { position:absolute; left:28px; bottom:26px; color:#4a7cfd; }
.school-notice-card { text-align:center; }
.school-notice-icon { width:54px; height:54px; margin:auto; display:grid; place-items:center; border-radius:17px; background:#fff4e8; color:#ff922f; font-size:25px; }
.school-notice-card h3 { margin:18px 0 10px; font-size:20px; }
.school-notice-card p { margin:0; color:#727b8f; font-size:14px; line-height:1.8; }
.school-notice-actions { margin-top:24px; display:flex; justify-content:center; gap:12px; }
.school-notice-actions button { height:40px; padding:0 18px; border:1px solid #dde2ec; border-radius:10px; background:#fff; color:#626b7e; cursor:pointer; }
.school-notice-actions button.primary { border-color:#4a7cfd; background:#4a7cfd; color:#fff; }
@media(max-width:760px){.role-choice-grid{grid-template-columns:1fr}.role-choice-card{min-height:190px}.role-choice-visual{width:120px;height:115px;font-size:52px}.role-choice-panel{padding:26px}}
