:root {
  --primary: #274a86;
  --primary-dark: #223f73;
  --primary-soft: #eef3fb;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --border: #d9e0ea;
  --text: #101828;
  --muted: #607089;
  --muted-2: #8a97aa;
  --warning: #fff1bf;
  --success: #eaf8f0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd8e6;
  border-radius: 6px;
  padding: 10px 12px;
  color: #1f2937;
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(39, 74, 134, 0.12);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f5f7fb;
}

.brand-lockup,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 900;
}

.brand-lockup strong,
.sidebar-brand strong {
  display: block;
  line-height: 1.2;
  font-size: 16px;
}

.brand-lockup span,
.sidebar-brand span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.login-panel {
  width: min(400px, 100%);
}

.login-form {
  width: 100%;
  padding: 34px 32px 32px;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
}

.login-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
}

.login-heading .brand-mark {
  width: 44px;
  height: 44px;
  background: var(--primary);
  font-size: 18px;
}

.login-heading h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: 0;
}

.login-form label,
.case-form label,
.settings-form label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: #253246;
  font-weight: 650;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 750;
}

.primary-btn {
  color: #fff;
  background: var(--primary);
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.secondary-btn,
.ghost-btn {
  color: #233450;
  background: #fff;
  border: 1px solid #cfd8e6;
}

.danger-btn {
  color: #b42318;
  background: #fff;
  border: 1px solid #f2b8b5;
}

.login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--border);
}

.sidebar .sidebar-brand {
  padding: 18px 20px 16px;
  border-bottom: 1px solid #edf1f6;
}

.sidebar .brand-mark {
  background: var(--primary);
}

.sidebar-brand strong {
  color: #1d2939;
}

.sidebar-brand span {
  color: #607089;
}

.nav {
  display: grid;
  gap: 8px;
  padding: 14px 12px;
}

.nav button {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  padding: 0 12px;
  color: #263a59;
  background: transparent;
  text-align: left;
}

.nav button.active {
  color: #1e3f78;
  background: #f0f4fa;
  font-weight: 800;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px 20px;
  border-top: 1px solid #edf1f6;
  color: #65758d;
  font-size: 13px;
}

.sidebar-footer button {
  margin-top: 12px;
  color: #263a59;
  background: transparent;
  padding: 0;
}

.content {
  min-width: 0;
  padding: 34px 24px 56px 32px;
}

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

.page-head h1 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: 0;
}

.page-head p {
  margin: 0;
  color: #607089;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.yuandian-search-panel {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(28, 45, 74, 0.06);
}

.analysis-page-head {
  width: min(1040px, 100%);
  margin: 0 auto 20px;
}

.analysis-page-head.has-conversation,
.ai-dialog-window.has-conversation {
  width: min(1440px, 100%);
}

.analysis-page-head:not(.has-conversation) {
  visibility: hidden;
  height: 0;
  margin-bottom: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ai-dialog-window {
  width: min(1040px, 100%);
  min-height: calc(100vh - 124px);
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}

.ai-dialog-window.is-empty {
  justify-content: center;
  padding-bottom: 8vh;
}

.ai-empty-state {
  margin-bottom: 26px;
  text-align: center;
}

.ai-empty-mark,
.ai-answer-mark {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  font-weight: 850;
}

.ai-empty-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 8px;
  font-size: 20px;
}

.ai-empty-state h2 {
  margin: 0;
  color: #14213a;
  font-size: 25px;
  letter-spacing: 0;
}

.ai-empty-state p {
  margin: 10px 0 0;
  color: #687890;
}

.analysis-composer {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(32, 52, 84, 0.1);
}

.analysis-composer.is-follow-up {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  border-color: #d8e0eb;
  box-shadow: 0 12px 30px rgba(32, 52, 84, 0.14);
}

.analysis-composer.is-follow-up textarea {
  min-height: 68px;
  max-height: 150px;
  line-height: 1.65;
}

.analysis-composer textarea {
  min-height: 112px;
  padding: 4px 4px 10px;
  border: 0;
  border-radius: 0;
  line-height: 1.75;
  resize: vertical;
}

.analysis-composer:not(.is-follow-up) textarea {
  min-height: 150px;
}

.analysis-composer textarea:focus {
  border: 0;
  box-shadow: none;
}

.analysis-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.analysis-options {
  display: flex;
  align-items: center;
  gap: 12px;
}

