/* 知枢 · 轻量演示 —— 设计令牌与布局对齐完整项目 */

:root {
  --canvas: #f4f7fb;
  --container: #ffffff;
  --container-soft: #f8f9fc;
  --container-muted: #f2f5fa;
  --chat-aside: #f8f9fb;
  --hover: #f5f7fb;
  --ink: #192134;
  --ink-2: #475467;
  --muted: #6f7a8b;
  --soft: #98a2b3;
  --line: #dee4ee;
  --line-soft: #eef1f6;
  --primary: #4f46e5;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --primary-soft: rgba(79, 70, 229, .08);
  --teal: #0f9f9a;
  --teal-soft: rgba(15, 159, 154, .1);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, .1);
  --violet: #7c3aed;
  --violet-soft: rgba(124, 58, 237, .1);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, .08);
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, .09);
  --sider-w: 240px;
  --sider-collapsed-w: 64px;
  --header-h: 56px;
  --radius-panel: 8px;
  --shadow-panel: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-pop: 0 18px 48px rgba(15, 23, 42, .14), 0 2px 8px rgba(15, 23, 42, .05);
  --shadow-sider: 2px 0 8px rgba(29, 35, 41, .05);
  --shadow-chat: 0 8px 28px rgba(15, 23, 42, .06);
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
}

html.dark {
  color-scheme: dark;
  --canvas: #0f131e;
  --container: #191e2b;
  --container-soft: #1d2331;
  --container-muted: #232a3a;
  --chat-aside: #141925;
  --hover: #202737;
  --ink: #e2e8f0;
  --ink-2: #aab4c5;
  --muted: #94a3b8;
  --soft: #6b7a90;
  --line: #374151;
  --line-soft: #2a3343;
  --primary: #a5b4fc;
  --brand: #6366f1;
  --brand-strong: #4f46e5;
  --primary-soft: rgba(129, 140, 248, .14);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, .12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .12);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, .13);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, .12);
  --blue: #93c5fd;
  --blue-soft: rgba(147, 197, 253, .12);
  --shadow-panel: 0 1px 2px rgba(0, 0, 0, .24);
  --shadow-pop: 0 20px 50px rgba(0, 0, 0, .5);
  --shadow-sider: 2px 0 10px rgba(0, 0, 0, .28);
  --shadow-chat: 0 8px 30px rgba(0, 0, 0, .28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll,
body.sider-lock {
  overflow: hidden;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

ul {
  margin: 0;
}

::selection {
  background: rgba(79, 70, 229, .18);
}

:focus-visible {
  outline: 2px solid rgba(79, 70, 229, .5);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

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

/* Boot */
.boot-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.boot-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--container);
  border: 1px solid var(--line);
  color: var(--primary);
  box-shadow: var(--shadow-pop);
  animation: float 2.6s ease-in-out infinite;
}

.boot-mark svg {
  width: 30px;
  height: 30px;
}

.boot-name {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: .2em;
  color: var(--ink);
}

.boot-bar {
  width: 176px;
  height: 3px;
  border-radius: 99px;
  background: var(--container-muted);
  overflow: hidden;
}

.boot-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #a5b4fc, var(--brand));
  animation: loading 1.15s ease-in-out infinite;
}

.boot-screen p {
  font-size: 11px;
  color: var(--soft);
}

.boot-error-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--red-soft);
  color: var(--red);
  font-size: 24px;
  font-weight: 650;
}

.primary-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* Login */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--container);
}

html.dark .login-page {
  background: var(--canvas);
}

.login-card {
  position: relative;
  width: 448px;
  max-width: 100%;
  padding: 30px 34px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--container);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .1), 0 2px 8px rgba(15, 23, 42, .04);
  animation: rise .4s ease both;
}

.login-card.shake {
  animation: shake .42s ease;
}

.login-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.login-logo {
  display: grid;
  place-items: center;
  color: var(--primary);
}

.login-logo svg {
  width: 52px;
  height: 52px;
}

.login-brand h1 {
  color: var(--primary);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: .03em;
  line-height: 1;
}

.login-theme {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--container);
  color: var(--muted);
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.login-theme:hover {
  color: var(--primary);
  border-color: rgba(79, 70, 229, .35);
  background: var(--primary-soft);
}

.login-theme span,
.login-theme svg {
  width: 18px;
  height: 18px;
}

.login-main {
  padding-top: 28px;
}

.login-title {
  margin-bottom: 18px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 500;
}

.login-field {
  display: flex;
  align-items: center;
  height: 44px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--container);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.login-field:focus-within {
  border-color: rgba(79, 70, 229, .55);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .09);
}

.login-field-icon {
  display: grid;
  place-items: center;
  width: 42px;
  flex: 0 0 auto;
  color: var(--soft);
}

.login-field-icon svg {
  width: 18px;
  height: 18px;
}

.login-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  color: var(--ink);
}

.login-field input::placeholder {
  color: var(--soft);
}

.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--container) inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  transition: background-color 9999s ease-out 0s;
}

.login-eye {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-right: 3px;
  border-radius: 7px;
  color: var(--soft);
}

.login-eye:hover {
  color: var(--ink-2);
  background: var(--container-soft);
}

