:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --ink: #101827;
  --muted: #687386;
  --line: rgba(88, 111, 145, 0.18);
  --line-strong: rgba(47, 88, 150, 0.28);
  --panel: rgba(255, 255, 255, 0.8);
  --panel-solid: #ffffff;
  --blue: #2167ff;
  --cyan: #00a9c7;
  --violet: #6757d8;
  --shadow: 0 22px 58px rgba(20, 33, 56, 0.105);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  height: 100%;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Noto Sans CJK SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, #fbfcfe 0%, #f5f8fb 48%, #eef4f8 100%);
  background-size: auto;
  background-attachment: fixed;
  overflow: hidden;
}

body::before,
body::after {
  content: none;
}

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

button {
  border: 0;
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.login-view {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, #fbfcfe 0%, #f5f8fb 48%, #eef4f8 100%);
  overflow: hidden;
  isolation: isolate;
}

.login-view::before {
  content: none;
}

.login-view[hidden] {
  display: none;
}

.login-panel {
  width: min(360px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
}

.login-brand h1 {
  font-size: 18px;
  font-weight: 800;
}

.login-brand p,
.login-panel label span {
  color: var(--muted);
  font-size: 12px;
}

.login-panel label {
  display: grid;
  gap: 6px;
}

.login-panel button[type="submit"] {
  height: 38px;
  border-radius: 10px;
  color: #fff;
  font-weight: 760;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.login-error {
  color: #b42318;
  font-size: 13px;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  height: 100vh;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
}

.app-shell[hidden] {
  display: none;
}

.app-shell.has-file-panel {
  grid-template-columns: 340px minmax(300px, 1fr) 312px;
}

.app-shell.preview-expanded {
  align-items: stretch;
}

.sidebar,
.file-side,
.search-shell,
.panel,
.dialog {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.sidebar {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  overflow: hidden;
  scrollbar-gutter: stable;
  border-radius: 18px;
}

.file-side {
  display: none;
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  min-height: 0;
  padding: 20px;
  overflow: auto;
  scrollbar-gutter: stable;
  border-radius: 28px;
}

.app-shell.has-file-panel .file-side {
  display: grid;
}

.brand {
  position: relative;
  z-index: 40;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
}

.account-trigger {
  width: 100%;
  min-height: 50px;
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  color: #13223a;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(232, 248, 250, 0.66)),
    linear-gradient(135deg, rgba(33, 103, 255, 0.08), rgba(0, 169, 199, 0.1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 14px 34px rgba(14, 46, 82, 0.12);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.account-trigger:hover {
  transform: translateY(-1px);
  border-color: rgba(33, 103, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 18px 42px rgba(14, 46, 82, 0.16);
}

.math-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: rgba(15, 79, 168, 0.76);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  text-shadow: 0 12px 26px rgba(33, 103, 255, 0.18);
}

.math-symbol {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-1px);
}

.math-mark.small {
  width: 32px;
  height: 32px;
}

.math-mark.small .math-symbol {
  font-size: 32px;
}

.account-title {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.account-title strong {
  min-width: 0;
  font-size: 14px;
  font-weight: 820;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-title em {
  color: #0f7490;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-style: italic;
  font-weight: 760;
  line-height: 1.2;
}

.account-chevron {
  width: 18px;
  height: 18px;
  color: #0f4fa8;
  transition: transform 0.16s ease;
}

.account-trigger[aria-expanded="true"] .account-chevron {
  transform: rotate(180deg);
}

.account-popover {
  position: absolute;
  z-index: 80;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 251, 252, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 24px 58px rgba(21, 43, 72, 0.2);
  backdrop-filter: blur(24px);
}

.account-popover[hidden] {
  display: none;
}

.account-popover-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-popover-head div {
  min-width: 0;
}

.account-popover-head strong {
  display: block;
  min-width: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-popover-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.account-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.account-stat {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(88, 111, 145, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.account-stat-feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-color: rgba(33, 103, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(232, 241, 255, 0.9), rgba(234, 251, 254, 0.78));
}

.account-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.account-stat b {
  display: block;
  margin-top: 4px;
  color: #13223a;
  font-size: 17px;
  line-height: 1.1;
}

.account-stat-feature span {
  color: #285d9f;
  font-size: 12px;
  font-weight: 760;
}

.account-stat-feature b {
  margin-top: 0;
  color: #0f4fa8;
  font-size: 22px;
}

.account-logout-button {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  padding: 7px 12px;
  border: 1px solid rgba(217, 45, 32, 0.22);
  border-radius: 12px;
  color: #b42318;
  background: rgba(255, 241, 240, 0.78);
  font-size: 12px;
  font-weight: 720;
}

.account-logout-button:hover {
  background: rgba(255, 232, 229, 0.92);
}

.brand::after {
  content: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: rgba(15, 79, 168, 0.78);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  text-shadow: 0 12px 26px rgba(33, 103, 255, 0.18);
}

.brand-mark .math-symbol {
  font-size: 36px;
}

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

.brand h1 {
  font-size: 15px;
  font-weight: 780;
}

.panel-head p,
.question-item p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.side-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding-top: 4px;
}

.section-head,
.panel-head,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  font-size: 11px;
  color: #46546a;
  text-transform: uppercase;
}

.folder-action-hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace {
  min-width: 0;
  height: calc(100vh - 44px);
  min-height: 0;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 18px;
  padding-top: min(16vh, 124px);
  padding-bottom: 22px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.app-shell.preview-expanded .workspace {
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  justify-items: stretch;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.app-shell.preview-expanded .search-shell,
.app-shell.preview-expanded .search-manager,
.app-shell.preview-expanded .results-view {
  display: none;
}

.search-shell {
  position: relative;
  width: min(760px, 100%);
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.54);
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 52px rgba(33, 66, 120, 0.11);
}

.search-shell::before {
  content: none;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 8px 0 14px;
  border: 1px solid rgba(90, 121, 168, 0.16);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.46));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 28px rgba(25, 55, 96, 0.07);
  backdrop-filter: blur(18px);
}

.search-box svg {
  width: 17px;
  height: 17px;
  color: #7890ad;
}

.search-box input {
  border: 0;
  outline: 0;
  min-width: 0;
  background: transparent;
  font-size: 15px;
}

.search-box button,
.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.icon-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 15px;
  white-space: nowrap;
}

.clear-search-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  color: #71839a;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(88, 111, 145, 0.14);
  box-shadow: none;
}

.clear-search-button:hover {
  color: #0f4fa8;
  background: rgba(232, 241, 255, 0.72);
}

.clear-search-button[hidden] {
  display: none;
}

.clear-search-button svg {
  width: 16px;
  height: 16px;
}

.search-box button {
  min-width: 66px;
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 12px;
  color: #0f4fa8;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(232, 242, 255, 0.5));
  border: 1px solid rgba(33, 103, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 20px rgba(33, 103, 255, 0.1);
  backdrop-filter: blur(14px);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.search-box button:hover {
  transform: translateY(-1px);
  border-color: rgba(33, 103, 255, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(222, 238, 255, 0.62));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 10px 24px rgba(33, 103, 255, 0.14);
}

.search-box .clear-search-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  color: #71839a;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(88, 111, 145, 0.14);
  box-shadow: none;
}

.search-box .clear-search-button:hover {
  transform: none;
  color: #0f4fa8;
  background: rgba(232, 241, 255, 0.72);
  box-shadow: none;
}

.primary-button {
  padding: 8px 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.search-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.search-segment {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  min-width: min(100%, 226px);
  padding: 3px;
  border: 1px solid rgba(88, 111, 145, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.search-segment button {
  min-height: 29px;
  padding: 5px 10px;
  border-radius: 11px;
  color: #52627a;
  background: transparent;
  font-size: 12px;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.search-segment button.active {
  color: #0f4fa8;
  background: #fff;
  box-shadow: 0 6px 16px rgba(33, 103, 255, 0.1);
}

.agent-search-button {
  min-height: 35px;
  margin-left: auto;
  padding: 6px 14px;
  color: #0f4fa8;
  border: 1px solid rgba(33, 103, 255, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(232, 242, 255, 0.5));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 20px rgba(33, 103, 255, 0.1);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.agent-search-button:hover {
  transform: translateY(-1px);
  border-color: rgba(33, 103, 255, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(222, 238, 255, 0.62));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 10px 24px rgba(33, 103, 255, 0.14);
}

.secondary-button,
.ghost-button,
.icon-button {
  padding: 8px 13px;
  color: #1e3f77;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  max-width: 100%;
}

.secondary-button {
  color: #096d7d;
  border-color: rgba(0, 169, 199, 0.22);
  background: rgba(234, 251, 254, 0.82);
}

.danger-button {
  padding: 8px 13px;
  color: #b42318;
  border: 1px solid rgba(217, 45, 32, 0.24);
  background: rgba(255, 241, 240, 0.86);
}

.icon-button {
  width: 36px;
  padding: 0;
}

.sidebar,
.folder-list,
.file-side,
.workspace,
.section-preview-panel #sectionPreviewBody,
.question-mini-card,
.structure-question-list,
.rendered-markdown pre {
  scrollbar-width: thin;
  scrollbar-color: rgba(119, 139, 166, 0.46) transparent;
}

.math-block,
.math-inline {
  scrollbar-width: none;
}

.math-block:focus,
.math-block:focus-within,
.math-inline:focus,
.math-inline:focus-within {
  scrollbar-width: thin;
  scrollbar-color: rgba(119, 139, 166, 0.46) transparent;
}

.sidebar::-webkit-scrollbar,
.folder-list::-webkit-scrollbar,
.file-side::-webkit-scrollbar,
.workspace::-webkit-scrollbar,
.section-preview-panel #sectionPreviewBody::-webkit-scrollbar,
.question-mini-card::-webkit-scrollbar,
.structure-question-list::-webkit-scrollbar,
.rendered-markdown pre::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.math-block::-webkit-scrollbar,
.math-inline::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.math-block:focus::-webkit-scrollbar,
.math-block:focus-within::-webkit-scrollbar,
.math-inline:focus::-webkit-scrollbar,
.math-inline:focus-within::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sidebar::-webkit-scrollbar-thumb,
.folder-list::-webkit-scrollbar-thumb,
.file-side::-webkit-scrollbar-thumb,
.workspace::-webkit-scrollbar-thumb,
.section-preview-panel #sectionPreviewBody::-webkit-scrollbar-thumb,
.question-mini-card::-webkit-scrollbar-thumb,
.structure-question-list::-webkit-scrollbar-thumb,
.rendered-markdown pre::-webkit-scrollbar-thumb,
.math-block::-webkit-scrollbar-thumb,
.math-inline::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(119, 139, 166, 0.42);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sidebar::-webkit-scrollbar-track,
.folder-list::-webkit-scrollbar-track,
.file-side::-webkit-scrollbar-track,
.workspace::-webkit-scrollbar-track,
.section-preview-panel #sectionPreviewBody::-webkit-scrollbar-track,
.question-mini-card::-webkit-scrollbar-track,
.structure-question-list::-webkit-scrollbar-track,
.rendered-markdown pre::-webkit-scrollbar-track,
.math-block::-webkit-scrollbar-track,
.math-inline::-webkit-scrollbar-track {
  background: transparent;
}

.folder-list {
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 0;
  margin-top: 6px;
  padding-right: 3px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.sidebar-footer-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.local-pdf-folder-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  align-content: start;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.local-pdf-folder-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  color: #46546a;
  font-size: 11px;
  font-weight: 700;
}

.local-pdf-folder-form .field {
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 8px;
  font-size: 10px;
}

.local-pdf-folder-actions {
  display: flex;
  gap: 8px;
}

.local-pdf-folder-actions .secondary-button {
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 8px;
  font-size: 10px;
}

.local-pdf-folder-form p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-node {
  display: grid;
  gap: 1px;
}

.folder-item {
  --indent: calc(var(--depth) * 14px);
  width: 100%;
  min-height: 28px;
  padding: 3px 7px 3px calc(5px + var(--indent));
  display: grid;
  grid-template-columns: 14px 15px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #314158;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.folder-item:hover {
  background: rgba(255, 255, 255, 0.66);
  border-color: var(--line);
}

.folder-item.active,
.folder-item.drag-target {
  color: #174ea6;
  background: linear-gradient(180deg, rgba(232, 241, 255, 0.96), rgba(218, 235, 255, 0.78));
  border-color: rgba(33, 103, 255, 0.2);
}

.folder-item.drag-target {
  transform: translateX(3px);
  outline: 2px solid rgba(33, 103, 255, 0.16);
}

.folder-toggle {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #7a8ba4;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.folder-toggle:hover {
  color: #174ea6;
  background: rgba(33, 103, 255, 0.08);
}

.folder-toggle.expanded {
  transform: rotate(90deg);
}

.folder-toggle.empty {
  visibility: hidden;
}

.folder-toggle svg {
  width: 12px;
  height: 12px;
}

.folder-item > svg {
  width: 15px;
  height: 15px;
}

.folder-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-file-count {
  min-width: 20px;
  min-height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(33, 103, 255, 0.08);
  color: currentColor;
  font-size: 11px;
}

.folder-analysis-badge {
  min-width: 42px;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
}

.folder-analysis-badge.running {
  color: #8a5b00;
  background: rgba(255, 188, 66, 0.18);
}

.folder-analysis-badge.running::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: folder-analysis-spin 0.8s linear infinite;
}

.folder-analysis-badge.built {
  color: #096d7d;
  background: rgba(0, 169, 199, 0.14);
}

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

.file-list {
  display: grid;
  gap: 1px;
  padding-left: calc(20px + var(--depth) * 14px);
}

.file-item {
  width: 100%;
  min-height: 26px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 22px auto;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.34);
  color: #536176;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.file-item:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
}

.file-item.active {
  color: #0f4fa8;
  background: rgba(232, 241, 255, 0.86);
  border-color: rgba(33, 103, 255, 0.2);
}

.file-item.dragging {
  opacity: 0.55;
  border-color: rgba(33, 103, 255, 0.24);
  background: rgba(232, 241, 255, 0.72);
}

.file-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
  font-size: 12px;
}

.file-item small {
  color: var(--muted);
  font-size: 10px;
  padding-top: 0;
  white-space: nowrap;
}

.file-item > svg,
.file-item .build-mark,
.file-cache-button {
  margin-top: 0;
}

.file-item > svg {
  width: 14px;
  height: 14px;
}

.file-type-icon.pdf {
  color: #d73535;
}

.file-cache-button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(88, 111, 145, 0.14);
  border-radius: 7px;
  color: #617087;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
}

.file-cache-button:hover {
  color: #0f4fa8;
  border-color: rgba(33, 103, 255, 0.24);
  background: rgba(232, 241, 255, 0.82);
}

.file-cache-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.build-mark {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(88, 111, 145, 0.26);
  color: #8a96a8;
  background: rgba(255, 255, 255, 0.78);
}

.build-mark.inline {
  margin-right: 6px;
  vertical-align: -3px;
}

.build-mark.built {
  color: #fff;
  border-color: rgba(33, 103, 255, 0.1);
  background: var(--blue);
}

.build-mark.failed {
  color: #71839a;
  background: rgba(235, 240, 247, 0.9);
}

.build-mark.building {
  border-color: rgba(33, 103, 255, 0.22);
  border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}

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

.app-shell.has-file-panel .file-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.side-mode-switch {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.side-mode-switch button {
  min-height: 34px;
  border-radius: 14px;
  color: #52627a;
  background: transparent;
  font-size: 13px;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.side-mode-switch button.active {
  color: #0f4fa8;
  background: #fff;
  box-shadow: 0 8px 20px rgba(33, 103, 255, 0.12);
}

.file-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.file-panel[hidden] {
  display: none;
}

.file-detail-body {
  position: relative;
  display: grid;
  gap: 7px;
  align-items: start;
}

.file-panel .panel-head {
  margin-bottom: 0;
}

.file-panel .panel-head h2 {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.35;
  font-size: 14px;
}

.file-panel .panel-head p {
  font-size: 11px;
}

.detail-action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.detail-action-row button {
  min-width: 0;
  padding-inline: 10px;
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
}

.detail-stat {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.5);
}

.detail-stat.wide {
  grid-column: 1 / -1;
}

.detail-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.detail-stat b {
  display: block;
  min-width: 0;
  font-size: 12px;
  margin-top: 2px;
  overflow-wrap: anywhere;
  text-align: left;
}

.remark-form {
  display: grid;
  gap: 8px;
}

.batch-build-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(33, 103, 255, 0.18);
  border-radius: 16px;
  background: rgba(232, 241, 255, 0.62);
}

.image-aggregate-box {
  border-color: rgba(103, 87, 216, 0.16);
  background: rgba(249, 248, 255, 0.66);
}

.image-learning-analysis-box {
  grid-template-columns: 1fr;
  align-items: stretch;
  border-color: rgba(17, 148, 121, 0.18);
  background: rgba(239, 250, 247, 0.72);
}

.image-learning-analysis-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.learning-analysis-prompt-input,
.learning-analysis-prefix-input {
  min-height: 132px;
  max-height: 260px;
  border-radius: 12px;
  line-height: 1.55;
  font-size: 12px;
}

.learning-analysis-prefix-input {
  min-height: 82px;
  max-height: 150px;
}

.image-learning-analysis-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-learning-analysis-presets button {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.image-batch-actions {
  display: grid;
  gap: 7px;
}

.image-batch-actions button {
  min-width: 86px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.build-method-panel {
  display: grid;
  gap: 6px;
  align-items: center;
  padding: 7px;
  border: 1px solid rgba(0, 169, 199, 0.2);
  border-radius: 12px;
  background: rgba(234, 251, 254, 0.72);
}

.build-method-actions {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.build-method-button {
  min-width: 0;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 10px;
  font-size: 11px;
}

.build-details {
  display: grid;
  gap: 6px;
  margin-top: 2px;
  padding: 7px;
  border: 1px solid rgba(33, 103, 255, 0.16);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.62);
}

.build-details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #2b3b53;
  font-size: 13px;
  cursor: pointer;
  list-style: none;
}

.build-details-head::-webkit-details-marker {
  display: none;
}

.build-details-head::before {
  content: "›";
  width: 14px;
  color: #6f8098;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.build-details[open] .build-details-head::before {
  transform: rotate(90deg);
}

.build-details-head b {
  flex: 1;
}

.build-details-head span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.build-details-body {
  display: grid;
  gap: 6px;
  padding-top: 6px;
}

.build-detail-grid {
  padding: 0;
  border: 0;
  background: transparent;
}

.build-info-groups {
  display: grid;
  gap: 6px;
}

.stage-build-actions {
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(0, 169, 199, 0.16);
  border-radius: 10px;
  background: rgba(246, 253, 255, 0.64);
}

.stage-build-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.stage-build-head b {
  color: #243247;
  font-size: 12px;
}

.stage-build-head span {
  color: var(--muted);
  font-size: 10px;
}

.stage-build-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.stage-build-button {
  min-width: 0;
  min-height: 28px;
  padding: 4px 6px;
  justify-content: center;
  text-align: center;
}

.stage-build-button span,
.stage-build-button small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.stage-build-button span {
  color: #173042;
  font-size: 10px;
  font-weight: 760;
}

.stage-build-button small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.build-info-section,
.build-raw-dimensions {
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(0, 169, 199, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.56);
}

.build-info-title {
  color: #243247;
  font-size: 12px;
  font-weight: 760;
}

.build-info-grid,
.build-raw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
}

.build-info-item,
.build-raw-item {
  min-width: 0;
  padding: 4px 5px;
  border: 1px solid rgba(88, 111, 145, 0.08);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.7);
}

.build-info-item.wide {
  grid-column: 1 / -1;
}

.build-info-item.danger {
  border-color: rgba(214, 69, 80, 0.18);
  background: rgba(255, 246, 246, 0.82);
}

.build-info-item span,
.build-raw-item span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.build-info-item b,
.build-raw-item b {
  display: block;
  min-width: 0;
  margin-top: 2px;
  color: #243247;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.build-info-item.mono b,
.build-raw-item b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.build-raw-dimensions summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #2b3b53;
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}

.build-raw-dimensions summary::-webkit-details-marker {
  display: none;
}

.build-raw-dimensions summary span {
  color: var(--muted);
  font-size: 10px;
}

.batch-build-box[hidden] {
  display: none;
}

.file-mode-card {
  position: relative;
  z-index: 30;
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(33, 103, 255, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(235, 248, 255, 0.66));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 20px rgba(33, 103, 255, 0.07);
}

.file-mode-card.cyan {
  border-color: rgba(33, 103, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(235, 248, 255, 0.66));
}

.file-mode-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.file-mode-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.file-mode-chip {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #0f4fa8;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(33, 103, 255, 0.15);
  font-size: 10px;
  font-weight: 720;
  white-space: nowrap;
}

.file-mode-chip.status,
.file-mode-chip.aggregate {
  color: #0f4fa8;
  border-color: rgba(33, 103, 255, 0.15);
}

.file-remark-dropdown {
  position: relative;
  z-index: 31;
  min-width: 0;
}

.file-remark-summary {
  max-width: 118px;
  min-height: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid rgba(33, 103, 255, 0.15);
  border-radius: 999px;
  color: #0f4fa8;
  background: rgba(255, 255, 255, 0.74);
  font-size: 10px;
  font-weight: 720;
  cursor: pointer;
  list-style: none;
}

.file-remark-summary::-webkit-details-marker {
  display: none;
}

.file-remark-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-remark-summary span.empty {
  color: #6d7d93;
  font-weight: 680;
}

.file-remark-summary i {
  color: #6f8098;
  font-style: normal;
  font-size: 10px;
  transition: transform 0.16s ease;
}

.file-remark-summary[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.file-remark-popover {
  position: fixed;
  z-index: 160;
  width: min(270px, calc(100vw - 36px));
}

.file-remark-popover[hidden] {
  display: none;
}

.file-quick-remark-form {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(33, 103, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 18px 44px rgba(20, 33, 56, 0.16);
  backdrop-filter: blur(18px);
}

.file-quick-remark-form label {
  color: #2b3b53;
  font-size: 11px;
  font-weight: 720;
}

.file-quick-remark-form .textarea-field {
  min-height: 76px;
  font-size: 12px;
  line-height: 1.45;
}

.file-quick-remark-form .primary-button {
  min-height: 30px;
  justify-self: end;
  padding: 5px 12px;
  border-radius: 10px;
  font-size: 11px;
}

.file-mode-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.file-mode-title span {
  min-width: 0;
  color: #172133;
  font-size: 13px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.file-mode-title small {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  color: #096d7d;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(0, 169, 199, 0.16);
  font-size: 10px;
  white-space: nowrap;
}

.file-mode-title b {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #52627a;
  font-size: 11px;
  white-space: nowrap;
}

.file-mode-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.file-mode-stats div {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(88, 111, 145, 0.1);
}

.file-mode-stats .wide {
  grid-column: 1 / -1;
}

.file-mode-stats span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.file-mode-stats b {
  display: block;
  min-width: 0;
  margin-top: 2px;
  color: #243247;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.file-mode-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(33, 103, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.46);
}

.compact-action {
  min-width: 0;
  min-height: 28px;
  gap: 4px;
  padding: 4px 5px;
  border-radius: 8px;
  font-size: 10px;
}

.file-mode-card .compact-action {
  color: #0f4fa8;
  border-color: rgba(33, 103, 255, 0.14);
  background: rgba(255, 255, 255, 0.7);
}

.file-mode-card .compact-action:hover {
  border-color: rgba(33, 103, 255, 0.28);
  background: rgba(232, 241, 255, 0.88);
}

.file-mode-card .danger-button.compact-action {
  color: #a4332c;
  border-color: rgba(33, 103, 255, 0.14);
  background: rgba(255, 255, 255, 0.7);
}

.file-mode-card .danger-button.compact-action:hover {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.22);
  background: rgba(255, 247, 245, 0.9);
}

.compact-action span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-action svg {
  width: 14px;
  height: 14px;
}

.file-meta-details {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(0, 169, 199, 0.16);
  border-radius: 14px;
  background: rgba(246, 253, 255, 0.5);
}

.file-meta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #2b3b53;
  font-size: 13px;
  cursor: pointer;
  list-style: none;
}

.file-meta-head::-webkit-details-marker {
  display: none;
}

.file-meta-head::before {
  content: "›";
  width: 14px;
  color: #6f8098;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.file-meta-details[open] .file-meta-head::before {
  transform: rotate(90deg);
}

.file-meta-head b {
  flex: 1;
}

.file-meta-head span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.file-meta-body {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.file-meta-body > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.file-detail-floating-tools {
  position: fixed;
  right: 28px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  pointer-events: none;
}

.file-detail-floating-tools[hidden] {
  display: none;
}

.file-detail-floating-tools details {
  position: relative;
  pointer-events: auto;
}

.file-detail-floating-tools .file-meta-details,
.file-detail-floating-tools .build-details {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.file-detail-floating-tools .file-meta-details[open],
.file-detail-floating-tools .build-details[open] {
  z-index: 91;
}

.file-detail-floating-tools .file-meta-head,
.file-detail-floating-tools .build-details-head {
  width: 34px;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 11px;
  color: #0f4fa8;
  background: rgba(255, 255, 255, 0.56);
  box-shadow:
    0 12px 28px rgba(20, 33, 56, 0.14);
  backdrop-filter: blur(16px);
}

.file-detail-floating-tools .file-meta-head:hover,
.file-detail-floating-tools .build-details-head:hover {
  color: #0b54c2;
  background: rgba(232, 241, 255, 0.82);
}

.file-detail-floating-tools .file-meta-head::before,
.file-detail-floating-tools .build-details-head::before,
.file-detail-floating-tools .file-meta-details[open] .file-meta-head::before,
.file-detail-floating-tools .build-details[open] .build-details-head::before {
  width: auto;
  color: currentColor;
  line-height: 1;
  transform: none;
}

.file-detail-floating-tools .file-meta-head::before {
  content: "✎";
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-style: italic;
  font-weight: 700;
}

.file-detail-floating-tools .build-details-head::before {
  content: "⚙";
  font-family: "Times New Roman", Georgia, serif;
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
}

.file-detail-floating-tools .file-meta-head b,
.file-detail-floating-tools .file-meta-head span,
.file-detail-floating-tools .build-details-head b,
.file-detail-floating-tools .build-details-head span {
  display: none;
}

.file-detail-floating-tools .file-meta-body,
.file-detail-floating-tools .build-details-body {
  position: absolute;
  right: 0;
  bottom: 42px;
  width: min(280px, calc(100vw - 32px));
  max-height: min(62vh, 560px);
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(33, 103, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 18px 44px rgba(20, 33, 56, 0.18);
  backdrop-filter: blur(18px);
}

.file-detail-floating-tools .file-meta-body {
  right: -40px;
}

.file-detail-floating-tools .build-details-body {
  padding-top: 10px;
}

.compact-remark-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.compact-remark-form label {
  grid-column: 1 / -1;
}

.compact-remark-form .textarea-field {
  min-height: 52px;
}

.batch-build-box b,
.build-method-panel b {
  display: block;
  margin-bottom: 1px;
  font-size: 12px;
}

.batch-build-box p,
.build-method-panel p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.pdf-kind-label {
  border: 1px solid rgba(88, 111, 145, 0.14);
  color: #46546a;
  background: rgba(255, 255, 255, 0.68);
}

.pdf-kind-label.aggregate {
  border-color: rgba(103, 87, 216, 0.22);
  color: #5145a8;
  background: rgba(247, 245, 255, 0.78);
}

.image-aggregate-source-meta {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.image-aggregate-source-meta div {
  display: grid;
  gap: 2px;
  padding: 6px 7px;
  border: 1px solid rgba(103, 87, 216, 0.12);
  border-radius: 9px;
  background: rgba(249, 248, 255, 0.64);
}

.image-aggregate-source-meta span,
.image-aggregate-source-meta b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.image-aggregate-source-meta span {
  color: #243247;
  font-size: 11px;
}

.image-aggregate-source-meta b {
  color: #6757d8;
  font-size: 10px;
}

.file-structure {
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.large-pdf-structure,
.small-pdf-structure,
.small-pdf-direct-structure,
.image-direct-structure {
  border-color: transparent;
  background: transparent;
}

.structure-inline-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.file-structure-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  color: #243247;
  font-size: 12px;
}

.file-structure-head div {
  min-width: 0;
}

.file-structure-head b {
  display: block;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.file-structure-head p {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
}

.file-structure-head span {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  color: #0f4fa8;
  border: 1px solid rgba(33, 103, 255, 0.14);
  background: rgba(255, 255, 255, 0.64);
  font-size: 10px;
  font-weight: 720;
  white-space: nowrap;
}

.file-structure-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.enhance-scope-button {
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 8px;
  font-size: 10px;
}

.section-tree {
  display: grid;
  gap: 3px;
  isolation: isolate;
}

.structure-section {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.structure-section.active {
  position: relative;
}

.structure-section.active::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  border-radius: 99px;
  background: rgba(33, 103, 255, 0.62);
}

.structure-section.active .structure-section-toggle {
  color: #0f4fa8;
}

.structure-section-bar {
  position: sticky;
  top: 50px;
  z-index: 8;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  gap: 4px;
  align-items: stretch;
  padding: 4px;
  border: 1px solid rgba(88, 111, 145, 0.12);
  border-radius: 9px;
  color: #243247;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 14px rgba(20, 33, 56, 0.055);
}

.structure-section-bar.has-enhance {
  grid-template-columns: minmax(0, 1fr) 26px 26px;
}

.structure-section.active .structure-section-bar {
  border-color: rgba(33, 103, 255, 0.16);
  background: rgba(255, 255, 255, 0.96);
}

.structure-section-toggle {
  min-width: 0;
  display: grid;
  gap: 1px;
  padding: 0 2px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.structure-section-toggle:hover {
  color: #0f4fa8;
}

.structure-section-preview,
.structure-section-enhance {
  width: 26px;
  min-height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(33, 103, 255, 0.12);
  border-radius: 7px;
  color: #0f4fa8;
  background: rgba(232, 241, 255, 0.54);
}

.structure-section-preview:hover {
  border-color: rgba(33, 103, 255, 0.28);
  background: rgba(219, 236, 255, 0.9);
}

.structure-section-enhance {
  color: #8a96a8;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.72);
}

.structure-section-enhance:hover {
  color: #fff;
  border-color: rgba(33, 103, 255, 0.22);
  background: var(--blue);
}

.structure-section-preview svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.structure-section-toggle span,
.structure-question span {
  overflow-wrap: anywhere;
  min-width: 0;
}

.structure-section-toggle span {
  display: flex;
  gap: 4px;
  align-items: center;
  line-height: 1.22;
}

.structure-section-toggle i {
  width: 11px;
  color: #6f8098;
  font-style: normal;
}

.structure-section-toggle small,
.structure-question small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.structure-question-list {
  display: grid;
  gap: 3px;
  padding-left: 5px;
  scroll-behavior: smooth;
}

.structure-question-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 4px;
  align-items: stretch;
  min-width: 0;
}

.structure-question {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 2px 5px;
  align-items: start;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #4d5d73;
  background: rgba(255, 255, 255, 0.3);
  text-align: left;
}

.structure-question:hover {
  color: #0f4fa8;
  background: rgba(232, 241, 255, 0.7);
}

.structure-question.active {
  color: #0f4fa8;
  border-color: rgba(33, 103, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(232, 241, 255, 0.82));
  box-shadow:
    inset 2px 0 0 rgba(33, 103, 255, 0.8),
    0 6px 14px rgba(33, 103, 255, 0.08);
}

.structure-question span {
  grid-column: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.28;
  font-size: 11px;
}

.structure-question-basket-button {
  width: 30px;
  min-width: 30px;
  min-height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(88, 111, 145, 0.16);
  border-radius: 8px;
  color: #1e3f77;
  background: rgba(255, 255, 255, 0.74);
  font-size: 10px;
  font-weight: 800;
}

.structure-question-basket-button:hover {
  color: #0f4fa8;
  border-color: rgba(33, 103, 255, 0.28);
  background: rgba(232, 241, 255, 0.9);
}

.structure-question-basket-button:disabled,
.question-basket-add-button:disabled {
  cursor: default;
  color: #6b7890;
  border-color: rgba(88, 111, 145, 0.12);
  background: rgba(241, 245, 249, 0.86);
}

.structure-question small {
  grid-column: 2;
}

.enhance-mark {
  width: 15px;
  height: 15px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(88, 111, 145, 0.24);
  border-radius: 999px;
  color: #9aa7b8;
  background: rgba(255, 255, 255, 0.76);
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.enhance-mark.built {
  color: #fff;
  border-color: rgba(33, 103, 255, 0.1);
  background: var(--blue);
  box-shadow: 0 4px 10px rgba(33, 103, 255, 0.16);
}

.enhance-mark.queued,
.enhance-mark.building {
  color: transparent;
  border-color: rgba(33, 103, 255, 0.2);
  border-top-color: var(--blue);
  background: rgba(255, 255, 255, 0.86);
  animation: spin 0.8s linear infinite;
}

.enhance-mark.failed {
  color: #b42318;
  border-color: rgba(217, 45, 32, 0.24);
  background: rgba(255, 241, 240, 0.86);
}

.pipeline-artifacts {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(0, 169, 199, 0.18);
  border-radius: 14px;
  background: rgba(234, 251, 254, 0.5);
}

.pipeline-artifacts-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  cursor: pointer;
  list-style: none;
}

.pipeline-artifacts-head::-webkit-details-marker {
  display: none;
}

.pipeline-artifacts-head::before {
  content: "›";
  width: 14px;
  color: #6f8098;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.pipeline-artifacts[open] .pipeline-artifacts-head::before {
  transform: rotate(90deg);
}

.pipeline-artifacts-head b {
  flex: 1;
}

.pipeline-artifacts-head span,
.artifact-link small {
  color: var(--muted);
  font-size: 11px;
}

.artifact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 5px;
  align-items: stretch;
  min-width: 0;
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.54);
}

.artifact-row.pending {
  border: 1px dashed rgba(214, 143, 0, 0.32);
  color: #80540a;
  background: rgba(255, 250, 236, 0.72);
}

.artifact-link {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-decoration: none;
  text-align: left;
}

.artifact-link span,
.artifact-link small {
  overflow-wrap: anywhere;
}

.artifact-cache-button {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  align-self: center;
  border: 1px solid rgba(88, 111, 145, 0.14);
  border-radius: 9px;
  color: #617087;
  background: rgba(255, 255, 255, 0.5);
}

.artifact-cache-button:hover {
  color: #0f4fa8;
  border-color: rgba(33, 103, 255, 0.24);
  background: rgba(232, 241, 255, 0.82);
}

.artifact-cache-button svg {
  width: 14px;
  height: 14px;
}

.structure-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 6px 8px;
}

.question-detail-body,
.question-detail {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.question-detail-body {
  align-content: start;
}

.question-detail h3 {
  margin: 0;
  min-width: 0;
  color: #172133;
  font-size: 13px;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.question-detail-head {
  display: grid;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid rgba(33, 103, 255, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 250, 255, 0.5));
}

.question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.question-actions button {
  min-width: 0;
  flex: 1 1 92px;
  padding-inline: 10px;
}

.question-head-top {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.question-head-meta {
  min-width: 0;
  display: flex;
  gap: 4px;
  align-items: center;
  overflow: hidden;
}

.question-head-meta span {
  min-width: 0;
  max-width: 92px;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 6px;
  color: #33506f;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-tool-row {
  display: inline-flex;
  justify-content: flex-end;
  gap: 5px;
  align-items: center;
  flex: 0 0 auto;
}

.question-tool-row .enhance-mark {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.question-tool-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(88, 111, 145, 0.16);
  border-radius: 10px;
  color: #1e3f77;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.question-tool-button:hover {
  color: #0f4fa8;
  border-color: rgba(33, 103, 255, 0.28);
  background: rgba(232, 241, 255, 0.9);
}

.question-tool-button svg {
  width: 15px;
  height: 15px;
}

.question-page-edit-form {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.question-page-edit-fields {
  display: grid;
  grid-template-columns: minmax(104px, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.question-page-edit-fields label {
  min-width: 0;
  min-height: 26px;
  display: grid;
  grid-template-columns: auto minmax(2.8em, 1fr);
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 6px;
  border: 1px solid rgba(88, 111, 145, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.question-page-edit-fields .stem-page-field {
  grid-template-columns: auto minmax(4.7em, 6.2em);
}

.question-page-edit-fields .figure-page-field {
  grid-template-columns: auto 2.8em;
}

.question-page-edit-fields label span {
  color: #52627a;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
}

.question-page-edit-fields input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 1px 0;
  color: #172133;
  background: transparent;
  font-size: 11px;
  line-height: 1.3;
}

.question-page-edit-fields button {
  min-height: 26px;
  padding: 3px 7px;
  border-radius: 8px;
  font-size: 10px;
}

@media (max-width: 720px) {
  .question-page-edit-fields {
    grid-template-columns: minmax(98px, 1fr) auto auto;
  }
}

.question-page-edit-fields button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.question-page-edit-form p {
  margin: 0;
  color: #7a8799;
  font-size: 10px;
  line-height: 1.35;
}

.question-detail.compact .question-id-line {
  display: none;
}

.question-detail .question-id-line {
  width: auto;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  color: #7a8799;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.question-tag-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.question-tag-strip span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid rgba(0, 169, 199, 0.18);
  border-radius: 999px;
  color: #096d7d;
  background: rgba(234, 251, 254, 0.62);
  font-size: 11px;
  line-height: 1.2;
}

.question-content-section {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(88, 111, 145, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
}

.question-detail.compact .question-stem-section {
  margin-top: -2px;
}

.question-detail.compact .question-stem-section .question-section-head {
  padding-bottom: 5px;
}

.question-detail.compact .question-stem-text {
  font-size: 12px;
  line-height: 1.48;
}

.question-stem-tag-block {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.question-stem-tag-block .question-tag-strip {
  gap: 4px;
}

.question-stem-tag-block .question-tag-strip span {
  max-width: 100%;
  min-height: 20px;
  padding: 2px 6px;
  font-size: 10.5px;
  overflow-wrap: anywhere;
}

.question-detail.compact .question-stem-tag-block {
  gap: 3px;
}

.analysis-section {
  border-color: rgba(0, 169, 199, 0.2);
  background: rgba(246, 253, 255, 0.62);
}

.ai-analysis-section {
  min-height: 138px;
  border-style: dashed;
  border-color: rgba(103, 87, 216, 0.22);
  background: rgba(249, 248, 255, 0.48);
}

.enhancement-flow {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.enhancement-section {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.enhancement-section h4 {
  margin: 0;
  color: #243247;
  font-size: 12px;
  line-height: 1.3;
}

.question-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(88, 111, 145, 0.12);
}

.question-section-head b {
  color: #243247;
  font-size: 13px;
}

.question-section-head span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.question-stem-head {
  justify-content: space-between;
  align-items: flex-start;
  min-height: 32px;
  gap: 8px;
}

.question-section-focus-button {
  flex: 0 0 auto;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
}

.question-rich-body {
  min-width: 0;
  font-size: 12px;
}

.question-rich-body > :first-child {
  margin-top: 0;
}

.question-rich-body > :last-child {
  margin-bottom: 0;
}

.question-stem-layout {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-items: start;
}

.question-stem-layout.has-figure {
  grid-template-columns: minmax(0, 1fr);
}

.question-stem-figures {
  min-width: 0;
}

.question-stem-figures .enhancement-svg-grid {
  gap: 6px;
}

.question-stem-figures .enhancement-svg-grid.count-1 {
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
}

.question-stem-figures .enhancement-svg-grid .enhancement-svg-item:last-child:nth-child(odd):not(:first-child) {
  width: min(100%, 520px);
}

.question-stem-figures .enhancement-svg-item .markdown-svg-canvas {
  min-height: 150px;
  max-height: 360px;
  padding: 8px;
}

.question-stem-figures .enhancement-svg-item .markdown-svg-canvas svg {
  max-height: 330px;
}

.question-detail.focus .question-stem-layout.has-figure {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 42%);
  gap: 12px;
}

.question-detail.focus .question-stem-figures .enhancement-svg-item .markdown-svg-canvas {
  min-height: 220px;
  max-height: 480px;
}

.question-detail.focus .question-stem-figures .enhancement-svg-item .markdown-svg-canvas svg {
  max-height: 440px;
}

.question-empty-block {
  min-height: 52px;
  display: grid;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.question-empty-block.danger {
  padding: 10px;
  border: 1px solid rgba(217, 45, 32, 0.18);
  border-radius: 12px;
  color: #b42318;
  background: rgba(255, 241, 240, 0.7);
}

.ai-tags span {
  border-color: rgba(103, 87, 216, 0.2);
  color: #5145a8;
  background: rgba(247, 245, 255, 0.74);
}

.enhancement-facts {
  display: grid;
  gap: 6px;
}

.enhancement-facts div {
  min-width: 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 9px;
  border: 1px solid rgba(103, 87, 216, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
}

.enhancement-facts span {
  flex: 0 0 34px;
  color: #7a8799;
  font-size: 11px;
  line-height: 1.45;
}

.enhancement-facts p {
  min-width: 0;
  margin: 0;
  color: #27364d;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.enhancement-svg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-items: start;
}

.enhancement-svg-grid.count-1 {
  grid-template-columns: minmax(0, 52%);
  justify-content: center;
}

.enhancement-svg-grid.count-3 .enhancement-svg-item:last-child,
.enhancement-svg-grid .enhancement-svg-item:last-child:nth-child(odd):not(:first-child) {
  grid-column: 1 / -1;
  width: min(52%, 520px);
  justify-self: center;
}

.enhancement-svg-item {
  min-width: 0;
  margin: 0;
}

.enhancement-svg-item .markdown-svg-canvas {
  min-height: 86px;
  max-height: 260px;
  padding: 10px;
  border-radius: 12px;
}

.enhancement-svg-item .markdown-svg-canvas svg {
  max-height: 230px;
}

.question-analysis-reserve {
  display: grid;
  gap: 8px;
  padding: 2px 0 4px;
}

.question-analysis-reserve i {
  display: block;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(103, 87, 216, 0.12), rgba(33, 103, 255, 0.08), rgba(255, 255, 255, 0.24));
}

.question-analysis-reserve i:nth-child(2) {
  width: 82%;
}

.question-analysis-reserve i:nth-child(3) {
  width: 58%;
}

.question-mini-card {
  min-width: 0;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

.batch-build-box button:disabled {
  cursor: default;
  opacity: 0.7;
}

.remark-form label {
  color: #46546a;
  font-size: 12px;
}

.textarea-field {
  min-height: 72px;
  resize: vertical;
}

.panel {
  width: min(1120px, 100%);
  max-width: 1120px;
  padding: 20px;
  border-radius: 26px;
}

.panel-head {
  margin-bottom: 14px;
}

.section-preview-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(820px, 100%);
  max-height: min(46vh, 430px);
  overflow: visible;
  border-color: rgba(33, 103, 255, 0.22);
}

.section-preview-panel::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 52px;
  width: 16px;
  height: 16px;
  border-left: 1px solid rgba(33, 103, 255, 0.22);
  border-top: 1px solid rgba(33, 103, 255, 0.22);
  background: rgba(255, 255, 255, 0.86);
  transform: rotate(45deg);
}

.section-preview-panel.expanded {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  padding: 16px;
  border-radius: 26px;
  overflow: hidden;
}

.section-preview-panel.expanded .panel-head {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-preview-panel.expanded #sectionPreviewBody {
  min-height: 0;
  overflow: auto;
  padding-right: 8px;
}

.section-preview-panel.expanded::before {
  display: none;
}

.section-preview-panel[hidden] {
  display: none;
}

.question-focus-layer {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: min(72vh, 680px);
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  padding: 16px;
  border-color: rgba(33, 103, 255, 0.22);
  border-radius: 26px;
  overflow: hidden;
}

.question-focus-layer[hidden] {
  display: none;
}

.question-focus-layer .panel-head {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.question-focus-layer .panel-head h2 {
  max-width: min(820px, 72vw);
  overflow: hidden;
  color: #172133;
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-focus-body {
  min-height: 0;
  overflow: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.question-detail.focus {
  gap: 12px;
}

.question-detail.focus .question-detail-head {
  padding: 9px 10px;
}

.question-detail.focus h3 {
  font-size: 16px;
}

.question-detail.focus .question-id-line {
  display: block;
}

.question-detail.focus .question-rich-body {
  font-size: 13px;
  line-height: 1.62;
}

.preview-actions {
  display: inline-flex;
  gap: 6px;
}

.section-preview-panel:not(.expanded) #sectionPreviewBody {
  max-height: min(34vh, 320px);
  overflow: auto;
  padding-right: 4px;
}

.file-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 16px;
  background: #fff;
}

.file-preview-media {
  width: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}

.file-preview-media img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  border-radius: 16px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 33, 56, 0.08);
}

.download-only {
  height: 100%;
  min-height: 260px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  border: 1px dashed rgba(33, 103, 255, 0.22);
  border-radius: 18px;
  color: #243247;
  background: rgba(248, 251, 255, 0.72);
  text-align: center;
}

.download-only p {
  max-width: 360px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.download-only-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.rendered-markdown {
  min-width: 0;
  color: #1d2736;
  line-height: 1.78;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.markdown-preview-body {
  padding: 0 8px 16px 0;
}

.word-preview-body {
  padding: 0 8px 16px 0;
  background: #f4f7fb;
}

.word-preview-document {
  max-width: 860px;
  min-height: 100%;
  margin: 0 auto;
  padding: 28px 34px;
  border: 1px solid rgba(25, 35, 55, 0.08);
  border-radius: 10px;
  background: #fff;
  color: #000;
  box-shadow: 0 12px 28px rgba(20, 33, 56, 0.08);
}

.word-preview-document p {
  margin: 0 0 10px;
  color: #000;
  line-height: 1.82;
  white-space: normal;
}

.word-preview-document .word-preview-empty {
  min-height: 1em;
}

.word-preview-document table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
  color: #000;
}

.word-preview-document td {
  padding: 7px 9px;
  border: 1px solid #d9dee8;
  vertical-align: top;
  color: #000;
}

.word-preview-document td p {
  margin-bottom: 6px;
}

.markdown-loading {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(33, 103, 255, 0.18);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.72);
}

.rendered-markdown h1,
.rendered-markdown h2,
.rendered-markdown h3 {
  margin: 14px 0 8px;
  line-height: 1.35;
  color: #111827;
}

.rendered-markdown h1 {
  font-size: 18px;
}

.rendered-markdown h2 {
  font-size: 15px;
}

.rendered-markdown h3 {
  font-size: 13px;
}

.rendered-markdown p,
.rendered-markdown ul,
.rendered-markdown ol {
  margin: 8px 0;
}

.rendered-markdown table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.rendered-markdown th,
.rendered-markdown td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: top;
}

.rendered-markdown pre {
  overflow: auto;
  padding: 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.06);
}

.rendered-markdown code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.markdown-svg-block {
  margin: 14px 0;
  padding: 0;
}

.markdown-svg-canvas {
  width: 100%;
  min-height: 120px;
  max-height: min(58vh, 620px);
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(33, 103, 255, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(rgba(88, 111, 145, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 111, 145, 0.06) 1px, transparent 1px),
    #fff;
  background-size: 18px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.markdown-svg-canvas svg {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(52vh, 560px);
  height: auto;
  overflow: visible;
}

.question-detail .markdown-svg-block {
  max-width: min(520px, 52%);
  margin-left: auto;
  margin-right: auto;
}

.question-detail .markdown-svg-canvas {
  min-height: 96px;
  max-height: min(42vh, 420px);
}

.question-detail .markdown-svg-canvas svg {
  max-height: min(38vh, 380px);
}

.question-mini-card .markdown-svg-canvas {
  min-height: 80px;
  max-height: 220px;
  padding: 10px;
}

.question-mini-card .markdown-svg-canvas svg {
  max-height: 190px;
}

.math-block {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 10px 0;
  padding: 4px 0;
  outline: 0;
}

.math-inline {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  vertical-align: -0.12em;
  outline: 0;
}

.field {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 9px 12px;
  outline: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}

.tag,
.keyword-tag {
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  color: #1f5fb8;
  background: rgba(232, 241, 255, 0.78);
  border: 1px solid rgba(33, 103, 255, 0.16);
  font-size: 12px;
}

.keyword-tag {
  cursor: pointer;
}

.clear-filter-button {
  width: fit-content;
  margin: -2px 0 12px;
  min-height: 34px;
  padding: 6px 12px;
  color: #5b6b80;
  background: rgba(255, 255, 255, 0.54);
}

.clear-filter-button[hidden] {
  display: none;
}

.search-manager {
  width: min(820px, 100%);
  max-width: 820px;
  padding: 10px;
  border-radius: 22px;
}

.search-manager[hidden] {
  display: none;
}

.search-manager-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.85fr) repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.search-manager-intro {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(33, 103, 255, 0.16);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.72);
}

.search-manager-title-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.search-manager-title-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.search-manager-intro p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term-column {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(34px, auto);
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(88, 111, 145, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.term-column.drag-over {
  border-color: rgba(33, 103, 255, 0.34);
  background: rgba(232, 241, 255, 0.76);
  transform: translateY(-1px);
}

.term-column-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}

.term-column-head b {
  font-size: 12px;
}

.term-column-head span {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 7px;
}

.manager-add-form {
  grid-template-columns: 34px minmax(0, 1fr);
}

.term-add-form .field {
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 11px;
  font-size: 12px;
}

.manager-add-form .icon-button {
  width: 34px;
  min-height: 34px;
  border-radius: 11px;
}

.term-list {
  min-height: 34px;
  max-height: 76px;
  display: flex;
  align-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 5px;
  overflow: auto;
  padding-right: 2px;
}

.term-column[data-term-column="files"] .term-list {
  overflow: auto;
}

.term-chip {
  position: relative;
  max-width: 100%;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid rgba(33, 103, 255, 0.16);
  border-radius: 999px;
  color: #164ea6;
  background: rgba(232, 241, 255, 0.78);
  font-size: 11px;
  cursor: grab;
}

.term-chip.priority {
  color: #316083;
  background: rgba(236, 248, 255, 0.78);
  border-color: rgba(0, 169, 199, 0.16);
}

.term-chip.files {
  color: #66511e;
  background: rgba(255, 248, 228, 0.8);
  border-color: rgba(154, 106, 18, 0.16);
}

.scope-chip.exclude {
  color: #8a2d3b;
  background: rgba(255, 236, 239, 0.86);
  border-color: rgba(190, 64, 84, 0.22);
}

.scope-chip button {
  min-height: 20px;
  padding: 1px 5px;
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(88, 111, 145, 0.14);
  font-size: 10px;
}

.scope-chip {
  cursor: default;
}

.scope-summary-chip {
  width: 100%;
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  cursor: default;
}

.scope-summary-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-summary-chip small {
  min-width: 0;
  color: rgba(102, 81, 30, 0.72);
  font-size: 10px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-summary-chip.has-exclude {
  color: #7f3942;
  background: rgba(255, 241, 226, 0.88);
  border-color: rgba(190, 92, 52, 0.18);
}

.scope-summary-clear {
  width: 18px;
  height: 18px;
  min-height: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: rgba(49, 65, 88, 0.64);
  background: transparent;
  font-size: 13px;
  line-height: 1;
}

.scope-summary-clear:hover {
  color: #8a2d3b;
  background: rgba(190, 64, 84, 0.1);
}

.term-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.term-chip i {
  font-style: normal;
  color: rgba(49, 65, 88, 0.64);
}

.scope-info-popover {
  position: fixed;
  z-index: 2147483000;
  max-height: min(520px, calc(100vh - 24px));
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(88, 111, 145, 0.18);
  border-radius: 12px;
  color: #27364a;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 24px 70px rgba(20, 33, 56, 0.24);
  pointer-events: auto;
}

.scope-info-popover[hidden] {
  display: none;
}

.scope-info-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(88, 111, 145, 0.14);
}

.scope-info-head b {
  display: block;
  font-size: 13px;
}

.scope-info-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.scope-info-head span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  color: #0f4fa8;
  background: rgba(232, 241, 255, 0.82);
  font-size: 11px;
  white-space: nowrap;
}

.scope-info-list {
  display: grid;
  gap: 8px;
}

.scope-info-item {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(88, 111, 145, 0.14);
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.74);
}

.scope-info-item.exclude {
  background: rgba(255, 246, 247, 0.86);
  border-color: rgba(190, 64, 84, 0.18);
}

.scope-info-item-head {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.scope-info-item-head span {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  color: #66511e;
  background: rgba(255, 248, 228, 0.9);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.scope-info-item.exclude .scope-info-item-head span {
  color: #8a2d3b;
  background: rgba(255, 236, 239, 0.9);
}

.scope-info-item-head b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #263850;
  font-weight: 700;
  line-height: 1.35;
}

.scope-info-item-lines {
  display: grid;
  gap: 4px;
}

.scope-info-line {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.scope-info-line span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
}

.scope-info-line b {
  min-width: 0;
  color: #314158;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-info-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.scope-info-actions button {
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(88, 111, 145, 0.16);
  border-radius: 8px;
  color: #46546a;
  background: rgba(255, 255, 255, 0.76);
  font-size: 10px;
}

.scope-info-actions button:hover {
  color: #0f4fa8;
  border-color: rgba(33, 103, 255, 0.24);
  background: rgba(232, 241, 255, 0.78);
}

.term-empty {
  width: 100%;
  min-height: 32px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(88, 111, 145, 0.18);
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
}

.question-list {
  display: grid;
  gap: 10px;
}

.question-item,
.search-result-item {
  position: relative;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.search-result-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.search-result-item:hover {
  border-color: rgba(33, 103, 255, 0.28);
  background: linear-gradient(180deg, rgba(246, 251, 255, 0.96), rgba(232, 241, 255, 0.72));
  box-shadow: 0 18px 44px rgba(33, 103, 255, 0.12);
  transform: translateY(-2px);
}

.search-result-item.priority {
  border-color: rgba(0, 169, 199, 0.24);
  background: rgba(246, 253, 255, 0.9);
}

.search-result-kind {
  min-width: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(33, 103, 255, 0.14);
  border-radius: 13px;
  color: #164ea6;
  background: rgba(232, 241, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.search-result-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.search-result-title {
  min-width: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.search-result-title b {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.search-result-title span {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: #096d7d;
  background: rgba(234, 251, 254, 0.82);
  border: 1px solid rgba(0, 169, 199, 0.18);
  font-size: 11px;
}

.search-result-main p {
  margin: 0;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(33, 103, 255, 0.1);
  border-radius: 12px;
  color: #27364a;
  background: rgba(248, 251, 255, 0.76);
  font-size: 12px;
  line-height: 1.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.search-result-actions {
  display: grid;
  align-content: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.search-result-item:hover .search-result-actions,
.search-result-item:focus-within .search-result-actions {
  opacity: 1;
  pointer-events: auto;
}

.search-result-actions button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(33, 103, 255, 0.18);
  border-radius: 999px;
  color: #0f4fa8;
  background: rgba(232, 241, 255, 0.82);
  font-size: 12px;
}

.search-result-actions button:disabled {
  color: #6b7890;
  background: rgba(241, 245, 249, 0.86);
  border-color: rgba(88, 111, 145, 0.12);
  cursor: default;
}

.search-result-actions .search-cache-button {
  width: 30px;
  min-width: 30px;
  padding: 0;
  justify-self: end;
  display: grid;
  place-items: center;
  border-color: rgba(88, 111, 145, 0.14);
  color: #617087;
  background: rgba(255, 255, 255, 0.5);
}

.search-result-actions .search-cache-button:hover {
  color: #0f4fa8;
  border-color: rgba(33, 103, 255, 0.24);
  background: rgba(232, 241, 255, 0.82);
}

.search-result-actions .search-cache-button svg {
  width: 14px;
  height: 14px;
}

.question-basket {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(12px);
}

.question-basket > button {
  width: 100%;
  min-height: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 8px;
  color: #1e3f77;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  font-size: 10px;
}

.question-basket > button span {
  min-width: 18px;
  min-height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #0f4fa8;
  background: rgba(33, 103, 255, 0.08);
  font-size: 10px;
}

.question-basket-body {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 70;
  width: calc(200% + 8px);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 20px 48px rgba(24, 43, 75, 0.18);
  backdrop-filter: blur(22px);
}

.question-basket-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  max-height: 220px;
  overflow: auto;
}

.question-basket-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 0;
}

.question-basket-actions button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid rgba(33, 103, 255, 0.16);
  border-radius: 11px;
  color: #0f4fa8;
  background: rgba(232, 241, 255, 0.76);
  font-size: 12px;
  white-space: normal;
}

.question-basket-actions button:disabled {
  cursor: default;
  color: #8c98aa;
  border-color: rgba(88, 111, 145, 0.12);
  background: rgba(241, 245, 249, 0.72);
}

.question-basket-actions button.loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.question-basket-actions button.loading::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 2px solid rgba(15, 79, 168, 0.22);
  border-top-color: #0f4fa8;
  border-radius: 50%;
  animation: basket-button-spin 0.8s linear infinite;
}

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

.question-basket.collapsed .question-basket-actions,
.question-basket.collapsed .question-basket-list,
.question-basket.collapsed .question-basket-body {
  display: none;
}

.question-basket.collapsed {
  margin: 0;
  padding: 7px;
}

.question-basket.collapsed > button {
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 8px;
  font-size: 10px;
}

.basket-question-item {
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 12px;
  color: #314158;
  background: rgba(248, 251, 255, 0.78);
  border: 1px solid rgba(88, 111, 145, 0.14);
  text-align: left;
}

.basket-question-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.basket-question-item i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #8a2d3b;
  background: rgba(255, 236, 239, 0.86);
  font-style: normal;
}

.basket-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 8px;
}

.search-mark {
  border-radius: 5px;
  padding: 0 3px;
  color: #123f88;
  background: rgba(170, 211, 255, 0.58);
}

.search-mark.priority {
  color: #20536d;
  background: rgba(202, 238, 249, 0.62);
}

.question-item.search-hit {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.question-hit-id {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(33, 103, 255, 0.14);
  border-radius: 12px;
  color: #164ea6;
  background: rgba(232, 241, 255, 0.72);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.question-hit-body {
  min-width: 0;
}

.question-hit-body > div {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.question-hit-body span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: #096d7d;
  background: rgba(234, 251, 254, 0.82);
  border: 1px solid rgba(0, 169, 199, 0.18);
  font-size: 12px;
}

.question-hit-body mark {
  border-radius: 4px;
  padding: 0 2px;
  color: inherit;
  background: rgba(255, 218, 92, 0.55);
}

.question-id-line {
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 10px;
  color: #164ea6;
  background: rgba(232, 241, 255, 0.82);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.markdown-text {
  white-space: normal;
}

.question-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 99px;
  background: linear-gradient(var(--blue), var(--cyan));
}

.question-item b {
  display: block;
  margin-bottom: 6px;
}

.question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.empty-state,
.empty-inline {
  min-height: 110px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
}

.empty-inline {
  min-height: 48px;
}

.context-menu {
  position: fixed;
  z-index: 30;
  width: min(220px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 255, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 22px 54px rgba(24, 43, 75, 0.2);
  backdrop-filter: blur(24px);
}

.context-menu button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
  background: transparent;
  color: #243247;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.context-menu button:hover {
  color: #0f4fa8;
  background: rgba(232, 241, 255, 0.86);
  transform: translateX(2px);
}

.context-menu .danger-menu-button {
  color: #b42318;
}

.context-menu .danger-menu-button:hover {
  color: #9f1d14;
  background: rgba(255, 241, 240, 0.88);
}

.context-menu button:disabled {
  cursor: default;
  color: #98a4b5;
  background: transparent;
  transform: none;
  opacity: 0.58;
}

.dialog {
  width: min(470px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  border-radius: 24px;
}

.dialog.wide {
  width: min(840px, calc(100vw - 32px));
}

.dialog::backdrop {
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(10px);
}

.dialog form,
.question-modal {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.image-aggregate-form {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.folder-rename-form {
  display: grid;
  gap: 12px;
}

.dialog-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-error {
  color: #b42318;
  font-size: 12px;
  line-height: 1.45;
}

.button-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-right-color: #fff;
  border-radius: 50%;
  animation: folder-analysis-spin 0.8s linear infinite;
}

.button-spinner[hidden] {
  display: none;
}

.image-aggregate-list {
  display: grid;
  gap: 8px;
  max-height: min(62vh, 620px);
  overflow: auto;
  padding-right: 4px;
}

.image-aggregate-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(88, 111, 145, 0.12);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.78);
}

.image-aggregate-summary b {
  color: #243247;
  font-size: 13px;
}

.image-aggregate-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.image-aggregate-item {
  display: grid;
  grid-template-columns: 24px 28px 68px minmax(0, 1fr) 92px;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(88, 111, 145, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.image-aggregate-item.dragging {
  opacity: 0.6;
}

.image-aggregate-item.drag-over {
  border-color: rgba(103, 87, 216, 0.36);
  background: rgba(247, 245, 255, 0.82);
}

.image-aggregate-drag {
  color: #98a5b7;
  cursor: grab;
  font-weight: 800;
  letter-spacing: 0;
}

.image-aggregate-item > b {
  color: #243247;
  font-size: 13px;
  text-align: center;
}

.image-aggregate-thumb {
  width: 68px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(88, 111, 145, 0.12);
  border-radius: 10px;
  background: #fff;
}

.image-aggregate-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.image-aggregate-name {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.image-aggregate-name span,
.image-aggregate-name small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-aggregate-name span {
  color: #243247;
  font-size: 13px;
  font-weight: 720;
}

.image-aggregate-name small {
  color: var(--muted);
  font-size: 11px;
}

.image-aggregate-item label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.image-aggregate-item input {
  min-height: 34px;
  border-radius: 10px;
}

.image-aggregate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

@media (max-width: 860px) {
  .image-learning-analysis-head {
    grid-template-columns: 1fr;
  }

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

.question-full {
  display: grid;
  gap: 12px;
  line-height: 1.75;
}

.svg-preview {
  width: 100%;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(33, 103, 255, 0.14);
  border-radius: 16px;
  background: #fff;
}

.svg-preview svg {
  max-width: 100%;
  max-height: min(52vh, 560px);
  height: auto;
  display: block;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 15px;
  background: rgba(16, 24, 39, 0.94);
  color: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    padding: 12px;
    overflow: visible;
  }

  .sidebar,
  .file-side {
    position: static;
    height: auto;
    max-height: none;
  }

  .sidebar {
    display: block;
    overflow: visible;
  }

  .side-section {
    display: block;
  }

  .folder-list {
    max-height: 42vh;
  }

  .workspace {
    height: auto;
    overflow: visible;
    padding-top: 12px;
  }

  .app-shell.preview-expanded .workspace {
    grid-template-rows: auto;
    overflow: visible;
  }

  .section-preview-panel.expanded {
    height: min(76vh, 760px);
  }

  .question-focus-layer {
    min-height: min(76vh, 760px);
  }

  .question-focus-layer .panel-head h2 {
    max-width: 64vw;
  }

  .search-manager,
  .search-manager-grid {
    width: 100%;
  }

  .search-manager-grid {
    grid-template-columns: 1fr;
  }

  .search-controls,
  .search-segment {
    width: 100%;
  }

  .agent-search-button {
    width: 100%;
    margin-left: 0;
  }

  .question-item.search-hit {
    grid-template-columns: 1fr;
  }

  .question-detail .markdown-svg-block,
  .enhancement-svg-grid.count-1,
  .enhancement-svg-grid .enhancement-svg-item:last-child:nth-child(odd):not(:first-child) {
    width: 100%;
    max-width: 100%;
  }

  .enhancement-svg-grid,
  .enhancement-svg-grid.count-1 {
    grid-template-columns: 1fr;
  }

  .search-result-item {
    grid-template-columns: 1fr;
  }

  .search-result-actions {
    opacity: 1;
    pointer-events: auto;
  }

  .search-shell {
    width: 100%;
    padding: 10px;
    border-radius: 20px;
  }

  .search-box {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 52px;
    padding: 7px;
    gap: 8px;
  }

  .search-box button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .search-box .clear-search-button {
    grid-column: auto;
    width: 34px;
  }

  .search-box #searchBtn {
    grid-column: 1 / -1;
  }

  .context-menu {
    left: 12px !important;
    right: 12px;
    bottom: 12px;
    top: auto !important;
    width: auto;
  }

  .file-detail-floating-tools {
    right: 16px;
    bottom: 16px;
  }
}