.analysis-file-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid #d9e0ea;
  border-radius: 6px;
  color: #233450;
  background: #f8fafc;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.analysis-file-button input {
  display: none;
}

.analysis-file-names {
  min-width: 0;
  overflow: hidden;
  color: #687890;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-submit {
  min-width: 104px;
  min-height: 38px;
}

.analysis-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px;
  border-left: 3px solid var(--primary);
  color: #29456f;
  background: #f2f6fc;
  font-size: 13px;
}

.analysis-composer .analysis-progress {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border-left: 0;
  border-radius: 6px;
}

.analysis-stage-track {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce5f2;
}

.analysis-stage-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 180ms ease;
}

.analysis-stage-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analysis-stage-steps li {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: #7a879a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-stage-steps li > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1px solid #aebbd0;
  border-radius: 50%;
  background: #fff;
}

.analysis-stage-steps li.is-complete,
.analysis-stage-steps li.is-current {
  color: #244b88;
  font-weight: 750;
}

.analysis-stage-steps li.is-complete > span,
.analysis-stage-steps li.is-current > span {
  border-color: var(--primary);
  background: var(--primary);
}

.analysis-stage-steps li.is-current > span {
  box-shadow: 0 0 0 3px rgba(39, 74, 134, 0.13);
}

.analysis-composer .analysis-progress > strong {
  color: #40516b;
  font-size: 12px;
  font-weight: 650;
}

.ai-review-note {
  margin: 12px 0 0;
  color: #8a97aa;
  font-size: 12px;
  text-align: center;
}

.ai-thread {
  display: grid;
  gap: 28px;
}

.ai-user-message {
  width: min(720px, 82%);
  justify-self: end;
  padding: 13px 16px;
  border: 0;
  border-radius: 8px;
  background: #edf2f8;
}

.ai-user-message span {
  color: #607089;
  font-size: 12px;
  font-weight: 750;
}

.ai-user-message p {
  margin: 6px 0 0;
  color: #1f2d43;
  line-height: 1.75;
  white-space: pre-wrap;
}

.ai-answer-document {
  min-width: 0;
  padding: 0;
}

.ai-related-sources {
  position: sticky;
  top: 18px;
  min-width: 0;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  padding-left: 18px;
  border-left: 1px solid #e1e7ef;
  background: transparent;
}

.ai-related-sources > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0 12px;
}

.ai-related-sources > header span {
  color: #718096;
  font-size: 12px;
}

.ai-source-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 12px;
  padding: 3px;
  border-radius: 6px;
  background: #eef2f7;
}

.ai-source-tabs button {
  min-height: 32px;
  border-radius: 5px;
  color: #607089;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.ai-source-tabs button[aria-selected="true"] {
  color: #244b88;
  background: #fff;
  box-shadow: 0 1px 3px rgba(32, 52, 84, 0.1);
}

.ai-source-list {
  max-height: calc(100vh - 132px);
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 0 0 12px;
}

.ai-source-list article {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 12px 0 14px 24px;
  border-bottom: 1px solid #e4e9f0;
  background: transparent;
}

.ai-source-list article small {
  position: absolute;
  top: 13px;
  left: 0;
  color: #8794a8;
  font-weight: 750;
}

.ai-source-list article strong {
  color: #1d2939;
  font-size: 13px;
  line-height: 1.5;
}

.ai-source-list article span {
  color: #718096;
  font-size: 12px;
  line-height: 1.5;
}

.ai-source-list article p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #43516a;
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.ai-source-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.ai-source-actions .text-btn {
  min-height: 28px;
  padding: 3px 0;
  font-size: 12px;
}

.ai-source-placeholder {
  padding: 18px 14px;
  border: 1px dashed #d5dde8;
  border-radius: 8px;
  color: #607089;
  background: #f8fafc;
}

.ai-source-placeholder strong {
  color: #34445c;
  font-size: 13px;
}

.ai-source-placeholder p {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.65;
}

.ai-dialog-window.has-conversation .analysis-composer,
.ai-dialog-window.has-conversation .ai-review-note {
  width: 100%;
}

.ai-answer-document .yuandian-result {
  margin-top: 0;
}

.ai-answer-document .yuandian-result > header {
  display: none;
}

.ai-answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e4eaf2;
}

.ai-answer-identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.ai-answer-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 6px;
  font-size: 14px;
}