.login-eye svg {
  width: 18px;
  height: 18px;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 16px;
  font-size: 12px;
}

.login-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  cursor: pointer;
}

.login-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.login-link {
  color: var(--primary);
  font-size: 12px;
}

.login-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-error {
  margin: -4px 0 12px;
  padding: 9px 11px;
  border: 1px solid rgba(220, 38, 38, .18);
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 1.6;
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(79, 70, 229, .24);
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.login-submit:hover:not(:disabled) {
  background: var(--brand-strong);
  box-shadow: 0 8px 22px rgba(79, 70, 229, .3);
}

.login-submit:active:not(:disabled) {
  transform: translateY(1px);
}

.login-submit:disabled {
  opacity: .8;
}

.login-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--container);
  color: var(--ink-2);
  font-size: 14px;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.login-secondary:hover {
  border-color: rgba(79, 70, 229, .4);
  color: var(--primary);
  background: var(--primary-soft);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.demo-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--container-soft);
}

.demo-hint-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
}

.demo-hint-copy strong {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.demo-hint-copy span {
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  color: var(--ink-2);
  white-space: nowrap;
}

.demo-hint-copy i {
  font-style: normal;
  color: var(--soft);
}

.demo-fill {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
}

.demo-fill:hover {
  background: rgba(79, 70, 229, .14);
}

.login-note {
  margin-top: 12px;
  color: var(--soft);
  font-size: 10.5px;
  line-height: 1.7;
  text-align: center;
}

.login-foot {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--soft);
  font-size: 10px;
  text-align: center;
}

.login-foot span {
  margin: 0 5px;
}

/* Shell */
.app-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--canvas);
}

.app-sider {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: var(--sider-w);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--container);
  box-shadow: var(--shadow-sider);
  transition: width .2s ease, transform .22s ease;
}

.sider-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
  flex: 0 0 auto;
  padding: 0 16px;
  overflow: hidden;
}

.sider-logo-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: var(--primary);
}

.sider-logo-mark svg {
  width: 30px;
  height: 30px;
}

.sider-logo-text {
  min-width: 0;
  white-space: nowrap;
}

.sider-logo-text strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.2;
}

.sider-logo-text small {
  display: block;
  margin-top: 1px;
  color: var(--soft);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .14em;
}

.sider-menu {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 8px 16px;
  scrollbar-width: thin;
}

.menu-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-group-title {
  overflow: hidden;
  padding: 18px 8px 8px;
  color: rgba(25, 33, 52, .5);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  transition: padding .18s ease, height .18s ease, opacity .15s ease;
}

html.dark .menu-group-title {
  color: rgba(226, 232, 240, .48);
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: rgba(25, 33, 52, .76);
  font-size: 13.5px;
  text-align: left;
  transition: background .16s ease, color .16s ease;
}

html.dark .menu-item {
  color: rgba(226, 232, 240, .76);
}

.menu-item:hover {
  background: var(--hover);
  color: var(--ink);
}

.menu-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.menu-item.active::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: -8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.menu-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  opacity: .82;
}

.menu-item.active .menu-icon {
  opacity: 1;
}

.menu-icon svg {
  width: 18px;
  height: 18px;
}

.menu-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sider-foot {
  flex: 0 0 auto;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line-soft);
}

.sider-collapse {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 34px;
  border-radius: 8px;
  color: var(--soft);
  transition: background .16s ease, color .16s ease;
}

.sider-collapse:hover {
  background: var(--hover);
  color: var(--ink-2);
}

.sider-collapse svg {
  width: 18px;
  height: 18px;
  transition: transform .2s ease;
}

.sider-mask {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(1px);
}

.app-body {
  display: flex;
  flex: 1;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  margin-left: var(--sider-w);
  transition: margin-left .2s ease;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: var(--header-h);
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--container);
}

.header-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.header-right {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.header-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  transition: background .16s ease, color .16s ease;
}

.header-icon:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.header-icon span,
.header-icon svg {
  width: 18px;
  height: 18px;
}

.header-menu-btn {
  display: none;
}

.header-page-icon {
  display: grid;
  place-items: center;
  color: var(--primary);
}

.header-page-icon svg {
  width: 20px;
  height: 20px;
}

.header-page-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  margin-right: 6px;
  padding: 0 10px;
  border: 1px solid rgba(15, 159, 154, .2);
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.demo-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  margin-left: 6px;
  padding: 2px 8px 2px 3px;
  border-radius: 999px;
  transition: background .16s ease;
}

.header-user:hover {
  background: var(--container-soft);
}

.header-avatar {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.header-avatar svg {
  width: 18px;
  height: 18px;
}

.header-username {
  max-width: 120px;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.header-caret {
  color: var(--soft);
}

.header-caret svg {
  width: 13px;
  height: 13px;
}

.app-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 32px 16px 16px 32px;
  scrollbar-width: thin;
}

.app-content--chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-dropdown {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  right: 20px;
  z-index: 60;
  width: 258px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--container);
  box-shadow: var(--shadow-pop);
  animation: dropIn .16s ease both;
}

.user-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 10px;
}

.user-menu-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.user-menu-avatar svg {
  width: 20px;
  height: 20px;
}

