/* Ant Design X learning workspace. 264px navigation + fluid 1100px canvas;
   shared 40px gutters and 16px gaps align greeting, prompts and composer. */
:root {
  --chrome: #f3f6f3; --ground: #ffffff; --surface: #f5f7f4;
  --text: #203632; --muted: #62726b; --faint: #68776f;
  --accent: #1b6e66; --accent-tint: #eaf3ef; --primary: #1b6e66;
  --border: #e2e8e2; --rule: #eaf0ea; --control: #ced9d1;
  --font-sans: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --font-serif: "STSong", "Songti SC", "SimSun", Georgia, serif;
  --sidebar-width: 264px; --radius-card: 14px; --radius-control: 8px;
}
[hidden] { display: none !important; }
html, body { height: 100%; height: 100dvh; overflow: hidden; }
body { font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: .55; }
::selection { background: #cbe3d8; color: #183e34; }
* { scrollbar-width: thin; scrollbar-color: #cdd8d0 transparent; }
.topbar { height: 60px; padding: 0 26px; gap: 12px; border-bottom: 1px solid var(--border); }
.topbar-title { font-size: 14px; letter-spacing: .01em; }
.topbar-separator { color: #b5c1b9; padding: 0 12px; font-weight: 400; }
.topbar-scope { font-weight: 400; color: var(--muted); }
.topbar-right { gap: 16px; }
#newChatBtn { background: transparent; color: var(--text); border: 1px solid var(--control); border-radius: 8px; height: 34px; font-size: 13px; }
#newChatBtn:hover { background: #e8eeE8; opacity: 1; }
#newChatBtn span { margin-right: 4px; }
.user-chip { font-family: inherit; border: 0; background: transparent; padding-right: 0; }
.user-avatar { background: #e0e9e1; color: #28564a; }
.user-menu { top: 54px; right: 140px; }
.sidebar { border-right: 1px solid var(--border); }
.sidebar-panel { padding: 28px 14px 0; }
.side-brand { padding: 0 10px 25px; gap: 12px; }
.mark { width: 34px; height: 38px; }
.side-brand-name { font-size: 17px; letter-spacing: .03em; }
.side-brand-scope { font-size: 11px; margin-top: 5px; color: var(--muted); }
.chapter-search-wrap { display: flex; align-items: center; gap: 8px; padding: 0 10px; background: #eaf0e9; border: 1px solid transparent; border-radius: 8px; color: var(--muted); height: 37px; flex: none; }
.chapter-search-wrap:focus-within { border-color: var(--accent); }
.chapter-search-wrap input { width: 100%; min-width: 0; background: transparent; outline: 0; border: 0; font-size: 12px; color: var(--text); }
.chapter-search-wrap input::placeholder { color: #65756c; }
.chapter-search-wrap kbd { font-family: inherit; font-size: 11px; color: #718076; border: 1px solid #cfd9d0; padding: 0 4px; border-radius: 3px; }
.side-tabs { margin-top: 18px; padding: 0 8px; gap: 26px; }
.side-tab { padding: 11px 0; font-size: 12px; }
.tab-page { flex: 1; overflow-y: auto; padding-top: 2px; min-height: 0; }
.chapter-list { overflow: visible; padding: 0 0 16px; }
.group-title { font-size: 11px; padding: 24px 10px 9px; color: #617267; line-height: 1.4; }
.chapter-item { display: flex; gap: 8px; align-items: baseline; width: 100%; font-size: 13px; line-height: 1.65; border-radius: 7px; padding: 9px 10px; margin: 1px 0; text-align: left; }
.chapter-item .no { font-size: 11px; color: #627467; flex: 0 0 48px; margin: 0; }
.chapter-name { min-width: 0; }
.chapter-item:hover { background: #e8eee8; }
.chapter-item.active { background: #e0e9e2; color: #164d42; }
.chapter-item.active .no { color: #466c5d; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 17px 10px; margin-top: auto; }
.foot-row { font-size: 11px; gap: 7px; }
.foot-row.dim { font-size: 11px; margin-top: 7px; }
.dot { width: 6px; height: 6px; }
.sheet { border: 0; border-radius: 0; margin: 0; }
.chat-scroll { overscroll-behavior: contain; scroll-behavior: auto; }
.home { max-width: 1100px; padding: 26px 40px 32px; }
.home-head { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 32px; align-items: center; margin: 0 0 26px; }
.course-kicker { color: var(--accent); font-size: 12px; margin-bottom: 16px; }
.greeting { font-family: var(--font-serif); font-size: 32px; font-weight: 500; letter-spacing: .015em; line-height: 1.35; margin: 0; }
.welcome-line { font-size: 17px; margin-top: 9px; letter-spacing: .015em; color: #3e5549; }
.home-sub { font-size: 12px; line-height: 1.8; margin-top: 10px; max-width: 540px; color: var(--muted); }
.knowledge-sources { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin-top: 19px; color: #617467; font-size: 11px; }
.knowledge-sources > span + span { border-left: 1px solid #d8e2d8; padding-left: 13px; margin-left: 13px; }
.featured-figure { display: flex; flex-direction: column; padding: 9px 13px 13px; background: #f2f6f0; border: 0; border-radius: 10px; text-align: left; cursor: pointer; overflow: hidden; color: #355347; }
.featured-figure img { width: 100%; height: 108px; object-fit: contain; mix-blend-mode: multiply; }
.featured-figure > span { display: flex; justify-content: space-between; font-size: 12px; margin-top: 8px; }
.featured-figure small { color: var(--muted); font-size: 11px; margin-top: 5px; }
.featured-figure:hover { background: #eaf1e7; }
.login-panel { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin: 0 0 20px; padding: 16px 20px; border: 1px solid var(--border); background: var(--ground); border-radius: 10px; }
.login-intro { flex: 1 1 190px; }
.login-title { font-size: 13px; font-weight: 600; }
.login-desc { font-size: 11px; line-height: 1.8; margin: 6px 0 0; max-width: 220px; }
.login-fields { display: flex; align-items: flex-end; gap: 10px; margin: 0; flex: 1 1 330px; }
.login-fields label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.login-input { height: 35px; width: 100%; max-width: none; border-radius: 6px; border: 1px solid var(--control); padding: 7px 9px; font-size: 12px; background: #fff; }
#loginBtn { height: 35px; border-radius: 6px; font-size: 12px; white-space: nowrap; padding: 0 14px; }
.login-err { flex-basis: 100%; color: var(--negative); font-size: 12px; }
.study-section { margin-bottom: 27px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading h2, .panel-title { font-size: 15px; font-weight: 600; letter-spacing: .015em; }
.section-heading > span, .panel-hint { font-size: 11px; color: #627269; }
#studyPrompts .ant-prompts-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#studyPrompts .ant-prompts-item { min-width: 0; border: 1px solid #e2e9e1; border-radius: 10px; padding: 14px 18px; background: #f6f8f4; cursor: pointer; transition: border-color .15s, background .15s; }
#studyPrompts .ant-prompts-item:hover { border-color: #9db9a9; background: #f0f5ee; }
#studyPrompts .ant-prompts-content { width: 100%; min-width: 0; }
#studyPrompts .ant-prompts-label { display: block; margin: 0; }
.prompt-category { display: block; font-size: 11px; font-weight: 400; color: #617c6b; margin-bottom: 8px; }
.prompt-name { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 500; color: #294c3b; }
.prompt-name > span { font-size: 16px; color: #759681; }
#studyPrompts .ant-prompts-desc { font-size: 12px; line-height: 1.8; color: #68786b; margin-top: 7px; }
.panel { border-radius: 0; padding: 0; background: transparent; border: 0; }
.map-panel { margin-top: 0; margin-bottom: 27px; }
.panel-head { margin-bottom: 16px; align-items: center; gap: 12px; }
.flow { margin: 0; padding: 0; align-items: center; }
.flow-node { flex: 1; width: auto; padding: 9px 6px; border: 1px solid var(--border); border-radius: 7px; background: #fff; flex-direction: row; gap: 7px; align-items: center; justify-content: center; min-width: 0; }
.flow-dot { width: 6px; height: 6px; margin: 0; border: 0; background: #c5d6ca; flex: none; }
.flow-name { font-size: 11px; white-space: nowrap; color: #5b7163; }
.flow-node.active { background: var(--accent-tint); border-color: #b8d0c1; }
.flow-line { flex: 0 0 12px; min-width: 12px; height: 1px; margin: 0; background: #c9d8cd; }
.flow-detail { min-height: 0; border: 0; background: transparent; padding: 12px 0 0; font-size: 12px; }
.fd-empty { text-align: left; color: #627269; font-size: 11px; padding: 0; }
.fd-desc { line-height: 1.8; }
.gallery-panel { border-top: 1px solid var(--border); padding-top: 23px; margin-top: 0; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; overflow: visible; padding: 0; }
.gcard { width: auto; min-width: 0; padding: 10px; border-radius: 9px; background: #fff; }
.gcard img { height: 125px; object-fit: contain; }
.gcard-fig { margin-top: 6px; font-size: 11px; font-weight: 400; }
.gcard-title { font-size: 12px; }
.gallery-credit { font-size: 11px; line-height: 1.8; margin-top: 14px; }
.page-jump { gap: 6px; font-size: 11px; }
.page-jump-input { width: 56px; padding: 5px 4px; font-size: 11px; border-radius: 5px; }
.page-jump-btn { font-size: 11px; border-radius: 5px; padding: 5px 9px; }
.page-jump-hint { display: none; }
.composer-wrap { flex: none; width: 100%; max-width: 1100px; margin: 0 auto; padding: 10px 40px 13px; background: var(--ground); position: static; border: 0; }
.composer-context { display: flex; justify-content: space-between; gap: 14px; color: #627269; font-size: 11px; margin: 0 0 10px; }
.turn-badge { margin: 0; padding: 0; font-size: 11px; color: var(--muted); background: none; border: 0; line-height: 1.5; }
#chapterContext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 10px; }
.chip { white-space: nowrap; border: 1px solid var(--border); border-radius: 6px; background: transparent; font-size: 11px; padding: 5px 10px; color: #536b5e; cursor: pointer; }
.chip:hover { border-color: #9ab5a5; background: #f1f6ee; }
#senderRoot .ant-sender { border: 1px solid #c6d6c9; border-radius: 12px; box-shadow: none; background: #fff; }
#senderRoot .ant-sender:focus-within { border-color: var(--accent); box-shadow: none; }
#senderRoot .ant-sender-content { padding: 15px 17px 5px; align-items: center; }
#senderRoot #input { font-size: 13px; padding: 0; line-height: 1.75; max-height: 160px; }
#senderRoot #input::placeholder { color: #69796e; }
.sender-submit { background: var(--accent); border: 0; color: white; width: 35px; height: 35px; border-radius: 9px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sender-submit:disabled { background: #e3ebe3; color: #89998b; opacity: 1; }
.sender-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 17px 11px; color: #65746a; font-size: 11px; }
.sender-footer > span:first-child { display: flex; align-items: center; gap: 6px; }
.source-dot { width: 5px; height: 5px; background: #719985; border-radius: 50%; }
.sender-spinner { width: 15px; height: 15px; border: 2px solid #99ad9b; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.composer-hint { font-size: 11px; color: #66756b; padding-top: 9px; }
.messages { max-width: 940px; padding: 35px 40px 12px; }
.messages:empty { display: none; }
.msg { margin-bottom: 32px; }
.msg.user .bubble { border-radius: 14px 14px 3px 14px; background: #edf3ec; padding: 14px 18px; font-size: 14px; line-height: 1.8; }
.bot-head { display: flex; align-items: center; gap: 9px; margin-bottom: 16px !important; }
.bot-avatar { font-family: Georgia, serif; display: inline-flex; width: 27px; height: 27px; justify-content: center; align-items: center; font-size: 20px; color: var(--accent); border: 1px solid #d1e1d5; border-radius: 50%; }
.bot-who { font-size: 12px; font-weight: 600; color: #345b47; }
.bot-caption { font-size: 11px; color: #8a978d; }
.msg.bot .bubble { font-size: 14px; line-height: 1.95; }
.bubble h1, .bubble h2, .bubble h3 { font-size: 17px; margin: 24px 0 12px; color: #264b39; }
.bubble p { margin: 10px 0; }
.bubble th { background: #f3f6f0; color: #3f604b; }
.bubble th, .bubble td { padding: 10px 12px; }
.bubble table { display: block; max-width: 100%; overflow-x: auto; }
.bubble a { text-decoration: underline; text-decoration-color: #a7c4b2; text-underline-offset: 3px; }
.tool-tag { border-radius: 5px; background: #eff5ee; color: #547360; font-size: 11px; padding: 4px 8px; }
.history-item { border-radius: 8px; margin-top: 8px; }
.history-item.active { background: #e1ebe1; }
.history-item .h-name { font-size: 12px; }
.loading-note { font-size: 12px; line-height: 1.9; padding: 20px 10px; color: var(--muted); }
.pv-toolbar { background: #20352d; border-color: #415449; }
.pv-btn, .pv-page-input, .pv-page-wrap, .pv-zoom-label { color: #eaf2ed; }
.pv-btn { border-color: #5c7063; border-radius: 6px; }
.pv-loading { background: #23382e; color: #fff; border-color: #627568; }
.pv-btn:hover { color: white; background: #3c5747; border-color: #a9bdae; }
@media (min-width: 1600px) { .home { padding-top: 50px; } }
@media (min-width: 861px) and (max-width: 1200px) {
  :root { --sidebar-width: 230px; }
  .home, .messages { padding-left: 28px; padding-right: 28px; }
  .composer-wrap { padding-left: 28px; padding-right: 28px; }
  .home-head { grid-template-columns: 1fr 150px; gap: 18px; }
  .greeting { font-size: 31px; }
  .login-panel { gap: 12px; }
  .login-intro { flex-basis: 100%; }
  .login-desc { max-width: none; }
  .flow-name { font-size: 11px; }
  .flow-node { padding-inline: 3px; }
  .flow-line { flex-basis: 7px; min-width: 7px; }
}
@media (max-width: 860px) {
  html, body { height: 100%; height: 100dvh; overflow: hidden; }
  body { display: flex; }
  .topbar { height: 54px; padding: 0 14px; position: static; flex: none; }
  .topbar-title { font-size: 13px; }
  .topbar-scope, .topbar-separator { display: none; }
  .topbar-right { gap: 8px; }
  .icon-btn { display: flex; width: 30px; height: 32px; }
  #newChatBtn { font-size: 11px; padding: 0 9px; height: 31px; }
  .user-name { max-width: 62px; font-size: 11px; }
  .user-chip { padding: 0; }
  .layout { display: flex; min-height: 0; flex: 1; }
  .sheet { display: flex; flex-direction: column; min-height: 0; width: 100%; overflow: hidden; }
  .chat-scroll { flex: 1; overflow-y: auto; }
  .sidebar { display: none; width: auto; }
  .sidebar.open { display: block; position: fixed; inset: 0; z-index: 70; }
  .sidebar.open .sidebar-mask { display: block; position: absolute; inset: 0; background: rgb(20 40 28 / 28%); }
  .sidebar.open .sidebar-panel { position: absolute; inset: 0 auto 0 0; width: min(310px, 86vw); background: var(--chrome); padding-top: 28px; }
  .sidebar .chapter-item { min-height: 40px; font-size: 13px; }
  .home { padding: 26px 24px 28px; }
  .home-head { gap: 20px; grid-template-columns: 1fr 150px; margin-bottom: 24px; }
  .greeting { font-size: 30px; }
  .welcome-line { font-size: 16px; }
  .course-kicker { margin-bottom: 12px; }
  .login-panel { padding: 16px; gap: 14px; }
  .login-intro { flex-basis: 100%; }
  .login-desc { max-width: none; }
  .composer-wrap { padding: 9px 24px max(9px, env(safe-area-inset-bottom)); flex: none; position: static; width: 100%; }
  .composer-hint { display: none; }
  .messages { padding: 24px; }
  .flow { flex-direction: row; align-items: center; }
  .flow-node { flex-direction: row; width: auto; justify-content: center; }
  .flow-line { display: block; }
  .flow-dot { width: 6px; height: 6px; }
  .user-menu { top: 50px; right: 95px; }
}
@media (max-width: 540px) {
  .home { padding: 24px 18px; }
  .home-head { grid-template-columns: minmax(0,1fr); }
  .featured-figure { display: none; }
  .course-kicker { font-size: 11px; margin-bottom: 11px; }
  .greeting { font-size: 29px; }
  .welcome-line { font-size: 15px; margin-top: 9px; }
  .home-sub { font-size: 11px; }
  .knowledge-sources { margin-top: 14px; font-size: 11px; }
  .login-fields { flex-basis: 100%; flex-wrap: wrap; gap: 10px; }
  .login-fields label { flex-basis: 40%; }
  .login-input { height: 38px; font-size: 13px; }
  #loginBtn { width: 100%; height: 36px; }
  .section-heading h2, .panel-title { font-size: 13px; }
  .section-heading > span { display: none; }
  #studyPrompts .ant-prompts-list { gap: 10px; }
  #studyPrompts .ant-prompts-item { padding: 14px 12px; }
  .prompt-category { font-size: 11px; margin-bottom: 8px; }
  .prompt-name { font-size: 13px; gap: 4px; }
  #studyPrompts .ant-prompts-desc { font-size: 12px; line-height: 1.8; }
  .panel-hint { display: none; }
  .flow { flex-wrap: wrap; gap: 7px; }
  .flow-node { flex: 1 1 28%; min-height: 37px; }
  .flow-line { display: none; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gcard img { height: 100px; }
  .gcard-title { font-size: 11px; }
  .page-jump { gap: 4px; }
  .page-jump > span { display: none; }
  .composer-wrap { padding-left: 18px; padding-right: 18px; }
  .composer-context { margin-bottom: 7px; font-size: 11px; }
  .turn-badge { font-size: 11px; }
  .chips { gap: 6px; padding-bottom: 8px; }
  .chip { font-size: 11px; padding: 5px 8px; }
  #senderRoot .ant-sender-content { padding: 12px 12px 4px; }
  #senderRoot #input { font-size: 13px; }
  .sender-footer { font-size: 11px; padding: 0 12px 9px; }
  .keyboard-hint { display: none; }
  .messages { padding: 22px 18px; }
  .msg.user .bubble { max-width: 92%; font-size: 13px; }
  .msg.bot .bubble { font-size: 13px; }
  .bot-caption { display: none; }
  .pv-toolbar { padding: 10px; gap: 6px; }
  .pv-btn { padding: 7px 9px; font-size: 11px; }
  .pv-ask { margin-left: auto; }
  .pv-canvas { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