.ai-answer-identity strong,
.ai-answer-identity span {
  display: block;
}

.ai-answer-identity span {
  margin-top: 3px;
  color: #718096;
  font-size: 12px;
}

.ai-answer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 0;
  border-top: 1px solid #e4eaf2;
  color: #718096;
  font-size: 13px;
}

.ai-answer-actions > div {
  display: flex;
  gap: 18px;
}

.analysis-progress[hidden] {
  display: none;
}

.analysis-progress-indicator {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid #b8c8df;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: analysis-spin 0.8s linear infinite;
}

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

.yuandian-search-panel .section-title {
  margin-bottom: 14px;
}

.yuandian-search-panel h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.yuandian-search-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(320px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.case-region-status {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid #2f5ca8;
  color: #29456f;
  background: #f2f6fc;
  font-size: 13px;
}

.case-region-status.fallback {
  border-left-color: #c1841a;
  color: #76520f;
  background: #fff8e8;
}

.yuandian-search-form button {
  min-width: 96px;
}

.case-context-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #f8fafd;
}

.case-context-panel summary {
  cursor: pointer;
  color: #253246;
  font-weight: 750;
}

.case-context-panel label,
.case-context-panel small {
  display: block;
  margin-top: 10px;
  color: #607089;
  font-size: 13px;
}

.case-context-panel textarea {
  margin-top: 8px;
  background: #fff;
}

.search-empty {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  color: #607089;
  background: #f6f8fb;
}

.yuandian-result {
  margin-top: 16px;
}

.yuandian-result header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.yuandian-result header strong,
.yuandian-result header span {
  display: block;
}

.yuandian-result header span {
  margin-top: 4px;
  color: #607089;
  font-size: 13px;
}

.yuandian-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.yuandian-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #f8fafd;
}

.yuandian-card.fail {
  border-color: #f2b8b5;
  background: #fff8f7;
}

.yuandian-card.notice {
  border-color: #f4d58d;
  background: #fffaf0;
}

.yuandian-card.notice small {
  display: block;
  margin-top: 8px;
  color: #7a5a14;
  line-height: 1.6;
}

.yuandian-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.yuandian-card h3 {
  margin: 0;
  font-size: 15px;
}

.yuandian-card-head span {
  color: #607089;
  font-size: 13px;
}

.resolved-company {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
}

.resolved-company strong {
  color: #284f91;
  font-size: 13px;
}

.resolved-company span {
  color: #334155;
  font-size: 13px;
  word-break: break-word;
}

.yuandian-card pre {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  color: #1f2937;
  background: #fff;
  border: 1px solid #e4eaf2;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
}

.structured-fail {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #f2b8b5;
  background: #fff8f7;
}

.structured-fail p {
  margin: 6px 0 0;
  color: #8a2d24;
}

.structured-fail small {
  display: block;
  margin-top: 8px;
  color: #8a2d24;
}

.structured-empty {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #dce4ef;
  background: #fff;
}

.structured-empty strong,
.structured-empty p {
  display: block;
}

.structured-empty p {
  margin: 8px 0 0;
  color: #607089;
  line-height: 1.7;
}

.attempted-queries {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  color: #607089;
  font-size: 13px;
}

.attempted-queries b {
  padding: 3px 8px;
  border-radius: 999px;
  color: #284f91;
  background: #eef4ff;
  font-weight: 700;
}

.search-hit {
  color: #c1121f;
  background: transparent;
  font-weight: 800;
}

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

.case-search-list {
  display: grid;
  gap: 12px;
}

.case-priority-tip {
  padding: 10px 12px;
  border: 1px solid #f4c7c3;
  border-radius: 8px;
  color: #b42318;
  background: #fff7f6;
  font-size: 13px;
  font-weight: 700;
}

.case-search-item {
  padding: 14px;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #fff;
}

.case-research-workspace {
  margin-top: 12px;
}

.case-research-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e4eaf2;
}

.case-research-toolbar strong,
.case-research-toolbar span {
  display: block;
}

.case-research-toolbar span {
  margin-top: 5px;
  color: #607089;
  font-size: 13px;
}

.case-search-item.selectable {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
}

.case-select {
  padding-top: 2px;
}

.case-select input {
  width: 18px;
  height: 18px;
}

.case-search-body {
  min-width: 0;
}