.user-menu-head strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.user-menu-head small {
  display: block;
  margin-top: 2px;
  color: var(--soft);
  font-size: 10.5px;
}

.user-menu-sep {
  height: 1px;
  margin: 4px 0;
  background: var(--line-soft);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
}

.user-menu-item:hover {
  background: var(--hover);
  color: var(--ink);
}

.user-menu-item svg {
  width: 16px;
  height: 16px;
  color: var(--soft);
}

.user-menu-item.danger {
  color: var(--red);
}

.user-menu-item.danger svg {
  color: var(--red);
}

.user-menu-item.danger:hover {
  background: var(--red-soft);
}

/* Collapsed sider */
.app-shell.sider-collapsed .app-sider {
  width: var(--sider-collapsed-w);
}

.app-shell.sider-collapsed .app-body {
  margin-left: var(--sider-collapsed-w);
}

.app-shell.sider-collapsed .sider-logo {
  justify-content: center;
  padding: 0;
}

.app-shell.sider-collapsed .sider-logo-text {
  display: none;
}

.app-shell.sider-collapsed .sider-menu {
  padding: 8px 11px 16px;
}

.app-shell.sider-collapsed .menu-group-title {
  height: 0;
  padding: 0;
  opacity: 0;
}

.app-shell.sider-collapsed .menu-group + .menu-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.app-shell.sider-collapsed .menu-item {
  justify-content: center;
  padding: 0;
}

.app-shell.sider-collapsed .menu-item.active::before {
  left: -11px;
}

.app-shell.sider-collapsed .menu-label {
  display: none;
}

.app-shell.sider-collapsed .sider-collapse svg {
  transform: scaleX(-1);
}

.app-shell.sider-collapsed .sider-foot {
  padding: 10px 15px 12px;
}

/* Page frame */
.page-view {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.page-view--fill {
  height: 100%;
  min-height: 0;
}

.app-content--chat > .page-view--fill {
  flex: 1;
  height: auto;
}

.page-frame-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-frame-id {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.page-frame-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}

.page-frame-icon svg {
  width: 20px;
  height: 20px;
}

.page-frame-id h1 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.3;
}

.page-frame-id p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.page-frame-toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--container);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color .16s ease, color .16s ease, background .16s ease, box-shadow .16s ease;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn:hover:not(:disabled) {
  border-color: rgba(79, 70, 229, .4);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn.primary {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .2);
}

.btn.primary:hover:not(:disabled) {
  background: var(--brand-strong);
  color: #fff;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  border-color: rgba(220, 38, 38, .25);
  background: var(--red);
  color: #fff;
}

.btn.danger:hover:not(:disabled) {
  background: #b91c1c;
  color: #fff;
}

.btn:disabled {
  opacity: .5;
}

.demo-inline {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--container);
  box-shadow: var(--shadow-panel);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.section-head h2 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
}

.section-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.section-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.section-note {
  color: var(--soft);
  font-size: 10.5px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 46px 20px;
  color: var(--soft);
  font-size: 12px;
  text-align: center;
}

.empty-state svg {
  width: 22px;
  height: 22px;
}

/* Chat workspace */
.chat-workspace {
  position: relative;
  display: flex;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--container);
  box-shadow: var(--shadow-chat);
}

.chat-sidebar {
  position: relative;
  z-index: 2;
  width: 276px;
  flex: 0 0 auto;
  overflow: hidden;
  border-right: 1px solid #eef0f4;
  background: var(--chat-aside);
  transition: width .2s ease;
}

html.dark .chat-sidebar {
  border-right-color: var(--line-soft);
}

.chat-sidebar.is-collapsed {
  width: 0;
  border-right-width: 0;
}

.chat-sidebar-inner {
  display: flex;
  width: 276px;
  height: 100%;
  flex-direction: column;
}

.chat-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 8px;
}

.chat-sidebar-head strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.chat-sidebar-head small {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-size: 11px;
}

.chat-sidebar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.chat-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(79, 70, 229, .18);
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.chat-new-btn:hover {
  background: rgba(79, 70, 229, .14);
}

.chat-new-btn svg {
  width: 14px;
  height: 14px;
}

.chat-sidebar-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--soft);
}

.chat-sidebar-close:hover {
  background: var(--hover);
  color: var(--ink-2);
}

.chat-sidebar-close svg {
  width: 16px;
  height: 16px;
}

.chat-tabs {
  display: flex;
  margin: 0 16px 8px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(222, 228, 238, .5);
}

html.dark .chat-tabs {
  background: rgba(255, 255, 255, .05);
}

.chat-tabs button {
  flex: 1;
  height: 28px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.chat-tabs button.active {
  background: var(--container);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.chat-session-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 8px 12px;
  scrollbar-width: thin;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 8px;
  border-radius: 8px;
  text-align: left;
  transition: background .16s ease;
}

.session-item:hover {
  background: var(--container);
}

.session-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--container);
  color: var(--soft);
}

.session-icon svg {
  width: 14px;
  height: 14px;
}

.session-copy {
  min-width: 0;
  flex: 1;
}

.session-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.session-copy small {
  display: block;
  margin-top: 2px;
  color: var(--soft);
  font-size: 10px;
}