.text-btn {
  padding: 3px 0;
  color: #284f91;
  background: transparent;
  font-weight: 750;
}

.analysis-notice,
.analysis-warning {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-left: 3px solid #3f6cab;
  color: #43516a;
  background: #f1f5fb;
  line-height: 1.65;
}

.analysis-warning {
  margin-top: 12px;
  border-left-color: #b54708;
  background: #fff8eb;
}

.legal-answer {
  margin-bottom: 14px;
  padding: 18px 0;
  border-bottom: 1px solid #dce4ef;
}

.legal-answer h3,
.legal-answer h4,
.legal-answer p {
  margin: 0;
}

.legal-answer-direct {
  margin-top: 10px !important;
  color: #17233a;
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.legal-conclusions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.legal-conclusions article,
.legal-basis article {
  padding: 12px 14px;
  border-left: 3px solid #315d9d;
  background: #f6f8fb;
}

.legal-conclusions header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.legal-conclusions header span,
.legal-conclusions small {
  color: #607089;
}

.legal-conclusions p,
.legal-basis p {
  margin-top: 6px !important;
  color: #43516a;
  line-height: 1.7;
}

.legal-basis {
  margin-top: 14px;
}

.legal-basis summary {
  margin-bottom: 8px;
  color: #284f91;
  cursor: pointer;
  font-weight: 750;
}

.legal-basis article + article {
  margin-top: 8px;
}

.legal-basis blockquote {
  margin: 8px 0 0;
  color: #33445f;
  line-height: 1.7;
}

.legal-follow-up {
  margin-top: 14px;
}

.analysis-priority-grid {
  margin-top: 14px;
}

.analysis-full-details {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e4eaf2;
}

.analysis-full-details > summary {
  color: #284f91;
  cursor: pointer;
  font-weight: 750;
}

.analysis-full-details[open] > summary {
  margin-bottom: 12px;
}

.analyzed-case-list {
  display: grid;
  gap: 14px;
}

.analyzed-case {
  padding: 20px 0;
  border: 0;
  border-top: 1px solid #e1e7ef;
  border-radius: 8px;
  background: transparent;
}

.case-assessment-summary {
  padding-top: 0;
  border-top: 0;
}

.related-case-analysis {
  padding-bottom: 14px;
}

.case-comparison-summary {
  margin-top: 16px;
}

.case-analysis-details {
  margin-top: 14px;
}

.analyzed-case > header,
.analyzed-case > footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.analyzed-case h3,
.analyzed-case h4,
.analyzed-case p {
  margin: 0;
}

.analyzed-case header p,
.analyzed-case footer {
  margin-top: 6px;
  color: #607089;
  font-size: 13px;
}

.overall-score {
  flex: 0 0 auto;
  color: #1f4f8b;
  font-size: 30px;
}

.overall-score small {
  margin-left: 2px;
  font-size: 12px;
}

.six-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.six-score-grid > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 10px;
  background: #f6f8fb;
}

.six-score-grid span {
  color: #52637a;
  font-size: 13px;
}

.six-score-grid i {
  grid-column: 1 / -1;
  height: 4px;
  background: linear-gradient(to right, #3f6cab var(--score), #dce4ef var(--score));
}

.comparison-grid,
.strategy-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.comparison-grid section,
.strategy-map section {
  padding: 12px;
  border: 0;
  border-left: 2px solid #d9e2ee;
  background: #f7f9fc;
}

.comparison-grid h4,
.strategy-map h4 {
  margin-bottom: 8px;
  font-size: 14px;
}

.comparison-grid ul,
.strategy-map ul {
  margin: 0;
  padding-left: 18px;
  color: #43516a;
  line-height: 1.65;
}

.analysis-log,
.excluded-cases {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #e4eaf2;
  background: #fbfcfe;
}

.citable-points {
  margin-top: 12px;
  padding: 12px;
  border-left: 3px solid #526b8f;
  background: #f8fafd;
}

.citable-points h4 {
  margin: 0 0 10px;
}

.citable-points blockquote {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-left: 2px solid #c7d2e3;
  background: #fff;
}

.citable-points blockquote p,
.citable-points blockquote small {
  display: block;
  margin: 6px 0 0;
  color: #52637a;
  line-height: 1.65;
}

.analysis-log summary,
.excluded-cases summary {
  cursor: pointer;
  color: #284f91;
  font-weight: 750;
}

.analysis-log dl {
  margin-bottom: 0;
}

.strategy-map {
  margin-top: 12px;
}

.strategy-map .assert { border-top: 3px solid #16835b; }
.strategy-map .evidence { border-top: 3px solid #c1811b; }
.strategy-map .defense { border-top: 3px solid #526b8f; }
.strategy-map .risk { border-top: 3px solid #b42318; }

.excluded-cases .analyzed-case-list {
  margin-top: 12px;
}

.case-search-item h4 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 15px;
  line-height: 1.5;
}

.case-search-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.case-search-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  color: #607089;
  background: #f1f5f9;
  font-size: 12px;
}

.case-search-item p {
  max-height: 110px;
  overflow: auto;
  margin: 0;
  color: #374151;
  line-height: 1.75;
}

.case-search-item .source-note {
  margin-top: 8px;
  color: #6b7280;
}

.case-search-item footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: #607089;
  font-size: 13px;
}

.case-search-item a {
  color: #284f91;
  font-weight: 700;
  text-decoration: none;
}

.case-search-meta .region-priority-tag {
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #f4c7c3;
}

.structured-item {
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e4eaf2;
}

.structured-item h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.structured-item dl {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.structured-item dt {
  color: #607089;
  font-weight: 700;
}

.structured-item dd {
  margin: 0;
  color: #1f2937;
  word-break: break-word;
}

.stat-card,
.list-panel,
.detail-panel,
.management-panel,
.modal-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(28, 45, 74, 0.06);
}

.fulltext-modal {
  width: min(1040px, 100%);
}

.fulltext-modal .modal-head {
  position: sticky;
  top: -22px;
  z-index: 1;
  padding: 14px 0;
  background: #fff;
  border-bottom: 1px solid #e4eaf2;
}

.fulltext-modal .modal-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.fulltext-modal .modal-head p,
.fulltext-source {
  margin: 0;
  color: #607089;
  font-size: 13px;
}

.fulltext-source {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.fulltext-content {
  margin: 0;
  padding: 18px;
  border: 1px solid #e4eaf2;
  color: #253246;
  background: #fbfcfe;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.9;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.management-panel {
  padding: 20px;
}

.management-panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.management-panel label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #253246;
  font-weight: 650;
}

.management-panel.wide {
  min-width: 0;
}

.management-list {
  display: grid;
  gap: 12px;
}

.management-card {
  padding: 14px;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #fff;
}

.management-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.management-card header strong {
  font-size: 15px;
}

.management-card header span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #284f91;
  background: #eef4ff;
  font-size: 12px;
  font-weight: 750;
}

.management-card p {
  margin: 0 0 10px;
  color: #607089;
  line-height: 1.7;
}

.management-card dl {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.management-card dt {
  color: #607089;
  font-weight: 750;
}

.management-card dd {
  margin: 0;
  color: #1f2937;
  word-break: break-word;
}

.member-grid,
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.member-card,
.permission-card {
  padding: 14px;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #f8fafd;
}

.member-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.member-card strong,
.member-card span,
.member-card p,
.permission-card h3,
.permission-card p {
  display: block;
  margin: 0;
}

.member-card span,
.member-card p,
.permission-card p {
  margin-top: 6px;
  color: #607089;
}

.permission-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.permission-card span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #284f91;
  background: #eef4ff;
  font-size: 12px;
}

.small-danger {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}

.sub-title {
  margin-top: 22px !important;
}

.inline-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.stat-card {
  min-height: 122px;
  padding: 20px;
  display: grid;
  align-content: space-between;
}

.stat-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #566987;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  color: #121a28;
}

.stat-card p {
  margin: 0;
  color: #667997;
  font-size: 13px;
}

.list-panel {
  padding: 20px;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.list-head h2 {
  margin: 0;
  font-size: 18px;
}

.search {
  max-width: 320px;
}

.case-rows {
  display: grid;
  gap: 8px;
}

.ai-conversation-window {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.ai-conversation-window.is-empty {
  justify-content: initial;
  padding-bottom: 0;
}

.ai-conversation-sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
  padding: 0 18px 0 0;
  border-right: 1px solid #e1e7ef;
  background: transparent;
}

.ai-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-history-header > strong {
  color: #40516b;
  font-size: 13px;
}

.ai-history-header .primary-btn {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
}

.ai-conversation-list {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 210px);
  overflow: auto;
}