.chat-sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 44px 16px;
  color: var(--soft);
  font-size: 11px;
  text-align: center;
}

.chat-sidebar-empty svg {
  width: 20px;
  height: 20px;
}

.chat-sidebar-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  margin: 0 12px;
  padding: 11px 4px;
  border-top: 1px solid var(--line-soft);
  color: var(--soft);
  font-size: 10px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.chat-main {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  background: var(--container);
}

.chat-main-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  flex: 0 0 auto;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.chat-panel-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--container);
  color: var(--ink-2);
}

.chat-panel-toggle:hover {
  border-color: rgba(79, 70, 229, .4);
  color: var(--primary);
  background: var(--primary-soft);
}

.chat-panel-toggle svg {
  width: 18px;
  height: 18px;
}

.chat-main-title {
  min-width: 0;
}

.chat-main-title h1 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
}

.chat-main-title p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.chat-head-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  margin-left: auto;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.chat-head-mark svg {
  width: 18px;
  height: 18px;
}

.chat-backdrop {
  display: none;
}

.chat-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

.chat-stream-inner {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 32px 24px;
}

.chat-stream-inner--welcome {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 24px;
}

.chat-welcome {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  animation: rise .4s ease both;
}

.welcome-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
}

.welcome-mark svg {
  width: 30px;
  height: 30px;
}

.chat-welcome h1 {
  margin: 18px 0 10px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.chat-welcome > p {
  max-width: 560px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.suggestion-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--container);
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.suggestion-card:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, .32);
  box-shadow: 0 10px 26px rgba(79, 70, 229, .08);
}

.suggestion-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.suggestion-tag {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9.5px;
  font-weight: 700;
}

.suggestion-arrow {
  color: var(--soft);
  transition: color .16s ease, transform .16s ease;
}

.suggestion-arrow svg {
  width: 14px;
  height: 14px;
}

.suggestion-card:hover .suggestion-arrow {
  color: var(--primary);
  transform: translate(1px, -1px);
}

.suggestion-card strong {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}

.suggestion-card small {
  color: var(--soft);
  font-size: 10.5px;
  line-height: 1.5;
}

.welcome-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--soft);
  font-size: 10px;
}

.welcome-foot i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.msg {
  display: flex;
  gap: 12px;
}

.msg-enter {
  animation: rise .28s ease both;
}

.msg-user {
  justify-content: flex-end;
}

.user-bubble {
  max-width: 76%;
  padding: 10px 14px;
  border: 1px solid rgba(79, 70, 229, .14);
  border-radius: 14px 14px 4px 14px;
  background: var(--primary-soft);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.msg-assistant {
  align-items: flex-start;
}

.assistant-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff;
  box-shadow: 0 5px 14px rgba(79, 70, 229, .22);
}

.assistant-avatar svg {
  width: 20px;
  height: 20px;
}

.msg-body {
  min-width: 0;
  flex: 1;
}

.msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.msg-head strong {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.model-chip {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--container-muted);
  color: var(--muted);
  font-size: 9.5px;
}

.msg-text {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.msg-text p + p {
  margin-top: 10px;
}

.msg-text strong {
  font-weight: 650;
}

.msg-text ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.msg-text li {
  margin: 3px 0;
}

.cite-ref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  margin: 0 2px;
  padding: 0 4px;
  border: 1px solid rgba(79, 70, 229, .16);
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 1px;
  transition: background .15s ease, color .15s ease;
}

.cite-ref:hover {
  background: var(--brand);
  color: #fff;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  margin-left: 2px;
  background: var(--brand);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
}

.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .45;
  animation: typing 1.2s ease-in-out infinite;
}

.typing span:nth-child(2) {
  animation-delay: .15s;
}

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

.trace-card {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--container-soft);
}

.trace-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--soft);
  font-size: 10.5px;
}

.trace-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-weight: 600;
}

.trace-title svg {
  width: 13px;
  height: 13px;
  color: var(--soft);
}

.trace-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.trace-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: var(--container);
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.trace-chip::before {
  content: "";
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary);
}

.trace-chip:last-child::before {
  background: var(--teal);
}

.trace-chip b {
  margin-right: 2px;
  color: var(--ink-2);
  font-weight: 600;
}

.citation-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.citation-card {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 290px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--container);
  text-align: left;
  transition: border-color .16s ease, background .16s ease;
}

.citation-card:hover {
  border-color: rgba(79, 70, 229, .35);
  background: var(--primary-soft);
}

.citation-index {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9.5px;
  font-weight: 700;
}

.citation-card strong {
  display: block;
  max-width: 200px;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.citation-card small {
  display: block;
  margin-top: 2px;
  color: var(--soft);
  font-size: 9.5px;
}

.msg-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-soft);
  color: var(--soft);
  font-size: 9.5px;
}

.msg-foot button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: var(--muted);
  font-size: 9.5px;
}

.msg-foot button:hover {
  color: var(--primary);
}

.msg-foot button svg {
  width: 11px;
  height: 11px;
}

.msg-error {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(220, 38, 38, .16);
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11.5px;
  line-height: 1.6;
}

.composer-wrap {
  width: 100%;
  max-width: 944px;
  flex: 0 0 auto;
  margin: 0 auto;
  padding: 12px 32px 14px;
}

.composer {
  padding: 10px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--container);
  box-shadow: 0 6px 22px rgba(15, 23, 42, .05);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.composer:focus-within {
  border-color: rgba(79, 70, 229, .45);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .07), 0 6px 22px rgba(15, 23, 42, .05);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 24px;
  max-height: 160px;
  padding: 2px 2px 6px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.65;
}

.composer textarea::placeholder {
  color: var(--soft);
}

.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.composer-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--soft);
  font-size: 9.5px;
}

kbd {
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--container-soft);
  color: var(--muted);
  font-family: inherit;
  font-size: 9px;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.stop-btn {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--container);
  color: var(--muted);
  font-size: 11px;
}

.stop-btn:hover {
  border-color: rgba(220, 38, 38, .3);
  color: var(--red);
}

.send-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .2);
  transition: background .16s ease;
}

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

.send-btn:hover:not(:disabled) {
  background: var(--brand-strong);
}

.send-btn:disabled {
  background: var(--container-muted);
  color: var(--soft);
  box-shadow: none;
}

.chat-disclaimer {
  margin-top: 8px;
  color: var(--soft);
  font-size: 9.5px;
  text-align: center;
}

/* Reference */
.reference-page {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--container);
  box-shadow: var(--shadow-chat);
}

.reference-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  flex: 0 0 auto;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.reference-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.reference-back:hover {
  background: var(--hover);
  color: var(--primary);
}

.reference-back svg {
  width: 16px;
  height: 16px;
}

.reference-head-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.reference-head-mark {
  margin-left: auto;
  color: var(--soft);
}

.reference-head-mark svg {
  width: 18px;
  height: 18px;
}

.reference-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 28px 40px;
}

.reference-card {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--container);
  box-shadow: var(--shadow-panel);
}

.ref-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ref-kicker {
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 10.5px;
  font-weight: 500;
}

.ref-chip svg {
  width: 12px;
  height: 12px;
}

.ref-title {
  margin-top: 12px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ref-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

.ref-snippet {
  margin-top: 20px;
  padding: 18px 20px;
  border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0;
  background: var(--container-soft);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.95;
  overflow-wrap: anywhere;
}

.ref-snippet mark {
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(217, 119, 6, .18);
  color: inherit;
}

.ref-anchor {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--soft);
  font-size: 10.5px;
}

.ref-anchor svg {
  width: 12px;
  height: 12px;
}

.ref-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.ref-info {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--container);
}

.ref-info span {
  display: block;
  color: var(--soft);
  font-size: 10px;
}

.ref-info strong {
  display: block;
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ref-hint {
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--container-soft);
  color: var(--soft);
  font-size: 10.5px;
  line-height: 1.7;
}

/* Knowledge */
.doc-panel {
  overflow: hidden;
}

.filter-chips {
  display: flex;
  gap: 4px;
  padding: 2px;
  border-radius: 7px;
  background: var(--container-muted);
}

.filter-chip {
  height: 26px;
  padding: 0 9px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.filter-chip:hover {
  color: var(--ink-2);
}

.filter-chip.active {
  background: var(--container);
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 236px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--container);
  color: var(--soft);
}

.search-box:focus-within {
  border-color: rgba(79, 70, 229, .45);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .06);
}

.search-box svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.search-box input::placeholder {
  color: var(--soft);
}

.doc-head,
.doc-row {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) 70px 56px 92px 76px 96px 120px 16px;
  align-items: center;
  gap: 12px;
}

.doc-head {
  height: 38px;
  padding: 0 20px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--container-soft);
  color: var(--soft);
  font-size: 11px;
}

.doc-row {
  width: 100%;
  min-height: 64px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
  transition: background .16s ease;
}

.doc-row:hover {
  background: var(--container-soft);
}

.doc-row:last-child {
  border-bottom: 0;
}

.doc-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .02em;
}

.file-pdf {
  background: var(--red-soft);
  color: var(--red);
}

.file-docx {
  background: var(--blue-soft);
  color: var(--blue);
}

.file-md {
  background: var(--container-muted);
  color: var(--muted);
}

.file-pptx {
  background: var(--amber-soft);
  color: var(--amber);
}

.doc-main-copy {
  min-width: 0;
  flex: 1;
}

.doc-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.doc-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
  color: var(--soft);
  font-size: 10px;
  line-height: 1.5;
}

.progress-line {
  width: 100%;
  max-width: 180px;
  height: 3px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--container-muted);
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--amber);
}

.doc-size,
.doc-metric,
.doc-date {
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.doc-tag,
.doc-visibility {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.doc-status {
  min-width: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.status-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.status-ready {
  background: var(--teal-soft);
  color: var(--teal);
}

.status-processing {
  background: var(--amber-soft);
  color: var(--amber);
}

.row-arrow {
  display: grid;
  place-items: center;
  color: var(--soft);
}

.row-arrow svg {
  width: 15px;
  height: 15px;
}

.doc-row:hover .row-arrow {
  color: var(--primary);
}

.doc-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  border-top: 1px solid var(--line-soft);
  background: var(--container-soft);
  color: var(--soft);
  font-size: 10.5px;
}

.doc-notice svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

/* Usage */
.usage-section {
  margin-bottom: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
}

.stat-card {
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--container);
}

.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--container-muted);
  color: var(--muted);
}