.ai-conversation-list > p {
  margin: 4px 0;
  color: #8794a8;
  font-size: 13px;
}

.ai-conversation-list button {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 9px;
  border-radius: 6px;
  color: #263750;
  background: transparent;
  text-align: left;
}

.ai-conversation-list button:hover,
.ai-conversation-list button.active {
  background: #edf2f8;
}

.ai-conversation-list button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.ai-conversation-list button small {
  overflow: hidden;
  color: #75849a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-conversation-stage {
  min-width: 0;
  scroll-padding-bottom: 154px;
}

.ai-dialog-window.has-conversation .ai-conversation-stage {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
}

.ai-dialog-window.has-conversation .ai-thread {
  min-height: 0;
  padding: 0 10px 14px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

@media (min-width: 1181px) {
  .ai-dialog-window.has-conversation {
    grid-template-columns: 184px minmax(420px, 1fr) minmax(236px, 268px);
    gap: 24px;
    height: calc(100vh - 164px);
    min-height: 560px;
    overflow: hidden;
  }

  .ai-dialog-window.has-conversation .ai-conversation-stage {
    height: 100%;
  }

  .ai-dialog-window.has-conversation .ai-conversation-sidebar,
  .ai-dialog-window.has-conversation .ai-related-sources {
    align-self: stretch;
    min-height: 0;
    max-height: 100%;
  }

  .ai-dialog-window.has-conversation .ai-conversation-list,
  .ai-dialog-window.has-conversation .ai-source-list {
    max-height: calc(100% - 48px);
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .ai-conversation-window.has-conversation {
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 24px;
  }

  .ai-conversation-window.has-conversation .ai-conversation-stage {
    height: max(500px, calc(100dvh - 164px));
  }

  .ai-conversation-window.has-conversation .ai-related-sources {
    position: static;
    grid-column: 2;
    max-height: 420px;
    margin-top: 8px;
  }
}

.ai-conversation-turn {
  display: grid;
  gap: 14px;
}

.ai-conversation-turn + .ai-conversation-turn {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid #e1e7f0;
}

.ai-archived-answer {
  padding: 18px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #fff;
}

.ai-archived-answer > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #61718a;
}

.ai-archived-answer > header strong {
  color: #1f2d43;
}

.conversation-turn-progress {
  margin-left: 12%;
}

.case-row {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-radius: 8px;
  padding: 14px 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.case-row + .case-row {
  border-top: 1px solid #edf1f6;
  border-radius: 0;
}

.case-row h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.case-row p,
.case-meta {
  margin: 0;
  color: #607089;
  font-size: 14px;
}

.case-side {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #607089;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: #9a6412;
  background: var(--warning);
  font-size: 13px;
  font-weight: 750;
}

.badge.done {
  color: #147245;
  background: var(--success);
}

.empty {
  padding: 24px 0;
  color: #607089;
}

.detail-panel {
  padding: 22px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.detail-header h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.detail-header p {
  margin: 0;
  color: #607089;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tags,
.scores,
.analysis-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tags {
  margin: 18px 0;
}

.tags div,
.scores div,
.recognition-grid div {
  display: grid;
  gap: 5px;
  min-height: 68px;
  padding: 12px;
  border-radius: 8px;
  background: #f5f7fb;
}

.tags span,
.scores span,
.recognition-grid span {
  color: #697b95;
  font-size: 13px;
}

.classification-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title h3 {
  margin: 0 0 6px;
}

.section-title p {
  margin: 0;
  color: #607089;
  line-height: 1.7;
}

.recognition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.recognition-grid div {
  background: #f7f9fd;
}

.recognition-basis {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  color: #4e5e74;
  background: #f6f8fb;
}

.recognition-basis p {
  margin: 6px 0;
}

.recognition-basis small {
  color: #7a8798;
}

.materials {
  margin: 18px 0 4px;
}

.materials h3,
.analysis-card h3,
.table-panel h2,
.similar h2,
.similar-card h3 {
  margin: 0 0 10px;
}

.materials span,
.file-chip {
  display: inline-flex;
  align-items: center;
  margin: 0 8px 8px 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  background: #edf2f7;
  color: #43516a;
  font-size: 13px;
}

.file-chip {
  cursor: pointer;
}

.file-chip:hover {
  background: #dfe8f3;
}

.analysis-grid {
  margin-top: 18px;
}

.analysis-card,
.table-panel,
.similar-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.analysis-card p,
.similar-card p,
dd {
  margin: 0;
  color: #4f5d72;
  line-height: 1.7;
}

.table-panel,
.similar {
  margin-top: 18px;
}

.table-panel {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #e7edf4;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f6f8fb;
  color: #253246;
}

.similar {
  display: grid;
  gap: 14px;
}

.scores {
  margin: 14px 0;
}

dl {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px 14px;
}

dt {
  color: #253246;
  font-weight: 800;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.35);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(820px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.modal-head p {
  margin: 0;
  color: #607089;
}

.close-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #4c5d75;
  background: #f1f4f8;
  font-size: 20px;
}

.case-form {
  display: grid;
  gap: 2px;
}

.file-box {
  min-height: 76px;
  padding: 14px;
  border: 1px dashed #9cacbf;
  border-radius: 8px;
  background: #f7f9fc;
}

.file-box input {
  border: 0;
  padding: 0;
  background: transparent;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.settings-form {
  max-width: 680px;
}

.document-workspace {
  display: grid;
  grid-template-columns: minmax(460px, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.smart-document-workspace {
  grid-template-columns: minmax(520px, 1.08fr) minmax(360px, 0.92fr);
}

.document-form-panel,
.document-preview-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(28, 45, 74, 0.06);
}

.document-form-panel {
  padding: 20px;
}

.document-preview-panel {
  min-height: 620px;
  padding: 20px;
}

.document-status {
  max-width: 360px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  background: #fff;
}

.document-status span {
  color: #1d2939;
  font-weight: 850;
}

.document-status small {
  color: #607089;
  line-height: 1.45;
}

.document-status.ok {
  border-color: #a8d7bb;
  background: #f2fbf5;
}

.document-status.idle {
  border-color: #dbe5f2;
  background: #f8fafc;
}

.segment-control {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #f0f4fa;
}

.segment-control button {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 14px;
  color: #43516a;
  background: transparent;
  font-weight: 750;
}

.segment-control button.active {
  color: #fff;
  background: var(--primary);
}

.document-form {
  display: grid;
  gap: 2px;
}

.smart-document-form {
  gap: 4px;
}

.checkbox-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  background: #f8fafc;
  font-weight: 700;
}

.checkbox-row input {
  width: auto;
}

.template-manager {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e7edf4;
}

.template-manager details {
  margin-bottom: 14px;
}

.template-manager summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 800;
}

.template-form {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #f8fafd;
  border: 1px solid #e1e7f0;
}

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

.template-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafd;
  border: 1px solid #e1e7f0;
}

.template-item p {
  margin: 5px 0;
  color: #607089;
  line-height: 1.6;
}

.template-item span {
  color: #7a8798;
  font-size: 13px;
}

.document-form label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #253246;
  font-weight: 650;
}

.document-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #607089;
}

.document-meta strong {
  color: #172229;
}

.document-references {
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  background: #f8fafc;
}

.document-references h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.document-references p {
  margin: 0 0 10px;
  color: #607089;
  font-size: 13px;
}

.document-draft-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(28, 45, 74, 0.06);
}