.stat-icon svg {
  width: 15px;
  height: 15px;
}

.tone-indigo .stat-icon {
  background: var(--primary-soft);
  color: var(--primary);
}

.tone-teal .stat-icon {
  background: var(--teal-soft);
  color: var(--teal);
}

.tone-amber .stat-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.tone-violet .stat-icon {
  background: var(--violet-soft);
  color: var(--violet);
}

.stat-value {
  margin-top: 10px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-delta {
  margin-top: 4px;
  color: var(--soft);
  font-size: 10.5px;
}

.usage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 16px;
}

.chart-panel,
.quota-panel {
  min-width: 0;
}

.quota-panel {
  display: flex;
  flex-direction: column;
}

.chart-body {
  padding: 4px 20px 20px;
}

.bar-chart {
  display: flex;
  height: 230px;
  align-items: stretch;
  gap: 14px;
}

.bar-group {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bar-value {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  display: flex;
  width: 100%;
  max-width: 46px;
  flex: 1;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 6px;
  background: var(--container-muted);
}

.bar-fill {
  width: 100%;
  height: var(--h, 20%);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--brand), #818cf8);
  transform-origin: bottom;
  animation: grow .7s cubic-bezier(.2, .8, .2, 1) both;
}

.bar-label {
  color: var(--soft);
  font-size: 10px;
  white-space: nowrap;
}

.quota-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 28px;
}

.donut {
  position: relative;
  display: grid;
  width: 158px;
  height: 158px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--p, 0) * 1%), var(--container-muted) 0);
}

.donut-inner {
  position: absolute;
  inset: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--container);
}

.donut-inner strong {
  color: var(--ink);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.donut-inner span {
  margin-top: 2px;
  color: var(--soft);
  font-size: 10.5px;
}

.quota-numbers {
  color: var(--ink-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.quota-reset {
  color: var(--soft);
  font-size: 10px;
}

.models-panel {
  margin-top: 16px;
}

.model-table-wrap {
  overflow-x: auto;
}

.model-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.model-table th {
  padding: 9px 16px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--container-soft);
  color: var(--soft);
  font-size: 10.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.model-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.model-table tr:last-child td {
  border-bottom: 0;
}

.model-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.model-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 8px;
  font-weight: 800;
}

.model-mobile-meta {
  display: none;
}

.model-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
}

.status-ok {
  color: var(--teal);
}

.status-backup {
  color: var(--amber);
}

/* Placeholder */
.placeholder-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px;
  text-align: center;
}

.placeholder-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: var(--primary-soft);
  color: var(--primary);
}

.placeholder-mark svg {
  width: 30px;
  height: 30px;
}

.placeholder-panel h2 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 650;
  line-height: 1.4;
}

.placeholder-panel > p {
  max-width: 540px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.placeholder-caps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.placeholder-caps span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--container-soft);
  color: var(--ink-2);
  font-size: 11px;
}

.placeholder-caps svg {
  width: 12px;
  height: 12px;
  color: var(--teal);
}

.placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

/* Modal */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, .46);
  backdrop-filter: blur(2px);
  animation: fade .16s ease both;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 71;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--container);
  box-shadow: var(--shadow-pop);
  transform: translate(-50%, -50%);
  animation: modalIn .2s ease both;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--soft);
}

.modal-close:hover {
  background: var(--hover);
  color: var(--ink-2);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal h2 {
  margin-top: 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 650;
  line-height: 1.4;
}

.modal > p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.modal ul {
  margin-top: 14px;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.8;
}

.modal li {
  margin: 5px 0;
}

.modal li::marker {
  color: var(--primary);
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.confirm-modal {
  width: min(380px, calc(100vw - 32px));
  padding: 30px 26px 24px;
  text-align: center;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
}

.confirm-icon svg {
  width: 22px;
  height: 22px;
}

.confirm-modal h2 {
  margin-top: 14px;
}

.confirm-modal p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.modal-actions .btn {
  min-width: 96px;
}

/* Drawer */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 71;
  display: flex;
  width: min(520px, 100%);
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--container);
  box-shadow: var(--shadow-pop);
  animation: slideIn .24s cubic-bezier(.2, .8, .2, 1) both;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-head h2 {
  margin-top: 6px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.drawer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 6px;
  color: var(--soft);
  font-size: 10.5px;
}

.ref-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--soft);
}

.ref-close:hover {
  background: var(--hover);
  color: var(--ink-2);
}

.ref-close svg {
  width: 18px;
  height: 18px;
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 32px;
}

.drawer-summary {
  padding: 14px;
  border-radius: 8px;
  background: var(--container-soft);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.8;
}

.chunk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.chunk-card {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--container);
}

.chunk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--soft);
  font-size: 10px;
}

.chunk-anchor {
  overflow: hidden;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chunk-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.drawer-note {
  margin-top: 16px;
  color: var(--soft);
  font-size: 10.5px;
  line-height: 1.7;
}

/* Search */
.search-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .44);
  backdrop-filter: blur(2px);
  animation: fade .16s ease both;
}