.document-draft {
  min-height: 520px;
  max-height: 70vh;
  overflow: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfcff;
  color: #1f2937;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.8;
}

.split-actions {
  display: grid;
  grid-template-columns: auto auto 1fr;
}

.split-actions .primary-btn {
  justify-self: end;
}

.template-search-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #607089;
}

.template-search-meta strong {
  color: #172229;
}

.template-result-list {
  display: grid;
  gap: 12px;
}

.template-result-item {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  background: #fbfcff;
}

.template-result-item div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.template-result-item strong {
  color: #172229;
}

.template-result-item span,
.template-result-item p {
  color: #607089;
}

.template-result-item p {
  margin: 0;
  line-height: 1.65;
}

.result-link {
  width: fit-content;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.hint-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  color: #4e5e74;
  background: #f6f8fb;
  border: 1px solid #e1e7f0;
}

.audit-panel,
.settings-block {
  margin-top: 18px;
}

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

.audit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #edf1f6;
}

.audit-row:first-child {
  border-top: 0;
}

.audit-row p {
  margin: 6px 0 0;
  color: #607089;
}

.audit-row > div:last-child {
  display: grid;
  gap: 4px;
  color: #607089;
  text-align: right;
  white-space: nowrap;
}

.mcp-grid,
.mcp-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mcp-card,
.mcp-result {
  padding: 14px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #f8fafd;
}