.search-panel {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100vw - 32px));
  max-height: min(70vh, 620px);
  margin: 10vh auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--container);
  box-shadow: var(--shadow-pop);
  animation: searchIn .2s ease both;
}

@keyframes searchIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--soft);
}

.search-input-row > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.search-input-row input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}

.search-input-row input::placeholder {
  color: var(--soft);
}

.search-results {
  max-height: min(56vh, 520px);
  overflow-y: auto;
  padding: 8px;
}

.search-group {
  padding: 2px 0 6px;
}

.search-group-title {
  padding: 10px 12px 6px;
  color: var(--soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  text-align: left;
}

.search-result:hover {
  background: var(--container-soft);
}

.search-result-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}

.search-result-icon.accent {
  background: var(--amber-soft);
  color: var(--amber);
}

.search-result-icon svg {
  width: 16px;
  height: 16px;
}

.search-result-copy {
  min-width: 0;
  flex: 1;
}

.search-result-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-result-copy small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--soft);
  font-size: 10.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-result-arrow {
  color: var(--soft);
}

.search-result-arrow svg {
  width: 14px;
  height: 14px;
}

.search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 20px;
  color: var(--soft);
  text-align: center;
}

.search-empty svg {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.search-empty strong {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.search-empty span {
  font-size: 11px;
}

/* Toast */
.toast-root {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--container);
  color: var(--ink-2);
  font-size: 12.5px;
  box-shadow: var(--shadow-pop);
  animation: toastIn .2s ease both;
}

.toast.out {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
}

.toast-check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
}

.toast-check svg {
  width: 11px;
  height: 11px;
}

/* Animations */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 8px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(24px);
    opacity: .6;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes loading {
  0% {
    transform: translateX(-100%);
  }
  60% {
    transform: translateX(180%);
  }
  100% {
    transform: translateX(180%);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes typing {
  0%,
  80%,
  100% {
    opacity: .28;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes grow {
  from {
    transform: scaleY(.04);
    opacity: .5;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-5px);
  }
  40%,
  60% {
    transform: translateX(5px);
  }
}

/* Responsive */
@media (max-width: 1280px) {
  .doc-head,
  .doc-row {
    grid-template-columns: minmax(0, 2.4fr) 64px 52px 88px 92px 120px 16px;
  }

  .doc-visibility,
  .doc-head span:nth-child(5) {
    display: none;
  }
}

@media (max-width: 1080px) {
  .doc-head,
  .doc-row {
    grid-template-columns: minmax(0, 2.2fr) 64px 52px 92px 120px 16px;
  }

  .doc-tag,
  .doc-head span:nth-child(4) {
    display: none;
  }

  .usage-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .app-content {
    padding: 24px 16px 16px 24px;
  }

  .header-username {
    max-width: 80px;
  }

  .section-head {
    flex-wrap: wrap;
  }

  .section-tools {
    width: 100%;
  }

  .search-box {
    flex: 1;
    width: auto;
    min-width: 180px;
  }
}

@media (max-width: 900px) {
  .app-sider {
    transform: translateX(-100%);
    border-right: 0;
    box-shadow: var(--shadow-pop);
  }

  .app-sider.is-open {
    transform: translateX(0);
  }

  .app-body,
  .app-shell.sider-collapsed .app-body {
    margin-left: 0;
  }

  .app-shell.sider-collapsed .app-sider {
    width: var(--sider-w);
  }

  .app-shell.sider-collapsed .sider-logo {
    justify-content: flex-start;
    padding: 0 16px;
  }

  .app-shell.sider-collapsed .sider-logo-text {
    display: block;
  }

  .app-shell.sider-collapsed .sider-menu {
    padding: 0 8px 16px;
  }

  .app-shell.sider-collapsed .menu-group-title {
    height: auto;
    padding: 18px 8px 8px;
    opacity: 1;
  }

  .app-shell.sider-collapsed .menu-group + .menu-group {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .app-shell.sider-collapsed .menu-item {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .app-shell.sider-collapsed .menu-item.active::before {
    left: -8px;
  }

  .app-shell.sider-collapsed .menu-label {
    display: block;
  }

  .app-shell.sider-collapsed .sider-collapse svg {
    transform: none;
  }

  .app-shell.sider-collapsed .sider-foot {
    padding: 10px 12px 12px;
  }

  .header-menu-btn {
    display: grid;
  }

  .sider-collapse {
    display: none;
  }

  .sider-foot {
    display: none;
  }

  .doc-head,
  .doc-row {
    grid-template-columns: minmax(0, 1fr) 56px 120px 16px;
  }

  .doc-size,
  .doc-date,
  .doc-head span:nth-child(2),
  .doc-head span:nth-child(6) {
    display: none;
  }
}

@media (max-width: 860px) {
  .chat-sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 12;
    width: 276px;
    box-shadow: 12px 0 32px rgba(15, 23, 42, .12);
  }

  .chat-sidebar.is-collapsed {
    width: 276px;
    border-right: 1px solid #eef0f4;
    transform: translateX(-100%);
  }

  html.dark .chat-sidebar.is-collapsed {
    border-right-color: var(--line-soft);
  }

  .chat-backdrop {
    position: absolute;
    inset: 0;
    z-index: 11;
    display: block;
    background: rgba(15, 23, 42, .32);
  }

  .chat-main-head {
    min-height: 56px;
    padding: 8px 14px;
  }

  .chat-main-title p {
    display: none;
  }

  .chat-stream-inner {
    padding: 22px 18px 18px;
  }

  .composer-wrap {
    padding: 10px 18px 12px;
  }

  .reference-card {
    padding: 22px 18px;
  }

  .ref-title {
    font-size: 20px;
  }
}

@media (max-width: 760px) {
  .app-content {
    padding: 16px 12px 12px;
  }

  .app-content--chat {
    padding: 10px;
  }

  .app-header {
    padding: 0 12px 0 10px;
  }

  .demo-badge {
    display: none;
  }

  .header-fullscreen {
    display: none;
  }

  .header-page-title {
    font-size: 15px;
  }

  .header-username {
    display: none;
  }

  .header-user {
    margin-left: 2px;
    padding: 2px 4px 2px 2px;
  }

  .header-caret {
    display: none;
  }

  .page-frame-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .page-frame-toolbar {
    width: 100%;
  }

  .page-frame-id h1 {
    font-size: 20px;
  }

  .page-frame-id p {
    font-size: 12px;
  }

  .page-frame-icon {
    width: 34px;
    height: 34px;
  }

  .section-head {
    padding: 14px 14px;
  }

  .section-tools {
    gap: 8px;
  }

  .filter-chips {
    width: 100%;
  }

  .filter-chip {
    flex: 1;
  }

  .search-box {
    width: 100%;
  }

  .doc-head {
    display: none;
  }

  .doc-row {
    grid-template-columns: minmax(0, 1fr) auto 16px;
    gap: 10px;
    padding: 12px 14px;
  }

  .doc-metric {
    display: none;
  }

  .doc-notice {
    padding: 10px 14px;
  }

  .stat-grid {
    gap: 10px;
    padding: 0 14px 14px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 20px;
  }

  .chart-body {
    padding: 4px 14px 16px;
  }

  .bar-chart {
    height: 190px;
    gap: 7px;
  }

  .bar-track {
    max-width: 34px;
  }

  .models-panel .section-head {
    padding-bottom: 12px;
  }

  .model-table {
    min-width: 560px;
  }

  .model-table th,
  .model-table td {
    padding: 10px 12px;
  }

  .placeholder-panel {
    padding: 44px 16px;
  }

  .reference-scroll {
    padding: 16px 12px 28px;
  }

  .reference-head {
    padding: 8px 12px;
  }

  .reference-back span {
    display: none;
  }

  .ref-info-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ref-snippet {
    padding: 14px;
    font-size: 13px;
  }

  .drawer-head {
    padding: 18px 16px;
  }

  .drawer-body {
    padding: 16px 16px 28px;
  }

  .chat-welcome h1 {
    font-size: 24px;
  }

  .suggestion-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 18px;
  }

  .suggestion-card {
    padding: 11px 12px;
  }

  .welcome-mark {
    width: 46px;
    height: 46px;
    border-radius: 13px;
  }

  .welcome-mark svg {
    width: 26px;
    height: 26px;
  }

  .msg-assistant {
    gap: 9px;
  }

  .assistant-avatar {
    width: 30px;
    height: 30px;
  }

  .assistant-avatar svg {
    width: 18px;
    height: 18px;
  }

  .user-bubble {
    max-width: 88%;
  }

  .chat-stream-inner {
    padding: 18px 14px 16px;
  }

  .composer-wrap {
    padding: 8px 12px 10px;
  }

  .composer-hint {
    display: none;
  }

  .login-page {
    align-items: flex-start;
    padding: 20px 14px;
    background: var(--canvas);
  }

  .login-card {
    margin: 12px auto;
    padding: 24px 20px 18px;
  }

  .login-logo svg {
    width: 44px;
    height: 44px;
  }

  .login-brand h1 {
    font-size: 24px;
  }

  .login-field input {
    font-size: 16px;
  }

  .search-panel {
    max-height: min(76vh, 640px);
    margin-top: 7vh;
  }
}

@media (max-width: 640px) {
  .app-content--chat {
    padding: 8px;
  }

  .chat-workspace,
  .reference-page {
    border-radius: 12px;
  }

  .chat-main-head {
    min-height: 54px;
  }

  .chat-head-mark {
    display: none;
  }

  .chat-sidebar-head {
    padding: 14px 14px 8px;
  }

  .chat-tabs {
    margin: 0 14px 8px;
  }

  .page-frame-toolbar .btn {
    flex: 1;
  }

  .page-frame-toolbar .demo-inline {
    width: 100%;
    justify-content: center;
  }

  .modal {
    padding: 22px 18px;
  }

  .search-input-row {
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 22px 16px 16px;
  }

  .demo-hint {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .demo-fill {
    align-self: flex-start;
  }

  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bar-value {
    font-size: 9px;
  }

  .bar-label {
    font-size: 9px;
  }

  .donut {
    width: 140px;
    height: 140px;
  }

  .chat-main-title h1 {
    font-size: 15px;
  }

  .user-bubble {
    max-width: 92%;
  }

  .cite-ref {
    min-width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