.mcp-card div,
.mcp-result header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.mcp-card span,
.mcp-card small,
.mcp-result span {
  color: #607089;
  font-size: 13px;
}

.mcp-card p,
.mcp-result p {
  margin: 0 0 10px;
  color: #43516a;
  line-height: 1.6;
  word-break: break-all;
}

.mcp-results {
  margin-top: 14px;
}

.mcp-result.ok {
  border-color: #b7e3ca;
  background: #f2fbf6;
}

.mcp-result.fail {
  border-color: #f2b8b5;
  background: #fff8f7;
}

.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-list span {
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dce4ef;
  color: #43516a;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #1f3e70;
  box-shadow: 0 12px 30px rgba(31, 62, 112, 0.24);
}

.floating-mark {
  position: fixed;
  right: 0;
  top: 44%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 18px 0 0 18px;
  color: #fff;
  background: #ed8aaa;
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 980px) {
  .document-workspace,
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-footer {
    display: none;
  }

  .stats-grid,
  .yuandian-search-form,
  .yuandian-result-grid,
  .mcp-grid,
  .mcp-results,
  .analysis-grid,
  .workspace-grid,
  .tags,
  .scores,
  .recognition-grid,
  .form-grid,
  .split-actions {
    grid-template-columns: 1fr;
  }

  .six-score-grid,
  .comparison-grid,
  .strategy-map {
    grid-template-columns: 1fr;
  }

  .ai-conversation-window {
    grid-template-columns: 1fr;
  }

  .ai-conversation-window.has-conversation .ai-conversation-stage {
    position: sticky;
    top: 14px;
    z-index: 2;
    height: max(460px, calc(100dvh - 28px));
    background: var(--bg);
  }

  .ai-conversation-sidebar {
    position: static;
    padding: 0 0 16px;
    border-right: 0;
    border-bottom: 1px solid #e1e7ef;
  }

  .ai-conversation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 180px;
  }

  .ai-related-sources {
    position: static;
    max-height: none;
    padding: 18px 0 0;
    border-top: 1px solid #e1e7ef;
    border-left: 0;
  }

  .ai-source-list {
    max-height: 420px;
  }

  .ai-dialog-window.has-conversation .analysis-composer,
  .ai-dialog-window.has-conversation .ai-review-note {
    width: 100%;
  }

  .case-research-toolbar,
  .ai-answer-header,
  .analyzed-case > header,
  .analyzed-case > footer,
  .fulltext-source {
    align-items: flex-start;
    flex-direction: column;
  }

  .split-actions .primary-btn {
    justify-self: stretch;
  }
}

@media (max-width: 480px) {
  .ai-conversation-list {
    grid-template-columns: 1fr;
  }

  .login-page {
    padding: 16px;
  }

  .login-form {
    padding: 28px 22px 24px;
  }
}

@media (max-width: 700px) {
  .content {
    padding: 22px 14px 40px;
  }

  .page-head,
  .list-head,
  .detail-header,
  .audit-row,
  .case-row {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .case-side,
  .actions {
    flex-wrap: wrap;
  }

  .ai-dialog-window {
    min-height: calc(100vh - 96px);
  }

  .ai-dialog-window.is-empty {
    justify-content: flex-start;
    padding-top: 8vh;
  }

  .ai-empty-state h2 {
    font-size: 21px;
  }

  .ai-user-message {
    width: 100%;
  }

  .analysis-composer {
    padding: 12px;
  }

  .analysis-composer.is-follow-up {
    gap: 8px;
    margin-top: 18px;
  }

  .analysis-composer.is-follow-up textarea {
    min-height: 64px;
  }

  .analysis-composer-footer,
  .ai-answer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .analysis-composer.is-follow-up .analysis-composer-footer {
    align-items: center;
    flex-direction: row;
  }

  .analysis-composer.is-follow-up .analysis-submit {
    width: auto;
    min-width: 88px;
  }

  .analysis-file-names {
    white-space: normal;
  }

  .analysis-submit {
    width: 100%;
  }

  .audit-row > div:last-child {
    text-align: left;
  }

  dl {
    grid-template-columns: 1fr;
  }
}
