:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --surface-muted: #f1f5f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #1e293b;
  --text-soft: #64748b;
  --text-muted: #94a3b8;
  --ink: #0f172a;
  --ink-soft: #334155;
  --accent: #2563eb;
  --accent-deep: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-quiet: rgba(37, 99, 235, 0.04);
  --success: #10b981;
  --success-soft: #d1fae5;
  --warn: #f59e0b;
  --warn-soft: #fef3c7;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;
  --font-sm: 12px;
  --font-base: 14px;
  --font-lg: 16px;
  --font-xl: 18px;
  --font-2xl: 24px;
  --font-3xl: 32px;
  --line-height-tight: 1.25;
  --line-height-base: 1.5;
  --line-height-relaxed: 1.75;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #f4f6fb 100%);
  color: var(--text);
  overflow-y: auto;
  overflow-x: hidden;
  line-height: var(--line-height-base);
  font-size: var(--font-base);
}

/* 全局标题样式 */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  line-height: var(--line-height-tight);
}

h1 {
  font-size: var(--font-3xl);
}

h2 {
  font-size: var(--font-2xl);
}

h3 {
  font-size: var(--font-xl);
}

h4 {
  font-size: var(--font-lg);
}

h5 {
  font-size: var(--font-base);
}

h6 {
  font-size: var(--font-sm);
}

/* 全局段落样式 */
p {
  margin: 0 0 16px;
  line-height: var(--line-height-base);
  color: var(--text);
}

/* 全局链接样式 */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

/* 全局列表样式 */
ul, ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

li {
  margin-bottom: 8px;
  line-height: var(--line-height-base);
}

/* 全局分割线样式 */
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

/* 全局代码样式 */
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  padding: 0.2em 0.4em;
  border-radius: var(--radius-xs);
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line);
}

/* 全局引用样式 */
blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  margin: 0 0 16px;
  background: var(--accent-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--accent-deep);
}

/* 全局表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-soft);
}

tr:hover {
  background: var(--surface-soft);
}

/* 全局滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--line-strong);
}

body.phase-1 .phase-2-only {
  display: none !important;
}

body.phase-1 .topbar-nav .nav-item.phase-2-only {
  display: none !important;
}

body.phase-1 .topbar-nav .nav-item.phase-2-only.role-visible {
  display: inline-flex !important;
}

body.phase-1 .topbar-status .status-pill.phase-2-only {
  display: none !important;
}

body.phase-1 #view-evolution .dashboard-left {
  position: relative;
  padding-top: 54px;
}

body.phase-1 #view-evolution .dashboard-left .panel-head {
  padding-left: 48px;
}

body.phase-1 #view-evolution .graph-sidebar-handle {
  top: 14px;
  left: 16px;
  transform: none;
}

body.phase-1 #view-evolution.graph-left-collapsed .graph-sidebar-handle {
  top: 14px;
  left: 16px;
  transform: none;
}

body.phase-1 #view-evolution.graph-left-collapsed .dashboard-left .panel-head {
  padding-left: 0;
}

body.phase-1 #view-account .subscribe-card.phase-2-only,
body.phase-1 #view-account .subscribe-panel.phase-2-only {
  display: none !important;
}

body.phase-1 #view-sep .utility-block.phase-2-only {
  display: none !important;
}

body.phase-1 #view-sep #sep-open-research-btn,
body.phase-1 #view-sep #sep-open-report-btn {
  display: none !important;
}

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

.app-shell {
  min-height: 100vh;
  height: auto;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr);
}

.topbar {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) minmax(0, 1.35fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: all 0.3s ease;
}

.brand-kicker,
.page-kicker,
.quick-kicker {
  margin: 0 0 2px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar .brand-kicker {
  color: var(--text-soft);
}

.topbar-brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.01em;
  font-weight: 700;
  color: var(--ink);
}

.topbar-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.nav-item,
button {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  padding: 8px 12px;
  cursor: pointer;
  transition: 0.18s ease;
}

.topbar .nav-item {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.topbar .nav-item.active,
.topbar .nav-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.topbar-status {
  justify-self: end;
}

.topbar-status .status-pills {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-status .status-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
  transition: all 0.2s ease;
}

.topbar-status .status-pill.active,
.topbar-status .status-pill:hover {
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.2);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

body.library-entry-active #plan-pill {
  display: none;
}

/* 操作区样式 */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.action-bar .left-actions,
.action-bar .right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-bar button {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

/* 表单区样式 */
.form-section {
  padding: 24px;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.form-section h3 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.form-actions button {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

body.library-entry-active .topbar {
  grid-template-columns: 240px auto minmax(280px, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 12px;
  padding: 12px 18px 14px;
  background:
    linear-gradient(180deg, rgba(248, 252, 254, 0.98) 0%, rgba(236, 246, 252, 0.96) 62%, rgba(235, 243, 249, 0.94) 100%);
  border-color: rgba(188, 199, 210, 0.62);
  box-shadow:
    0 12px 28px rgba(137, 159, 179, 0.12),
    0 2px 6px rgba(15, 23, 42, 0.04);
  position: relative !important;
}

body.library-entry-active #library-switch-sep,
body.library-entry-active .topbar-nav .nav-item[data-view="sep"] {
  display: none !important;
}

body.library-entry-active .topbar-nav .nav-item:not(.active) {
  color: #7d93a5;
}

body.library-entry-active .topbar-nav .nav-item[data-view="evolution"] {
  color: #8298a8;
  background: rgba(246, 250, 253, 0.24);
}

body.library-entry-active .topbar-nav .nav-item.active {
  background: rgba(247, 250, 253, 0.88);
  border-color: rgba(189, 199, 210, 0.7);
  box-shadow: 0 10px 20px rgba(166, 182, 197, 0.12);
}

body.library-entry-active .topbar-status .status-pills {
  gap: 6px;
}

body.library-entry-active .topbar-status .status-pill {
  min-width: 58px;
  justify-content: center;
  background: rgba(247, 251, 253, 0.88);
  border-color: rgba(190, 200, 211, 0.68);
  color: #7d92a5;
  font-weight: 700;
}

body.library-entry-active .topbar-status .status-pill.active {
  background: rgba(238, 245, 251, 0.98);
  border-color: rgba(178, 193, 207, 0.84);
  color: #385a74;
}

body.library-entry-active .topbar-status .status-pill#library-switch-sep {
  min-width: 104px;
}

body.library-entry-active .topbar-status {
  justify-self: center;
  padding: 3px;
  border: 1px solid rgba(191, 200, 211, 0.62);
  border-radius: 999px;
  background: rgba(246, 250, 253, 0.74);
}

body.library-entry-active .topbar-status::before {
  display: none;
}

body.library-entry-active #account-action-btn {
  background: rgba(247, 251, 253, 0.84);
  border-color: rgba(191, 200, 211, 0.7);
}

body.library-entry-active .topbar-brand h1 {
  font-size: 15px;
  font-weight: 620;
  color: #1f2937;
}

body.library-entry-active .brand-home-btn {
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 17px;
  font-weight: 700;
  color: #274053;
  letter-spacing: 0.04em;
}

body.library-entry-active .topbar-nav {
  justify-content: flex-start;
  gap: 4px;
  opacity: 0.92;
}

body.library-entry-active .topbar-workbench-strip {
  display: grid;
}

body.library-entry-active .topbar .nav-item {
  padding: 6px 10px;
  font-size: 13px;
  min-height: 36px;
  border-radius: 999px;
}

body.library-entry-active .topbar .nav-item[data-view="library"] {
  color: #406177;
  background: rgba(244, 249, 253, 0.92);
  border: 1px solid rgba(193, 201, 210, 0.78);
}

body.library-entry-active .topbar .nav-item[data-view="evolution"] {
  color: #8094a4;
}

body.library-entry-active .topbar-side {
  gap: 6px;
}

body.library-entry-active .topbar-toggle {
  padding: 6px 10px;
  font-size: 12px;
  border-color: rgba(191, 200, 211, 0.68);
  background: rgba(247, 251, 253, 0.78);
}

body.library-entry-active .topbar-status {
  justify-self: center;
  padding: 2px;
  border-color: rgba(191, 200, 211, 0.72);
  background: rgba(244, 249, 252, 0.62);
  transform: scale(0.94);
  transform-origin: center;
}

body.library-entry-active .topbar-status .status-pill {
  min-width: 52px;
  padding: 4px 10px;
  font-size: 10px;
}

body.library-entry-active .topbar-status .status-pill#library-switch-sep {
  min-width: 96px;
}

body.library-entry-active #view-library .dashboard-left .panel-subhead {
  color: #64748b;
}

body.library-entry-active #view-library .panel-head h3 {
  margin-bottom: 2px;
}

body.library-entry-active #view-library .search-empty-guide {
  border-color: #eef2ff;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

body.library-entry-active #view-library .search-empty-guide-copy p {
  color: #64748b;
}

body.library-entry-active #view-library .search-empty-guide-steps span {
  background: #f8fafc;
  color: #94a3b8;
}

body.library-entry-active #view-library .search-empty-guide-examples .ghost {
  background: #fff;
  border-color: #e5e7eb;
  color: #475569;
}

body.library-entry-active #view-library .search-empty-guide-actions button {
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
}

body.evolution-focus-active #plan-pill {
  display: none;
}

body.evolution-focus-active .topbar {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 0 12px;
  background: rgba(251, 252, 255, 0.72);
  border-bottom-color: #eef2f7;
  position: relative !important;
}

body.evolution-focus-active .topbar-brand h1 {
  font-size: 15px;
  font-weight: 620;
  color: #1f2937;
}

body.evolution-focus-active .topbar-nav {
  justify-content: flex-start;
  gap: 4px;
}

body.evolution-focus-active .topbar .nav-item {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
  color: #a1acbe;
}

body.evolution-focus-active .topbar .nav-item.active {
  background: #f6f8fc;
  color: #0f172a;
  box-shadow: none;
}

.nav-item-home {
  color: #1d4ed8 !important;
  background: rgba(239, 246, 255, 0.92) !important;
  border: 1px solid #dbeafe;
}

body.evolution-focus-active .topbar-status {
  justify-self: center;
  padding: 2px;
  border: 1px solid #eef2f7;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  transform: scale(0.94);
  transform-origin: center;
}

body.evolution-focus-active .topbar-status .status-pills {
  gap: 6px;
}

body.evolution-focus-active .topbar-status .status-pill {
  min-width: 52px;
  padding: 4px 10px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.88);
  border-color: #e8edf5;
  color: #98a4b8;
  font-weight: 700;
}

body.evolution-focus-active .topbar-status .status-pill.active {
  background: #eff4ff;
  border-color: #d3defd;
  color: #1d4ed8;
}

body.evolution-focus-active .topbar-status .status-pill#library-switch-sep {
  min-width: 96px;
}

body.evolution-focus-active #account-action-btn,
body.evolution-focus-active #account-center-btn {
  padding: 6px 10px;
  font-size: 12px;
  border-color: #edf1f7;
  background: rgba(255, 255, 255, 0.84);
}

.graph-topic-head-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

#graph-home-btn {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border-color: #dbe4f3;
  color: #1d4ed8;
  background: rgba(239, 246, 255, 0.92);
  font-weight: 700;
}

button {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  border-color: rgba(15, 23, 42, 0.1);
  font-weight: 600;
  transition: all 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  background: linear-gradient(180deg, var(--accent-deep) 0%, var(--accent) 100%);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

button:disabled {
  opacity: 0.6;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

button.ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
  transition: all 0.2s ease;
}

button.ghost:hover {
  background: var(--surface-muted);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

button.ghost:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

button.ghost:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.danger {
  background: linear-gradient(180deg, var(--danger) 0%, #dc2626 100%);
  border-color: rgba(239, 68, 68, 0.2);
}

button.danger:hover {
  background: linear-gradient(180deg, #dc2626 0%, var(--danger) 100%);
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.15);
}

button.danger:active {
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.15);
}

.compare-pill {
  grid-column: 4;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}

#plan-pill {
  background: #f8fafc;
  color: #64748b;
}

#plan-pill strong {
  color: #1d4ed8;
}

.compare-pill strong {
  color: var(--warn);
}

.main-shell {
  min-height: 0;
  overflow: visible;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: auto;
  min-height: 0;
}

.library-search-head {
  padding: 14px 24px 0;
}

.search-toolbar-panel {
  gap: 10px;
  background: rgba(251, 252, 249, 0.94);
}

.search-grid {
  display: grid;
  gap: 14px;
}

.search-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
}

.search-cell {
  display: grid;
  gap: 5px;
}

.search-actions-cell {
  display: grid;
  align-content: end;
  justify-items: stretch;
}

.toolbar-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.toolbar-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.library-results-shell {
  padding: 14px 24px 20px;
  min-height: 0;
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 118px;
  gap: 14px;
  overflow: hidden;
}

.result-panel,
.detail-panel,
.compare-dock-panel,
.research-side-panel,
.research-main {
  min-height: 0;
}

.compare-dock-panel {
  grid-column: 1 / span 2;
  grid-row: 2;
}

.research-shell {
  padding: 14px 24px 20px;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.research-main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.research-head {
  padding: 0 0 10px;
}

.research-overview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 0 14px;
}

.research-overview-card {
  border: 1px solid rgba(214, 223, 236, 0.9);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.research-overview-card span {
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.research-overview-card strong {
  color: #0f172a;
  font-size: 18px;
  line-height: 1.35;
}

.research-overview-card p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
}

.sidebar-scroll {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding-right: 4px;
}

.light-pill {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.light-pill strong {
  color: var(--ink);
}

.work-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  align-content: start;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  border: 1px solid var(--line);
  font-size: 12px;
}

.filters label {
  display: grid;
  gap: 6px;
}

.filters span {
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-note {
  margin: -2px 0 2px;
  font-size: 12px;
  line-height: 1.6;
  color: #64748b;
}

.error-message {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
}

.success-message {
  color: var(--success);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stack-field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.stack-field span {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.search-wide {
  grid-column: span 2;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  min-height: 48px;
  font-size: 14px;
  transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: #ffffff;
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--surface-soft);
}

input.error,
select.error,
textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

input.success,
select.success,
textarea.success {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.filter-actions {
  display: flex;
  gap: 10px;
}

.filter-actions button {
  flex: 1;
}

.section-head h4,
.recent-group h5,
.dock-head h3,
.panel-head h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.sidebar-section {
  display: grid;
  gap: 10px;
}

.sidebar-status-section {
  gap: 8px;
}

.sidebar-section-note {
  margin: -2px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.research-side-status-card {
  border: 1px solid rgba(214, 223, 236, 0.9);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 248, 252, 0.96) 100%);
  padding: 14px;
  display: grid;
  gap: 6px;
}

.research-side-status-card span {
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.research-side-status-card strong {
  color: #0f172a;
  font-size: 20px;
  line-height: 1.25;
}

.research-side-status-card p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
}

.action-stack,
.recent-stack,
.topic-grid {
  display: grid;
  gap: 10px;
}

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

.action-line {
  width: auto;
  min-height: 76px;
  justify-content: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  text-align: left;
}

.research-side-panel .action-line {
  align-items: flex-start;
  padding-top: 14px;
  font-weight: 700;
}

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

.topic-chip {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.mini-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.mini-list li {
  min-height: 0;
}

.mini-button {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.mini-button:hover {
  background: #fff;
}

.mini-button strong,
.mini-button span {
  display: block;
}

.mini-button strong {
  font-size: 13px;
  line-height: 1.45;
}

.mini-button span {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.5;
}

.mini-empty {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

.dock-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.result-panel .panel-head,
.detail-panel .panel-head {
  align-items: end;
}

.dock-actions,
.editor-actions,
.case-actions {
  display: flex;
  gap: 10px;
}

.case-actions-muted {
  margin-top: 6px;
}

.case-actions-muted button {
  min-height: 32px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  box-shadow: none;
}

.case-actions-muted button:hover {
  background: transparent;
  color: #1d4ed8;
  transform: none;
}

.case-actions-muted button.ghost {
  border: 0;
  background: transparent;
}

.compare-list,
.case-list,
.folder-list,
.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.compare-list {
  display: flex;
  gap: 10px;
  overflow: auto;
}

.compare-card,
.case-item,
.folder-item,
.card-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
}

.compare-card {
  min-width: 220px;
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.compare-card strong {
  display: block;
  color: var(--text);
  line-height: 1.55;
}

.compare-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compare-card span {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.6;
}

.compare-card button {
  width: 100%;
}

.workspace-grid,
.research-grid,
.compare-grid {
  min-height: 0;
}

.compare-grid {
  padding: 14px 26px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  overflow: auto;
}

.compare-context {
  margin: 0 26px 12px;
  border: 1px solid rgba(129, 140, 248, 0.22);
  border-radius: 20px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(245, 243, 255, 0.98), rgba(255, 255, 255, 0.98));
  display: grid;
  gap: 8px;
}

.compare-context-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.compare-context-role {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.compare-context strong {
  color: #312e81;
  font-size: 15px;
}

.compare-context p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
}

.compare-summary-list {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  font-size: 13px;
  line-height: 1.75;
}

.compare-summary-list li + li {
  margin-top: 4px;
}

.compare-context-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.research-flow-hint {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.96));
  display: grid;
  gap: 8px;
}

.research-flow-head {
  display: grid;
  gap: 2px;
}

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

.research-flow-head span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.research-flow-head b {
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
}

.research-flow-head strong {
  color: #122031;
  font-size: 14px;
}

.research-flow-head p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.65;
}

.research-task-context {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.55);
  color: #334155;
  font-size: 12px;
  line-height: 1.4;
}

.research-task-progress {
  margin-top: 6px;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.8);
  overflow: hidden;
}

.research-task-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #0f766e);
  transition: width 180ms ease;
}

.research-task-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.research-task-step {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.84);
}

.research-task-step::before {
  content: "";
  position: absolute;
  left: 26px;
  top: -10px;
  bottom: calc(100% - 10px);
  width: 1px;
  background: rgba(148, 163, 184, 0.28);
}

.research-task-step:first-child::before {
  display: none;
}

.research-task-step.is-completed {
  border-color: rgba(15, 118, 110, 0.18);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.96), rgba(255, 255, 255, 0.96));
}

.research-task-step.is-active {
  border-color: rgba(37, 99, 235, 0.2);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.96));
}

.research-task-marker {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  background: rgba(226, 232, 240, 0.92);
}

.research-task-step.is-completed .research-task-marker {
  color: #0f766e;
  background: rgba(204, 251, 241, 0.98);
}

.research-task-step.is-active .research-task-marker {
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.98);
}

.research-task-copy {
  display: grid;
  gap: 2px;
}

.research-task-copy strong {
  color: #122031;
  font-size: 13px;
}

.research-task-copy span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.research-task-step em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #64748b;
  white-space: nowrap;
  padding-top: 5px;
}

.research-task-step.is-completed em {
  color: #0f766e;
}

.research-task-step.is-active em {
  color: #1d4ed8;
}

.research-task-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
}

.research-task-actions button {
  min-height: 38px;
  border-radius: 10px;
}

.compare-section-group {
  display: grid;
  gap: 12px;
}

.compare-overview-section {
  display: grid;
  gap: 12px;
}

.compare-section-head {
  padding: 0 26px;
  display: grid;
  gap: 4px;
}

.compare-section-head-compact {
  gap: 2px;
}

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

.compare-section-head {
  justify-items: start;
}

.compare-section-head h3 {
  margin: 0;
  font-size: 15px;
  color: #122031;
}

.compare-section-status {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.compare-section-status.is-aligned {
  color: #166534;
  background: rgba(220, 252, 231, 0.9);
  border-color: #bbf7d0;
}

.compare-section-status.is-mixed {
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.92);
  border-color: #bfdbfe;
}

.compare-section-status.is-warning {
  color: #92400e;
  background: rgba(254, 243, 199, 0.92);
  border-color: #fde68a;
}

.compare-section-head p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.65;
}

.compare-section-tip {
  margin-top: 0;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.2;
  color: #1d4ed8;
  background: rgba(239, 246, 255, 0.92);
  border: 1px solid #dbeafe;
}

.compare-section-head .compare-section-title-row + .compare-section-tip {
  margin-left: 0;
}

.compare-grid-row {
  padding: 0 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.research-toolbar {
  padding: 0 0 12px;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.research-workbench-panel {
  margin-bottom: 14px;
}

.research-premium-panel {
  margin-bottom: 14px;
}

.research-report-panel {
  margin-bottom: 14px;
}

.report-draft-actions {
  display: flex;
  gap: 10px;
}

.report-draft-status {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.report-draft-content {
  display: grid;
  gap: 14px;
}

.report-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.report-block h4,
.report-block h5 {
  margin: 0;
}

.report-block h4 {
  font-size: 15px;
}

.report-block h5 {
  font-size: 13px;
  color: #334155;
}

.report-block p,
.report-block li {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.7;
}

.report-block textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #334155;
  padding: 12px;
  line-height: 1.7;
  resize: vertical;
}

.report-block textarea.report-title-input {
  min-height: 84px;
  font-size: 14px;
}

.result-inline-search {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.86);
}

.result-inline-search .stack-field {
  gap: 6px;
}

.report-block ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.analysis-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 13px;
  line-height: 1.7;
}

.analysis-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analysis-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
}

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

.analysis-action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.analysis-action-item strong {
  font-size: 13px;
  color: var(--ink);
}

.analysis-action-item span {
  font-size: 12px;
  color: var(--text-soft);
}

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

.analysis-source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.analysis-source-item strong {
  font-size: 13px;
  color: var(--ink);
}

.analysis-source-item span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-soft);
}

.analysis-item {
  display: grid;
  gap: 8px;
}

.analysis-citation-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.analysis-citation-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
}

.analysis-citation-list {
  display: grid;
  gap: 6px;
}

.analysis-citation-item {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fbff;
  border: 1px solid #dbeafe;
}

.analysis-citation-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.analysis-citation-item button {
  justify-self: start;
  padding: 4px 8px;
  font-size: 11px;
}

.analysis-citation-item p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.analysis-doc-excerpt {
  display: grid;
  gap: 4px;
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #ffffff;
}

.analysis-doc-label {
  font-size: 11px;
  color: #64748b;
}

.analysis-doc-excerpt p,
.analysis-doc-error {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.sep-topic-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.sep-overview-stats {
  margin-bottom: 14px;
}

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

.sep-case-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 16px 18px;
  display: grid;
  gap: 10px;
}

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

.sep-detail-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.sep-detail-card.risk {
  background: #fff8f3;
  border-color: rgba(217, 119, 6, 0.18);
}

.sep-detail-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 700;
}

.sep-detail-card h5 {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

.sep-detail-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-soft);
}

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

.sep-template-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.sep-template-card strong {
  font-size: 14px;
  color: var(--ink);
}

.sep-template-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-soft);
}

.sep-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.sep-template-actions button {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.detail-pack-strip {
  margin: 0 0 14px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96) 0%, rgba(255, 255, 255, 0.94) 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.detail-pack-copy {
  display: grid;
  gap: 4px;
}

.detail-pack-copy strong {
  color: var(--ink);
  font-size: 15px;
}

.detail-pack-copy span,
.detail-pack-copy em {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
  font-style: normal;
}

.detail-pack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-pack-actions button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
}

.sep-pack-banner {
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.98) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

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

.report-meta-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.report-meta-item span {
  color: #94a3b8;
  font-size: 11px;
}

.report-meta-item strong {
  color: #0f172a;
  font-size: 14px;
}

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

.premium-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  padding: 14px;
  display: grid;
  gap: 10px;
}

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

.premium-card h4 {
  margin: 0;
  font-size: 14px;
}

.premium-card p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.7;
}

.premium-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.premium-card button {
  min-height: 38px;
  border-radius: 10px;
}

.research-workbench-actions,
.workbench-case-actions {
  display: flex;
  gap: 10px;
}

.panel-head-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-inline-note {
  color: #64748b;
  font-size: 12px;
}

.research-workbench-actions {
  padding-bottom: 10px;
}

#research-task-bar {
  padding-bottom: 12px;
}

.workbench-case-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.workbench-case-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.research-workbench-panel .panel-head h3 {
  color: #1e293b;
}

.research-workbench-panel .panel-subhead {
  color: #64748b;
}

.workbench-case-actions {
  margin-top: 12px;
}

.workbench-case-actions button {
  min-height: 38px;
  border-radius: 10px;
}

.research-grid {
  display: grid;
  grid-template-columns: 280px 320px minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
}

.research-grid > .panel {
  background: rgba(252, 253, 250, 0.96);
}

.compact-head {
  padding: 18px 24px 10px;
}

.page-head h2 {
  margin: 0;
  font-size: 28px;
}

.page-desc {
  margin: 8px 0 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.panel {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  box-shadow: var(--shadow);
}

.detail-panel {
  grid-template-rows: minmax(0, 1fr);
}

.case-list,
.folder-list,
.card-list,
.case-detail,
.compare-column,
.editor-form {
  min-height: 0;
  overflow: auto;
}

.case-list,
.folder-list,
.card-list {
  display: grid;
  gap: 10px;
}

.sub-panel-section {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.panel-head-nested {
  padding-top: 2px;
}

.case-item,
.folder-item,
.card-item {
  padding: 14px;
  position: relative;
}

.case-item {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  box-shadow: none;
  background: transparent;
  padding: 14px 6px 14px 12px;
}

.folder-item,
.card-item {
  box-shadow: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(246, 248, 244, 0.92) 100%);
}

.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.result-year {
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.result-row-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.result-lead-marker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 11px;
  font-weight: 700;
}

.result-facts {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
}

.workbench-source-type-line {
  margin-top: 8px;
}

.result-facts span {
  display: grid;
  gap: 2px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.result-facts em {
  font-style: normal;
  color: var(--text-soft);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-item.active,
.folder-item.active,
.card-item.active {
  outline: none;
  border-color: rgba(42, 143, 91, 0.3);
  background: linear-gradient(180deg, rgba(42, 143, 91, 0.06) 0%, rgba(252, 253, 250, 1) 100%);
}

.case-item.active::before,
.folder-item.active::before,
.card-item.active::before {
  content: "";
  position: absolute;
  inset: 14px auto 14px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.case-item:first-child {
  border-top: 1px solid var(--line);
}

.case-item h4,
.folder-item h4,
.card-item h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 650;
}

.meta-line,
.holding-line,
.folder-item p,
.card-item p {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.65;
}

.meta-line {
  text-transform: none;
  letter-spacing: 0.01em;
}

.holding-line {
  color: var(--ink-soft);
  max-width: 44ch;
  margin-top: 10px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-bottom: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(251, 252, 254, 0.92) 20%, rgba(251, 252, 254, 0.98) 100%);
}

.pagination-copy {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.pagination-copy span:first-child {
  color: #334155;
}

.pagination-copy span:not(:first-child) {
  color: #94a3b8;
  font-size: 12px;
}

#page-remaining {
  color: #64748b;
}

.hidden {
  display: none !important;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 16px;
  color: var(--text-soft);
  line-height: 1.65;
  background: var(--surface-soft);
  font-size: 13px;
}

.case-detail {
  padding: 0 24px;
  width: 100%;
  max-width: none;
}

.detail-intro {
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-kicker {
  margin: 0 0 6px;
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-detail h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-quiet);
  color: var(--accent-deep);
  font-size: 12px;
  border: 1px solid rgba(42, 143, 91, 0.12);
}

.summary-lead {
  display: grid;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.summary-lead-item {
  display: grid;
  gap: 4px;
}

.summary-lead-item span {
  color: var(--text-soft);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.summary-lead-item strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
  font-weight: 600;
}

.inline-toolbar {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.inline-toolbar select {
  max-width: 260px;
}

.detail-section {
  margin-top: 24px;
  padding-top: 2px;
}

.detail-section h4 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.detail-section p,
.detail-section pre {
  margin: 0;
  font-size: 13px;
  line-height: 1.78;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.original-text-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
  transition: all 0.2s ease;
}

.original-text-card:hover {
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.original-text-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.original-text-copy strong {
  font-size: 16px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
}

.original-text-copy p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.original-text-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.original-text-actions button {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.original-text-actions button.ghost {
  padding: 8px 16px;
}

.doc-item {
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.doc-actions {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.doc-item a {
  color: var(--accent-deep);
  text-decoration: none;
  align-self: center;
}

.compare-column {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.compare-column-title-row {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.compare-column h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
}

.compare-column-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(239, 246, 255, 0.92);
  border: 1px solid #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.compare-column .detail-meta {
  margin-top: 10px;
  padding-bottom: 4px;
}

.compare-source-type-note {
  margin: -2px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.compare-column-structured {
  display: grid;
  gap: 12px;
}

.compare-block {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, 0.72);
  display: grid;
  gap: 8px;
}

.compare-block h4 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

.compare-block-body {
  color: #122031;
  font-size: 13px;
  line-height: 1.72;
}

.compare-block-body p {
  margin: 0;
}

.compare-block-rich {
  gap: 10px;
}

.compare-block-lead {
  color: #122031;
  font-size: 14px;
  line-height: 1.78;
}

.compare-block-details {
  border-top: 1px dashed rgba(148, 163, 184, 0.28);
  padding-top: 8px;
}

.compare-block-details summary {
  cursor: pointer;
  list-style: none;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.compare-block-details summary::-webkit-details-marker {
  display: none;
}

.compare-block-rich-body {
  margin-top: 10px;
}

.compare-block-body:has(.compare-block-details[open]) .compare-block-lead {
  display: none;
}

.compare-overview-grid {
  padding: 0 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.compare-overview-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  padding: 16px 18px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

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

.compare-overview-label {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
}

.compare-overview-year {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.compare-overview-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  color: #122031;
}

.compare-overview-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
}

.compare-overview-note {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 1100px) {
  .compare-overview-grid,
  .compare-grid-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

.editor-form label {
  display: grid;
  gap: 6px;
}

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

.research-side-panel {
  background:
    linear-gradient(180deg, rgba(33, 46, 38, 0.98) 0%, rgba(22, 33, 24, 0.98) 100%);
  border-color: rgba(255, 255, 255, 0.04);
  color: #f2f5ef;
}

.research-side-panel .panel-head {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.research-side-panel .page-kicker,
.research-side-panel .section-head h4,
.research-side-panel .recent-group h5 {
  color: rgba(242, 245, 239, 0.68);
}

.research-side-panel .panel-head h3 {
  color: #f8faf6;
}

.research-side-panel .action-line {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.research-side-panel .action-line.ghost {
  background: rgba(255, 255, 255, 0.12);
}

.research-side-panel .topic-chip,
.research-side-panel .mini-button,
.research-side-panel .mini-empty {
  background: rgba(255, 255, 255, 0.06);
  color: #f2f5ef;
  border-color: rgba(255, 255, 255, 0.08);
}

.research-side-panel .mini-button span,
.research-side-panel .mini-empty {
  color: rgba(242, 245, 239, 0.64);
}

.search-toolbar-panel,
.result-panel,
.detail-panel,
.compare-dock-panel,
.research-main > .research-grid > .panel,
.research-main {
  animation: panel-enter 0.32s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 120;
}

.modal.is-fullscreen {
  place-items: stretch;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 26, 49, 0.6);
  backdrop-filter: blur(8px);
  transition: background 0.3s ease;
}

body.preview-modal-open {
  overflow: hidden;
}

body.preview-modal-open .topbar {
  z-index: 10;
  pointer-events: none;
}

body.knowledge-graph-modal-open {
  overflow: hidden;
}

body.knowledge-graph-modal-open .topbar {
  z-index: 10;
  pointer-events: none;
}

.modal-panel {
  position: relative;
  width: min(1320px, calc(100vw - 48px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid rgba(124, 144, 178, 0.24);
  padding: 24px;
  box-shadow: 0 28px 80px rgba(18, 40, 72, 0.25);
  animation: modal-enter 0.3s ease-out;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-panel .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-panel .modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.modal-panel .modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-panel .modal-close:hover {
  background: var(--surface-muted);
  color: var(--ink);
  border-color: var(--line-strong);
}

.modal-panel .modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.modal-panel > .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 10px;
}

.modal.is-fullscreen .modal-panel {
  width: 100vw;
  height: 100vh;
  max-height: none;
  border-radius: 0;
  overflow: hidden;
  padding: 16px 18px 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.modal.is-fullscreen .preview-content {
  max-height: none;
  height: 100%;
}

.preview-content {
  margin-top: 20px;
  min-height: 220px;
  max-height: calc(100vh - 200px);
  overflow: auto;
  padding: 32px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, #fdfdfd 0%, #f7f9fc 100%);
  white-space: normal;
  word-break: break-word;
  line-height: 1.96;
  width: 100%;
  max-width: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.preview-content > * {
  width: 100%;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.preview-head-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.preview-head-copy h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--ink);
}

.preview-head-copy .panel-subhead {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.55;
}

.preview-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.preview-head-actions .surface-switch {
  margin-right: 4px;
}

.preview-head-actions .surface-tab,
.preview-head-actions .ghost {
  min-height: 42px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.preview-close-icon {
  min-width: 42px;
  height: 42px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.preview-close-icon:hover {
  background: var(--surface-muted);
  color: var(--ink);
  border-color: var(--line-strong);
}

.preview-section {
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  margin-bottom: 16px;
}

.preview-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(124, 144, 178, 0.14);
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(252, 252, 253, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  backdrop-filter: blur(10px);
  padding-top: 12px;
}

.preview-section-anchor {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(124, 144, 178, 0.24);
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.preview-section-anchor:hover {
  background: #f8fbff;
  border-color: rgba(59, 130, 246, 0.26);
  transform: translateY(-1px);
}

.preview-section-anchor.active {
  background: #eef4ff;
  border-color: rgba(59, 130, 246, 0.42);
  color: #1d4ed8;
  font-weight: 600;
}

.preview-section h4 {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.2;
  color: var(--ink);
  font-weight: 600;
}

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

.preview-section-heading {
  display: grid;
  gap: 6px;
  min-width: 0;
}

#preview-override-note {
  color: #64748b;
  font-size: 11px;
  line-height: 1.5;
}

.preview-editor {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
}

.knowledge-graph-modal-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
}

.knowledge-graph-toolbar {
  display: grid;
  gap: 12px;
}

.knowledge-graph-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.knowledge-graph-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.knowledge-graph-canvas-wrap {
  min-height: 0;
  display: grid;
  position: relative;
}

.knowledge-graph-canvas {
  position: relative;
  min-height: 620px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top, rgba(230, 240, 252, 0.62) 0%, rgba(247, 250, 253, 0.92) 42%, rgba(250, 247, 240, 0.98) 100%);
  overflow: hidden;
}

.knowledge-graph-canvas .empty-state {
  margin: 0;
  height: 100%;
  display: grid;
  place-items: center;
}

.knowledge-graph-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.knowledge-graph-edge {
  stroke: rgba(91, 112, 141, 0.34);
  stroke-width: 1.5;
  pointer-events: none;
}

.knowledge-graph-edge.is-derived {
  stroke: rgba(128, 146, 171, 0.28);
  stroke-dasharray: 5 6;
}

.knowledge-graph-edge-hit {
  stroke: transparent;
  stroke-width: 16;
  pointer-events: stroke;
}

.knowledge-graph-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 88px;
  max-width: 180px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(110, 126, 144, 0.18);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(37, 48, 65, 0.12);
  color: #24364f;
  display: grid;
  gap: 4px;
  text-align: left;
}

.knowledge-graph-node strong {
  font-size: 13px;
  line-height: 1.45;
}

.knowledge-graph-node span {
  font-size: 11px;
  line-height: 1.5;
  color: #64748b;
}

.knowledge-graph-node.is-selected {
  border-color: rgba(33, 84, 144, 0.35);
  box-shadow: 0 18px 36px rgba(30, 74, 130, 0.22);
}

.knowledge-graph-node.is-center {
  min-width: 220px;
  max-width: 260px;
  padding: 16px 18px;
  border-radius: 22px;
}

.knowledge-graph-node.type-case {
  background: rgba(245, 250, 255, 0.96);
}

.knowledge-graph-node.type-law {
  background: rgba(253, 249, 238, 0.96);
}

.knowledge-graph-node.type-issue {
  background: rgba(239, 247, 255, 0.96);
}

.knowledge-graph-node.type-rule {
  background: rgba(245, 244, 255, 0.96);
}

.knowledge-graph-node.type-topic {
  background: rgba(241, 249, 245, 0.96);
}

.knowledge-graph-node.type-cause,
.knowledge-graph-node.type-court,
.knowledge-graph-node.type-keyword {
  background: rgba(250, 250, 250, 0.96);
}

.knowledge-graph-sidebar {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.92) 100%);
}

/* 登录表单 */
.login-form {
  margin-top: 14px;
  min-height: 220px;
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 32px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, #fdfdfd 0%, #f7f9fc 100%);
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.login-form .form-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-form .form-header h3 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}

.login-form .form-header p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.login-form .stack-field {
  margin-bottom: 20px;
  display: grid;
  gap: 8px;
}

.login-form .stack-field span {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
}

.login-form .stack-field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.92);
  min-height: 52px;
}

.login-form .stack-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: #ffffff;
}

.login-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  align-items: center;
}

.login-form-actions button {
  flex: 1;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  min-height: 52px;
}

.login-form-actions button:first-child {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: white;
  border: none;
}

.login-form-actions button:first-child:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.15);
}

.login-form-actions button.ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.login-form-actions button.ghost:hover {
  background: var(--surface-muted);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.login-form .form-footer {
  margin-top: 24px;
  text-align: center;
  color: var(--text-soft);
  font-size: 14px;
}

.login-form .form-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.login-form .form-footer a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

/* 错误和成功消息 */
.error {
  color: #ef4444;
  margin-top: 8px;
}

.success {
  color: #10b981;
  margin-top: 8px;
}

/* 提示信息区域 */
.notification {
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.notification.error {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.notification.success {
  background: var(--success-soft);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.notification.warning {
  background: var(--warn-soft);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--warn);
}

.notification.info {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--accent);
}

.notification .icon {
  font-size: 20px;
  flex-shrink: 0;
}

.notification .content {
  flex: 1;
  min-width: 0;
}

.notification .content h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.notification .content p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: inherit;
  opacity: 0.9;
}

.notification .close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.8);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.notification .close:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

/* 顶部提示条 */
.top-notification {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.1);
  animation: slide-down 0.3s ease;
}

@keyframes slide-down {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.top-notification .content {
  flex: 1;
  min-width: 0;
}

.top-notification .content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: inherit;
}

.top-notification .actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.top-notification .actions button {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

/* 审核状态页面 */
.review-status-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.review-status-card {
  max-width: 560px;
  width: 100%;
  padding: 40px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, #fdfdfd 0%, #f7f9fc 100%);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
  text-align: center;
}

.review-status-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px;
}

.review-status-icon.pending {
  background: var(--warn-soft);
  color: var(--warn);
  border: 2px solid var(--warn-soft);
}

.review-status-icon.rejected {
  background: var(--danger-soft);
  color: var(--danger);
  border: 2px solid var(--danger-soft);
}

.review-status-icon.approved {
  background: var(--success-soft);
  color: var(--success);
  border: 2px solid var(--success-soft);
}

.review-status-card h3 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}

.review-status-card p {
  margin: 0 0 32px;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.6;
}

.review-status-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.review-status-actions button {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  min-height: 48px;
}

/* 审核驳回提示 */
.rejection-reason {
  margin: 24px 0;
  padding: 20px;
  border-radius: 16px;
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.2);
  text-align: left;
}

.rejection-reason h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--danger);
}

.rejection-reason p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.knowledge-graph-sidebar-section {
  display: grid;
  gap: 10px;
}

.knowledge-graph-sidebar-section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7b8ba2;
}

.knowledge-graph-node-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.72);
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.knowledge-graph-sidebar h4 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  color: #20324b;
}

.knowledge-graph-summary {
  margin: 0;
  color: #46596f;
  font-size: 14px;
  line-height: 1.8;
}

.knowledge-graph-meta {
  display: grid;
  gap: 8px;
}

.knowledge-graph-meta-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 13px;
  line-height: 1.6;
  color: #475569;
}

.knowledge-graph-meta-item strong {
  color: #22344d;
}

.knowledge-graph-node-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.knowledge-graph-related-list {
  display: grid;
  gap: 8px;
}

.knowledge-graph-related-item {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.82);
}

.knowledge-graph-related-item strong {
  display: block;
  margin-bottom: 2px;
  color: #20324b;
  font-size: 13px;
}

.knowledge-graph-related-item span {
  display: block;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.knowledge-graph-sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.knowledge-graph-sidebar-actions button {
  min-width: 112px;
}

.knowledge-graph-tooltip {
  position: absolute;
  z-index: 4;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
  font-size: 12px;
  line-height: 1.6;
  pointer-events: none;
  transform: translate(10px, 10px);
}

.knowledge-graph-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .knowledge-graph-layout {
    grid-template-columns: 1fr;
  }

  .knowledge-graph-canvas {
    min-height: 540px;
  }
}

.preview-editor-diff {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-editor-diff .result-pill {
  min-height: 28px;
}

.preview-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.preview-editor-head h4 {
  margin: 0 0 4px;
  font-size: 16px;
  color: #0f172a;
}

.preview-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.preview-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.preview-editor textarea {
  min-height: 320px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.8;
}

#preview-editor-source-textarea {
  background: #f8fafc;
  color: #475569;
}

.preview-switch {
  display: inline-flex;
}

.preview-content p {
  margin: 0 0 14px;
  width: 100%;
  max-width: none;
}

.preview-content p:last-child {
  margin-bottom: 0;
}

.preview-section {
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.preview-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(124, 144, 178, 0.14);
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(252, 252, 253, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  backdrop-filter: blur(10px);
}

.preview-section-anchor {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124, 144, 178, 0.24);
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.preview-section-anchor:hover {
  background: #f8fbff;
  border-color: rgba(59, 130, 246, 0.26);
}

.preview-anchor-layer {
  display: none;
}

.preview-anchor-title {
  color: #334155;
}

.preview-section-anchor.active {
  background: #eef4ff;
  border-color: rgba(59, 130, 246, 0.42);
  color: #1d4ed8;
}

.preview-section-anchor--facts {
  background: #fbfdff;
}

.preview-section-anchor--reasoning {
  background: #fffdfa;
}

.preview-section-anchor--decision {
  background: #fffaf6;
}

.preview-section-anchor--signature {
  background: #fffef8;
}

.preview-section + .preview-section {
  margin-top: 12px;
}

.preview-section h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  color: #0f172a;
}

.preview-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.preview-section-heading {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.preview-section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-section-layer {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.82;
}

.preview-section-layer--facts {
  background: #eef6ff;
  color: #2563eb;
}

.preview-section-layer--reasoning {
  background: #fff7ed;
  color: #c2410c;
}

.preview-section-layer--decision {
  background: #fff1f2;
  color: #be123c;
}

.preview-section-layer--signature {
  background: #f7fee7;
  color: #4d7c0f;
}

.preview-section-lead {
  margin: 0;
  max-width: 680px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.65;
}

.preview-section-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.preview-section-copy {
  min-height: 24px;
  padding: 2px 6px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.preview-section-copy:hover {
  background: rgba(148, 163, 184, 0.08);
  color: #334155;
}

.preview-section-action {
  min-height: 24px;
  padding: 2px 6px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  line-height: 1;
}

.preview-section-action:hover {
  background: rgba(148, 163, 184, 0.08);
  color: #475569;
}

.preview-section-body {
  display: grid;
  gap: 10px;
  color: #334155;
  font-size: 14px;
  line-height: 1.88;
}

.preview-section--facts {
  background: rgba(251, 253, 255, 0.72);
}

.preview-section--reasoning {
  background: rgba(255, 253, 250, 0.72);
}

.preview-section--decision {
  background: rgba(255, 250, 246, 0.74);
}

.preview-section--signature {
  background: rgba(255, 254, 248, 0.74);
}

.preview-heading-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 10px 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: center;
}

.preview-heading-court {
  color: #111827;
  font-size: 30px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.preview-heading-card h5 {
  margin: 0;
  color: #111827;
  font-size: 24px;
  line-height: 1.45;
  letter-spacing: 0.08em;
}

.preview-heading-case-number {
  color: #334155;
  font-size: 17px;
  line-height: 1.55;
  margin-top: 2px;
}

.preview-decision-intro {
  display: grid;
  gap: 10px;
}

.preview-decision-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  counter-reset: decision-item;
}

.preview-decision-list li {
  position: relative;
  padding: 0 0 0 28px;
  border-radius: 0;
  background: transparent;
  border: none;
  line-height: 1.95;
}

.preview-decision-list li::before {
  counter-increment: decision-item;
  content: counter(decision-item) ".";
  position: absolute;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.95;
  text-align: left;
}

.preview-issue-list li::before {
  background: #eef6ff;
  color: #2563eb;
}

.preview-reasoning-block {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fbfcfe;
  border: 1px solid rgba(124, 144, 178, 0.14);
}

.preview-reasoning-block strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.85;
}

.preview-reasoning-block p {
  margin: 0;
}

.preview-signature-block {
  display: grid;
  justify-items: end;
  gap: 8px;
  padding: 8px 0 0;
  background: transparent;
  border: none;
}

.preview-signature-list {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.preview-signature-item {
  display: grid;
  grid-template-columns: auto auto;
  gap: 16px;
  align-items: center;
  justify-content: end;
}

.preview-signature-item span {
  color: #475569;
  font-size: 13px;
  line-height: 1.75;
}

.preview-signature-item strong {
  color: #1f2937;
  font-size: 14px;
  line-height: 1.8;
  font-weight: 600;
  min-width: 88px;
  text-align: left;
}

.preview-section:has(+ .preview-section) {
  position: relative;
}

.preview-raw-text {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: none;
  color: #334155;
  font-size: 15px;
}

.preview-raw-text p,
.preview-raw-paragraph {
  margin: 0;
  width: 100%;
  max-width: none;
  text-indent: 2em;
  line-height: 2;
}

.preview-raw-paragraph--block {
  text-indent: 0;
}

@media (max-width: 960px) {
  .preview-head-actions {
    justify-content: flex-start;
  }
}

/* PC-only dashboard redesign */

.app-shell {
  padding: 14px 18px 18px;
  gap: 14px;
  grid-template-rows: 58px minmax(0, 1fr);
}

.topbar {
  padding: 0 18px;
  border: 1px solid rgba(40, 57, 47, 0.1);
  border-radius: 24px;
  background: rgba(251, 249, 244, 0.92);
  box-shadow: 0 14px 34px rgba(28, 23, 11, 0.08);
}

.topbar-nav {
  justify-content: flex-start;
}

.topbar-side {
  display: flex;
  justify-content: flex-end;
}

#view-library.view.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.dashboard-hero {
  padding: 16px 18px 18px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, rgba(251, 248, 241, 0.96) 100%);
  border: 1px solid rgba(58, 51, 33, 0.08);
  box-shadow: 0 18px 42px rgba(53, 39, 14, 0.08);
  display: grid;
  gap: 14px;
}

.hero-status-line,
.hero-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(58, 51, 33, 0.12);
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.status-pill.online::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2cc467;
}

.hero-meta-line {
  color: #5f6a73;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.hero-title-row h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.hero-title-row p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}

.library-dashboard {
  min-height: 0;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 286px;
  gap: 18px;
}

.dashboard-left,
.dashboard-main,
.dashboard-right {
  min-height: 0;
  display: grid;
  overflow: hidden;
}

.dashboard-left,
.dashboard-right {
  grid-template-rows: auto minmax(0, 1fr);
}

.dashboard-main {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

.dashboard-left,
.dashboard-right {
  padding: 18px;
}

.dashboard-left .panel-head,
.dashboard-right .panel-head {
  padding-bottom: 12px;
}

.left-panel-body,
.right-panel-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  padding-right: 4px;
}

#view-evolution.view.active {
  display: block;
  height: auto;
  min-height: auto;
}

#view-evolution .evolution-dashboard {
  position: relative;
  min-height: auto;
  align-items: start;
}

#view-evolution.graph-left-collapsed .evolution-dashboard {
  grid-template-columns: 64px minmax(0, 1fr) 286px;
}

#view-evolution .dashboard-left,
#view-evolution .dashboard-main,
#view-evolution .dashboard-right {
  min-height: auto;
  overflow: visible;
  align-self: start;
}

#view-evolution .dashboard-main {
  grid-template-rows: auto auto auto;
}

#view-evolution .left-panel-body,
#view-evolution .right-panel-body {
  overflow: visible;
  max-height: none;
}

.graph-sidebar-handle {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 3;
  transform: none;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dbe3f1;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.graph-sidebar-handle:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.graph-sidebar-toggle-icon {
  position: relative;
  width: 15px;
  height: 14px;
  display: inline-flex;
  align-items: stretch;
  justify-content: center;
}

.graph-sidebar-toggle-rail {
  position: absolute;
  left: 0;
  top: 0;
  width: 15px;
  height: 14px;
  border: 1.5px solid #94a3b8;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.graph-sidebar-toggle-panel {
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 14px;
  border-right: 1.5px solid #94a3b8;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  background: linear-gradient(180deg, #e0e7ff 0%, #eef2ff 100%);
}

#view-evolution.graph-left-collapsed .dashboard-left {
  padding: 14px 10px;
}

#view-evolution.graph-left-collapsed .dashboard-left .panel-head {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-bottom: 0;
}

#view-evolution.graph-left-collapsed .dashboard-left .panel-head > div,
#view-evolution.graph-left-collapsed .dashboard-left .panel-tag,
#view-evolution.graph-left-collapsed .dashboard-left .left-panel-body {
  display: none;
}

#view-evolution.graph-left-collapsed .graph-sidebar-handle {
  top: 14px;
  left: 16px;
  transform: none;
}

#view-evolution.graph-left-collapsed .graph-sidebar-toggle-panel {
  left: 10px;
  border-right: 0;
  border-left: 1.5px solid #94a3b8;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.stack-field {
  display: grid;
  gap: 8px;
}

.stack-field span {
  color: #526153;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.left-panel-body input,
.left-panel-body select {
  min-height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
}

.left-panel-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.left-panel-footer {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 10px;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(250, 251, 253, 0.92) 18%, rgba(250, 251, 253, 0.98) 100%);
}

.left-panel-actions button {
  min-height: 48px;
  border-radius: 14px;
}

.left-panel-summary {
  display: flex;
  justify-content: flex-start;
  padding-top: 0;
}

.main-toolbar {
  display: grid;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 20px;
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid rgba(58, 51, 33, 0.1);
}

.main-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.main-tabs .topic-chip {
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(58, 51, 33, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: #37463d;
  font-weight: 700;
}

.main-tabs .topic-chip.active,
.main-tabs .topic-chip:hover {
  background: linear-gradient(180deg, #ebf9f8 0%, #dcfbf5 100%);
  border-color: rgba(26, 177, 166, 0.42);
  color: #106d68;
  box-shadow: 0 10px 24px rgba(16, 109, 104, 0.1);
}

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

.stat-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(58, 51, 33, 0.1);
  background: rgba(255, 255, 255, 0.92);
}

.stat-card span {
  color: #6c756f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.stat-card strong {
  color: var(--ink);
  font-size: 23px;
  line-height: 1.1;
}

.main-worksurface {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 14px;
}

.main-worksurface.is-entry,
.main-worksurface.is-results-only {
  grid-template-columns: minmax(0, 1fr);
}

.main-worksurface.is-entry .result-panel {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  min-height: 480px;
}

.main-worksurface.is-entry .panel-head {
  padding-bottom: 16px;
}

body.library-entry-active .dashboard-main {
  background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(252, 253, 255, 0.99) 100%);
}

body.library-entry-active .main-worksurface.is-entry .result-panel {
  border-color: rgba(199, 210, 254, 0.6);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.04);
}

body.library-entry-active .main-worksurface.is-entry .panel-head {
  display: none;
}

.inner-panel {
  min-height: 0;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 250, 247, 0.98) 100%);
  border: 1px solid rgba(58, 51, 33, 0.1);
  box-shadow: 0 18px 36px rgba(38, 27, 8, 0.06);
}

.result-panel .panel-head,
.detail-panel .panel-head {
  padding-bottom: 12px;
}

.result-panel .panel-head span,
.utility-block-head span {
  color: var(--text-soft);
  font-size: 12px;
}

.result-panel .case-list {
  padding-right: 4px;
}

.library-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 10px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 100%);
  border-bottom: 1px solid rgba(230, 235, 242, 0.8);
}

.results-handoff {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px 14px;
  margin: 2px 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.results-handoff-copy {
  display: grid;
  gap: 4px;
}

.results-handoff-copy strong {
  color: #0f172a;
  font-size: 14px;
}

.results-handoff-copy p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.65;
}

.results-handoff-aside {
  align-self: start;
  justify-self: end;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef4ff;
  border: 1px solid #d9e6ff;
  color: #3158a3;
  font-size: 12px;
  font-weight: 700;
}

body.library-results-intro-active .main-toolbar {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #ffffff;
  border-color: #eef2f7;
  box-shadow: none;
}

body.library-results-intro-active .library-quick-filter-group,
body.library-results-intro-active .surface-switch,
body.library-results-intro-active #results-inline-search {
  display: none !important;
}

body.library-results-intro-active .main-stats {
  grid-template-columns: minmax(0, 1fr);
}

body.library-results-intro-active .stat-card {
  padding: 9px 12px;
  background: #ffffff;
  border: 1px solid #edf2f7;
}

body.library-results-intro-active .result-panel .panel-head {
  padding-bottom: 8px;
}

body.library-results-intro-active .result-panel .panel-head h3 {
  font-size: 17px;
}

body.library-results-intro-active .result-panel .panel-head .panel-subhead {
  color: #475569;
  margin-top: 2px;
}

body.library-results-intro-active .result-panel .panel-head > span {
  color: #94a3b8;
  font-size: 11px;
}

body.library-results-intro-active .library-filter-summary {
  padding-top: 0;
  margin-top: 0;
  border-bottom: 0;
  background: transparent;
}

body.library-results-intro-active .dashboard-main {
  padding-top: 22px;
}

body.library-reading-active .detail-panel {
  border-color: #dbe4ff;
  box-shadow: 0 20px 42px rgba(37, 99, 235, 0.08);
}

body.library-reading-active .detail-head {
  margin-bottom: 10px;
}

.search-empty-guide {
  display: grid;
  gap: 20px;
  padding: 18px;
  margin-bottom: 0;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.main-worksurface.is-entry .search-empty-guide {
  margin-top: 0;
  padding: 56px 56px 44px;
  border-radius: 24px;
}

.search-empty-guide-copy {
  display: grid;
  gap: 0;
  justify-items: center;
  text-align: center;
}

.search-empty-guide-copy strong {
  font-size: 18px;
  color: #0f172a;
}

.main-worksurface.is-entry .search-empty-guide-copy strong {
  font-size: 36px;
  line-height: 1.2;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.search-empty-guide-copy p {
  margin: 0;
  color: #64748b;
  line-height: 1.7;
}

.main-worksurface.is-entry .search-empty-guide-copy p {
  max-width: 760px;
  font-size: 15px;
  color: #475569;
}

.search-empty-guide-examples,
.search-empty-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.search-empty-guide-examples .ghost {
  background: #fff;
  border-color: #e5e7eb;
  color: #475569;
}

.main-worksurface.is-entry .search-empty-guide-actions {
  padding-top: 2px;
}

.main-worksurface.is-entry .search-empty-guide-actions button {
  padding: 13px 24px;
  min-height: 54px;
  font-size: 16px;
  border-radius: 16px;
}

.main-worksurface.is-entry .search-empty-guide-examples {
  padding-top: 6px;
  justify-content: center;
}

body.library-entry-active .search-empty-guide-examples .ghost {
  min-height: 46px;
  padding: 10px 14px;
}

.entry-advanced-search {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0;
}

.entry-advanced-search summary {
  cursor: pointer;
  list-style: none;
  width: fit-content;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
}

.entry-advanced-search summary::-webkit-details-marker {
  display: none;
}

.entry-advanced-search summary::before {
  content: "+";
  margin-right: 8px;
  color: #94a3b8;
}

.entry-advanced-search[open] summary::before {
  content: "−";
}

.entry-advanced-inline {
  width: auto;
  max-width: none;
  margin: 0;
  align-self: center;
}

.entry-advanced-inline[open] {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 6px;
}

.entry-advanced-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border: 1px solid #e5ebf5;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.entry-advanced-grid .stack-field,
.entry-advanced-grid .entry-toggle-field {
  margin: 0;
}

.entry-advanced-grid .stack-field > span,
.entry-source-type-block > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.entry-advanced-grid input,
.entry-advanced-grid select {
  min-height: 46px;
  background: #fff;
}

.entry-toggle-field {
  align-self: end;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #e5ebf5;
  border-radius: 14px;
  background: #fff;
}

.entry-source-type-block {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid #e5ebf5;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

body.library-entry-active #view-library .dashboard-left {
  background: linear-gradient(180deg, rgba(245, 248, 252, 0.98) 0%, rgba(239, 243, 248, 0.98) 100%);
}

.entry-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(230px, 0.72fr) auto;
  gap: 16px;
  align-items: end;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.entry-search-field {
  display: grid;
  gap: 0;
}

.entry-search-field span {
  display: none;
}

.entry-search-field input,
.entry-search-field select {
  min-height: 58px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid #dbe4ff;
  background: #ffffff;
  font-size: 17px;
}

.entry-search-field-query input {
  font-size: 18px;
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(199, 210, 254, 0.16);
}

.entry-more-filters {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
}

.entry-more-filters summary {
  cursor: pointer;
  list-style: none;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.entry-more-filters summary::-webkit-details-marker {
  display: none;
}

.entry-more-filters summary::before {
  content: "+";
  margin-right: 8px;
  color: #94a3b8;
}

.entry-more-filters[open] summary::before {
  content: "−";
}

.entry-more-filters p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.library-filter-summary-count {
  color: #94a3b8;
  font-size: 12px;
}

.library-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e6ebf2;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
  cursor: default;
}

.library-filter-chip em {
  font-style: normal;
  color: #94a3b8;
}

.library-filter-chip:not(.is-clearable) {
  background: #f8fafc;
}

.library-filter-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(239, 246, 255, 0.92);
  color: #2563eb;
  font-size: 12px;
  line-height: 1.4;
}

.library-filter-action.muted {
  border-color: #e6ebf2;
  background: #ffffff;
  color: #64748b;
}

.library-filter-action-text {
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: #64748b;
}

.library-filter-action-text:hover {
  color: #334155;
  background: transparent;
}

.library-filter-action-text.muted {
  background: transparent;
  color: #94a3b8;
}

.library-filter-action.is-graph {
  padding: 6px 12px;
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98) 0%, rgba(219, 234, 254, 0.9) 100%);
  color: #1d4ed8;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.library-filter-action.is-graph:hover {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.98) 0%, rgba(191, 219, 254, 0.9) 100%);
  color: #1e40af;
}

.library-filter-divider {
  width: 1px;
  height: 18px;
  align-self: center;
  background: #e2e8f0;
}

.library-filter-chip.is-clearable {
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.library-filter-chip.is-clearable:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #334155;
}

.library-filter-chip-close {
  color: #94a3b8;
  font-weight: 700;
  line-height: 1;
}

.library-filter-reset {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  padding: 0 2px;
}

.library-filter-reset:hover {
  color: #334155;
  text-decoration: underline;
}

.case-list,
.case-detail {
  scrollbar-width: thin;
}

.case-item {
  padding: 15px 6px 16px 14px;
  border-top: 1px solid rgba(58, 51, 33, 0.08);
}

.case-item:hover {
  background: rgba(42, 143, 91, 0.04);
}

.result-row h4 {
  font-size: 15px;
}

.result-year {
  font-size: 12px;
  color: #7f867f;
}

.result-facts {
  gap: 8px 18px;
}

.holding-line {
  max-width: none;
  font-size: 12px;
}

.detail-panel {
  background:
    linear-gradient(180deg, rgba(249, 250, 247, 0.98) 0%, rgba(244, 247, 242, 0.98) 100%);
}

.detail-intro {
  gap: 14px;
  padding-bottom: 16px;
}

.summary-lead {
  display: grid;
  gap: 10px;
}

.summary-lead-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(58, 51, 33, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.summary-lead-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 12px;
}

.summary-lead-item strong {
  line-height: 1.6;
}

.inline-toolbar {
  margin: 16px 0;
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 10px;
}

.detail-section {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(58, 51, 33, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.detail-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.detail-section pre {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.72;
  color: #324036;
  width: 100%;
  max-width: none;
  display: block;
}

.detail-richtext {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: none;
}

.detail-richtext p {
  margin: 0;
  color: #324036;
  line-height: 1.9;
  white-space: normal;
  word-break: break-word;
  width: 100%;
  max-width: none;
  display: block;
}

.utility-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(58, 51, 33, 0.08);
  background: rgba(255, 252, 248, 0.88);
}

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

.utility-block-head h4 {
  margin: 0;
  font-size: 14px;
}

.utility-compare-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.utility-compare-list .compare-card {
  min-width: 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
}

.utility-compare-list:empty::before {
  content: "尚未加入待研究案例。";
  display: block;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(58, 51, 33, 0.14);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.82);
}

.utility-actions {
  display: grid;
  gap: 10px;
}

.utility-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(58, 51, 33, 0.12);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: none;
}

.utility-link::after {
  content: "▶";
  color: #25312a;
  font-size: 14px;
}

.utility-link:hover {
  background: #fff;
  box-shadow: 0 12px 28px rgba(26, 22, 12, 0.08);
}

/* Force desktop layout for the current product version */
.library-dashboard,
.main-worksurface,
.research-shell,
.research-grid,
.topbar {
  min-width: 0;
}

/* shadcn-admin inspired desktop refinement */

.app-shell {
  padding: 16px;
  padding-top: 132px;
  gap: 12px;
  grid-template-rows: minmax(0, 1fr);
}

body.library-entry-active .app-shell,
body.library-results-intro-active .app-shell {
  padding-top: 176px;
}

body.library-results-intro-active .app-shell {
  padding-top: 198px;
}

body.library-entry-active {
  background:
    linear-gradient(180deg, #f6fbfd 0%, #eaf4fb 20%, #e3eff7 42%, #edf1ea 56%, #efe6d6 68%, #e7d7bf 100%);
}

.topbar {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 80;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(248, 251, 253, 0.98) 0%, rgba(239, 246, 252, 0.96) 48%, rgba(244, 247, 250, 0.94) 100%);
  border: 1px solid rgba(188, 199, 210, 0.62);
  box-shadow:
    0 12px 28px rgba(137, 159, 179, 0.12),
    0 2px 6px rgba(15, 23, 42, 0.04);
  grid-template-columns: 250px auto minmax(380px, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 18px;
  row-gap: 12px;
  padding: 14px 18px 16px;
  overflow: hidden;
}

.topbar::before,
.topbar::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.topbar::before {
  inset: 0;
  opacity: 0.9;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, transparent 38%),
    radial-gradient(42px 24px at 8% 22px, rgba(207, 173, 126, 0.16) 0 72%, transparent 75%),
    radial-gradient(28px 18px at calc(8% + 24px) 22px, rgba(207, 173, 126, 0.14) 0 72%, transparent 75%),
    radial-gradient(28px 18px at calc(8% - 20px) 24px, rgba(207, 173, 126, 0.12) 0 72%, transparent 75%),
    radial-gradient(54px 26px at 18% 58px, rgba(191, 205, 220, 0.18) 0 72%, transparent 75%),
    radial-gradient(32px 18px at calc(18% + 28px) 56px, rgba(191, 205, 220, 0.15) 0 72%, transparent 75%),
    radial-gradient(32px 18px at calc(18% - 24px) 60px, rgba(191, 205, 220, 0.12) 0 72%, transparent 75%),
    radial-gradient(44px 24px at 92% 26px, rgba(207, 173, 126, 0.14) 0 72%, transparent 75%),
    radial-gradient(30px 18px at calc(92% + 20px) 26px, rgba(207, 173, 126, 0.12) 0 72%, transparent 75%),
    radial-gradient(30px 18px at calc(92% - 24px) 28px, rgba(207, 173, 126, 0.1) 0 72%, transparent 75%),
    radial-gradient(60px 28px at 84% 64px, rgba(188, 204, 220, 0.16) 0 72%, transparent 75%),
    radial-gradient(36px 18px at calc(84% + 32px) 62px, rgba(188, 204, 220, 0.12) 0 72%, transparent 75%),
    radial-gradient(36px 18px at calc(84% - 28px) 66px, rgba(188, 204, 220, 0.1) 0 72%, transparent 75%);
  background-repeat: no-repeat;
}

.topbar::after {
  left: 20px;
  right: 20px;
  bottom: 10px;
  height: 44px;
  opacity: 0.52;
  background:
    linear-gradient(180deg, transparent 0%, rgba(210, 221, 230, 0.18) 100%),
    radial-gradient(56px 22px at 8% 22px, rgba(196, 169, 122, 0.16) 0 72%, transparent 75%),
    radial-gradient(34px 16px at calc(8% + 30px) 20px, rgba(196, 169, 122, 0.12) 0 72%, transparent 75%),
    radial-gradient(34px 16px at calc(8% - 26px) 24px, rgba(196, 169, 122, 0.1) 0 72%, transparent 75%),
    radial-gradient(64px 24px at 92% 20px, rgba(196, 169, 122, 0.14) 0 72%, transparent 75%),
    radial-gradient(38px 16px at calc(92% + 34px) 18px, rgba(196, 169, 122, 0.1) 0 72%, transparent 75%),
    radial-gradient(38px 16px at calc(92% - 28px) 22px, rgba(196, 169, 122, 0.1) 0 72%, transparent 75%);
  background-repeat: no-repeat;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.topbar-brand {
  grid-column: 1;
  grid-row: 1;
}

.brand-home-btn {
  border: 0;
  background: transparent;
  color: #23384a;
  font-size: 18px;
  font-weight: 680;
  line-height: 1;
  letter-spacing: 0.05em;
  padding: 0;
  box-shadow: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.62);
}

.brand-home-btn:hover {
  transform: none;
  box-shadow: none;
  color: #111827;
}

.topbar-nav {
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-start;
}

.topbar-side {
  grid-column: 4;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  white-space: nowrap;
}

.plan-pill strong {
  color: #2563eb;
}

.topbar-toggle {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
  border-color: rgba(188, 199, 210, 0.7);
  background: rgba(248, 251, 253, 0.76);
}

.feature-disabled {
  opacity: 0.72;
}

.feature-disabled button::after,
.feature-disabled .utility-link::after {
  content: "PRO";
  margin-left: 8px;
  color: #4338ca;
  font-size: 11px;
}

.panel-gate-note {
  margin: -2px 0 0;
  color: var(--text-soft);
  font-size: 12px;
}

.panel-gate-note strong {
  color: #4338ca;
}

.topbar-brand h1 {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #111827;
  text-rendering: geometricPrecision;
}

.brand-kicker,
.page-kicker,
.quick-kicker {
  color: var(--text-soft);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.topbar .nav-item {
  padding: 9px 16px;
  border-radius: 999px;
  color: #567083;
  background: rgba(246, 250, 253, 0.32);
  border: 1px solid transparent;
}

.topbar .nav-item.active,
.topbar .nav-item:hover {
  background: rgba(248, 251, 253, 0.86);
  color: #22384d;
  border-color: rgba(194, 202, 212, 0.72);
  box-shadow: 0 10px 22px rgba(166, 182, 197, 0.14);
}

.compare-pill {
  padding: 7px 10px;
  background: rgba(248, 251, 253, 0.8);
  border-color: rgba(188, 199, 210, 0.7);
  color: #52697c;
  flex: 0 0 auto;
  white-space: nowrap;
}

.topbar-status {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  overflow: visible;
  padding-right: 4px;
}

.topbar-workbench-strip {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-bottom: 0;
  padding: 14px 18px 13px;
  border-radius: 18px;
  border: 1px solid rgba(191, 201, 212, 0.56);
  background:
    linear-gradient(180deg, rgba(243, 248, 252, 0.86) 0%, rgba(235, 244, 250, 0.82) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 24px rgba(169, 186, 201, 0.12);
  position: relative;
  overflow: hidden;
}

.topbar-workbench-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.72;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, transparent 55%),
    radial-gradient(48px 18px at 8% 56%, rgba(198, 170, 126, 0.16) 0 70%, transparent 73%),
    radial-gradient(28px 13px at calc(8% + 24px) 54%, rgba(198, 170, 126, 0.12) 0 70%, transparent 73%),
    radial-gradient(28px 13px at calc(8% - 20px) 58%, rgba(198, 170, 126, 0.1) 0 70%, transparent 73%),
    radial-gradient(48px 18px at 92% 48%, rgba(198, 170, 126, 0.16) 0 70%, transparent 73%),
    radial-gradient(28px 13px at calc(92% + 24px) 46%, rgba(198, 170, 126, 0.12) 0 70%, transparent 73%),
    radial-gradient(28px 13px at calc(92% - 20px) 50%, rgba(198, 170, 126, 0.1) 0 70%, transparent 73%);
  background-repeat: no-repeat;
}

.topbar-workbench-strip > * {
  position: relative;
  z-index: 1;
}

.topbar-workbench-strip .library-workbench-copy strong {
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.topbar-workbench-strip .library-workbench-copy span {
  color: #5f7384;
}

.topbar-workbench-strip .library-workbench-status {
  gap: 8px;
}

.topbar-workbench-strip .ghost {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(248, 251, 253, 0.82);
  border-color: rgba(188, 199, 210, 0.68);
}

.topbar-workbench-strip .workbench-count-pill {
  background: rgba(242, 246, 250, 0.96);
  border-color: rgba(185, 196, 208, 0.74);
  color: #587285;
}

.topbar-status .status-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: flex-end;
  overflow: visible;
  min-width: 0;
}

.dashboard-hero {
  display: none;
}

.status-pill {
  padding: 5px 7px;
  border-radius: 999px;
  border-color: var(--line);
  background: transparent;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
  flex: 0 0 auto;
}

.library-switch {
  appearance: none;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.18s ease;
}

.library-switch.active {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.library-switch:hover {
  color: #475569;
  border-color: #cbd5e1;
}

.status-pill.online::before {
  width: 8px;
  height: 8px;
}

.hero-meta-line {
  color: #64748b;
}

.hero-title-row h2 {
  font-size: 22px;
  font-weight: 750;
}

.hero-title-row p {
  color: #64748b;
  font-size: 14px;
  margin-top: 8px;
}

.library-dashboard {
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  gap: 16px;
}

.panel {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.dashboard-left,
.dashboard-main,
.dashboard-right {
  padding: 16px;
}

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

.panel-head h3,
.section-head h4,
.utility-block-head h4 {
  font-size: 14px;
  font-weight: 700;
}

.panel-subhead {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.55;
}

.panel-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.free-tag {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.pro-tag {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

.left-panel-body,
.right-panel-body {
  gap: 14px;
}

.stack-field {
  gap: 7px;
}

.stack-field span {
  font-size: 12px;
  color: #6b7280;
  font-weight: 700;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 2px;
}

.toggle-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.toggle-field span {
  color: #475569;
  font-size: 13px;
  font-weight: 650;
}

.left-panel-body input,
.left-panel-body select,
.inline-toolbar select,
.inline-toolbar button {
  min-height: 42px;
  border-radius: 10px;
}

input,
select,
textarea {
  border-radius: 10px;
  border-color: var(--line);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.left-panel-actions button {
  min-height: 42px;
  border-radius: 10px;
}

.light-pill {
  background: #f8fafc;
  color: #0f172a;
}

.light-pill strong {
  color: #0f172a;
}

.main-toolbar {
  padding: 0;
  border: 0;
  background: transparent;
  gap: 14px;
}

.main-tabs {
  gap: 8px;
}

.main-tabs .topic-chip {
  padding: 9px 12px;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  border-color: var(--line);
  font-weight: 600;
}

.main-tabs .topic-chip.active,
.main-tabs .topic-chip:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: none;
}

.main-stats {
  grid-template-columns: repeat(2, minmax(0, 220px));
}

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

.stat-card span {
  color: #64748b;
  font-size: 11px;
}

.stat-card strong {
  font-size: 18px;
  font-weight: 750;
}

.main-worksurface {
  grid-template-columns: minmax(360px, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
}

.inner-panel,
.utility-block {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.result-panel .panel-head span {
  font-size: 12px;
  color: #64748b;
}

.result-panel .panel-head > div,
.dashboard-left .panel-head > div,
.dashboard-right .panel-head > div {
  min-width: 0;
}

.case-item {
  padding: 14px 4px 14px 10px;
}

.case-item.active,
.folder-item.active,
.card-item.active {
  border-color: var(--line);
  background: #f8fafc;
}

.case-item.active::before,
.folder-item.active::before,
.card-item.active::before {
  background: #0f172a;
}

.result-row h4,
.case-item h4,
.folder-item h4,
.card-item h4 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.result-year,
.meta-line,
.holding-line,
.folder-item p,
.card-item p {
  color: #6b7280;
}

.result-facts span {
  color: #334155;
}

.result-facts em {
  color: #94a3b8;
  font-size: 10px;
}

.detail-panel {
  background: #fff;
}

.case-detail h3 {
  font-size: 18px;
  line-height: 1.45;
}

.detail-meta .badge {
  background: #f8fafc;
  border-color: var(--line);
  color: #334155;
}

.summary-lead-item,
.detail-section {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.detail-section h4 {
  font-size: 13px;
  color: #334155;
}

.detail-section pre {
  color: #1f2937;
}

.utility-block {
  gap: 10px;
  padding: 14px;
}

.utility-link {
  min-height: 48px;
  border-radius: 12px;
  border-color: var(--line);
  background: #fff;
  color: #0f172a;
}

.utility-link::after {
  color: #64748b;
}

.utility-link:hover {
  background: #f8fafc;
  box-shadow: none;
}

.utility-compare-list .compare-card {
  border-radius: 12px;
  border-color: var(--line);
  box-shadow: none;
}

.compare-card span {
  color: #6b7280;
}

.empty-state {
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  background: #fafafa;
  color: #6b7280;
}

/* B2: knowledge workspace refinement */

.dashboard-hero {
  padding: 14px 18px;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 250, 252, 0.98) 100%);
}

.hero-title-row h2 {
  display: none;
}

.hero-title-row p {
  display: none;
}

.library-dashboard {
  grid-template-columns: 280px minmax(0, 1fr) 232px;
}

body.library-entry-active #view-library .library-dashboard {
  grid-template-columns: minmax(0, 1fr) 0;
}

body.library-entry-active #view-library .dashboard-left {
  display: none;
}

.dashboard-left,
.dashboard-main,
.dashboard-right {
  border-radius: 20px;
  position: relative;
}

.dashboard-left {
  background:
    linear-gradient(180deg, rgba(244, 247, 251, 0.98) 0%, rgba(237, 242, 247, 0.98) 100%);
}

.dashboard-main {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(252, 253, 255, 0.99) 100%);
}

.dashboard-right {
  background:
    linear-gradient(180deg, rgba(244, 247, 251, 0.98) 0%, rgba(236, 241, 247, 0.98) 100%);
}

#library-right-panel .panel-head {
  border-bottom-color: rgba(214, 223, 236, 0.72);
}

#library-right-panel .panel-head h3 {
  color: #334155;
}

#library-right-panel .panel-subhead {
  color: #64748b;
}

#library-right-panel .utility-block:first-child {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.94) 100%);
  border: 1px solid rgba(214, 223, 236, 0.72);
}

.sidebar-handle {
  position: absolute;
  top: 16px;
  z-index: 4;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #d7dfea;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-handle:hover {
  background: #ffffff;
  border-color: #c5d0df;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.sidebar-handle-left {
  right: 14px;
}

.sidebar-handle-right {
  left: 14px;
}

.sidebar-handle-icon {
  font-size: 14px;
  line-height: 1;
  color: #4b5563;
  font-weight: 700;
}

.dashboard-left .panel-head,
.dashboard-right .panel-head {
  padding-right: 42px;
}

.dashboard-right .panel-head {
  padding-left: 42px;
}

.left-panel-body {
  gap: 10px;
}

body.library-entry-active .left-panel-body {
  gap: 12px;
}

.filter-group {
  display: grid;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid #edf1f5;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 250, 252, 0.96) 100%);
}

.filter-group-primary {
  border-color: #dbe4ff;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.98) 0%, rgba(255, 255, 255, 0.96) 100%);
  box-shadow: 0 10px 22px rgba(59, 130, 246, 0.04);
}

body.library-entry-active .filter-group-primary {
  padding: 13px 14px;
  border-color: #cfe0ff;
  box-shadow: 0 14px 28px rgba(59, 130, 246, 0.05);
}

.filter-group-secondary {
  background: linear-gradient(180deg, rgba(250, 251, 253, 0.94) 0%, rgba(255, 255, 255, 0.94) 100%);
  padding: 10px 12px;
  gap: 8px;
}

#view-library.library-left-collapsed .library-dashboard,
#view-sep.sep-left-collapsed .library-dashboard,
#view-coexist.coexist-left-collapsed .library-dashboard,
#view-evolution.graph-left-collapsed .evolution-dashboard {
  grid-template-columns: 58px minmax(0, 1fr) 232px;
}

#view-library.library-right-collapsed .library-dashboard,
#view-sep.sep-right-collapsed .library-dashboard,
#view-coexist.coexist-right-collapsed .library-dashboard,
#view-evolution.graph-right-collapsed .evolution-dashboard {
  grid-template-columns: 280px minmax(0, 1fr) 58px;
}

#view-library.library-left-collapsed.library-right-collapsed .library-dashboard,
#view-sep.sep-left-collapsed.sep-right-collapsed .library-dashboard,
#view-coexist.coexist-left-collapsed.coexist-right-collapsed .library-dashboard,
#view-evolution.graph-left-collapsed.graph-right-collapsed .evolution-dashboard {
  grid-template-columns: 58px minmax(0, 1fr) 58px;
}

#view-library.library-left-collapsed .dashboard-left,
#view-library.library-right-collapsed .dashboard-right,
#view-sep.sep-left-collapsed .dashboard-left,
#view-sep.sep-right-collapsed .dashboard-right,
#view-coexist.coexist-left-collapsed .dashboard-left,
#view-coexist.coexist-right-collapsed .dashboard-right,
#view-evolution.graph-left-collapsed .dashboard-left,
#view-evolution.graph-right-collapsed .dashboard-right {
  padding: 14px 10px;
}

#view-library.library-left-collapsed .dashboard-left .panel-head,
#view-library.library-left-collapsed .dashboard-left .left-panel-body,
#view-library.library-right-collapsed .dashboard-right .panel-head,
#view-library.library-right-collapsed .dashboard-right .right-panel-body,
#view-sep.sep-left-collapsed .dashboard-left .panel-head,
#view-sep.sep-left-collapsed .dashboard-left .left-panel-body,
#view-sep.sep-right-collapsed .dashboard-right .panel-head,
#view-sep.sep-right-collapsed .dashboard-right .right-panel-body,
#view-coexist.coexist-left-collapsed .dashboard-left .panel-head,
#view-coexist.coexist-left-collapsed .dashboard-left .left-panel-body,
#view-coexist.coexist-right-collapsed .dashboard-right .panel-head,
#view-coexist.coexist-right-collapsed .dashboard-right .right-panel-body,
#view-evolution.graph-left-collapsed .dashboard-left .panel-head,
#view-evolution.graph-left-collapsed .dashboard-left .left-panel-body,
#view-evolution.graph-right-collapsed .dashboard-right .panel-head,
#view-evolution.graph-right-collapsed .dashboard-right .right-panel-body {
  display: none;
}

#view-library.library-left-collapsed .sidebar-handle-left,
#view-sep.sep-left-collapsed .sidebar-handle-left,
#view-coexist.coexist-left-collapsed .sidebar-handle-left,
#view-evolution.graph-left-collapsed .sidebar-handle-left {
  right: 12px;
}

#view-library.library-right-collapsed .sidebar-handle-right,
#view-sep.sep-right-collapsed .sidebar-handle-right,
#view-coexist.coexist-right-collapsed .sidebar-handle-right,
#view-evolution.graph-right-collapsed .sidebar-handle-right {
  left: 12px;
}

#view-research .research-side-panel {
  position: relative;
  overflow: visible;
}

#view-research .research-main {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(252, 253, 255, 0.99) 100%);
  border-radius: 20px;
  padding: 18px;
}

#view-research.research-left-collapsed .research-shell {
  grid-template-columns: 0 minmax(0, 1fr);
  gap: 0;
}

#view-research.research-left-collapsed .research-side-panel {
  width: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#view-research.research-left-collapsed .research-side-panel .panel-head,
#view-research.research-left-collapsed .research-side-panel .sidebar-scroll {
  display: none;
}

#view-research.research-left-collapsed #research-left-sidebar-toggle {
  position: absolute;
  top: 16px;
  left: 14px;
  right: auto;
  z-index: 3;
}

.filter-group-collapsible {
  gap: 0;
}

.filter-group-collapsible > .filter-group-head {
  cursor: pointer;
  list-style: none;
}

.filter-group-collapsible > .filter-group-head::-webkit-details-marker {
  display: none;
}

.filter-group-collapsible > .filter-group-head::after {
  content: "+";
  margin-left: auto;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
}

.filter-group-collapsible[open] > .filter-group-head::after {
  content: "−";
}

.filter-group-collapsible-body {
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.filter-group-head {
  display: grid;
  gap: 4px;
}

.filter-group-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
}

.filter-group-head strong {
  color: #1f2937;
  font-size: 13px;
}

.filter-group-primary .filter-group-head strong {
  color: #1d4ed8;
}

.filter-group-secondary .filter-group-step {
  background: #f1f5f9;
  color: #64748b;
}

.filter-group-head p {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
}

body.library-entry-active .filter-group-head {
  gap: 5px;
}

body.library-entry-active .filter-group-head strong {
  font-size: 14px;
}

body.library-entry-active .filter-group-head p {
  color: #64748b;
  line-height: 1.5;
}

body.library-entry-active #view-library .dashboard-left {
  background: linear-gradient(180deg, rgba(245, 248, 252, 0.98) 0%, rgba(239, 243, 248, 0.98) 100%);
}

.filter-group-advanced {
  display: grid;
  gap: 9px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 9px;
}

.filter-group-advanced summary {
  cursor: pointer;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
}

.filter-group-advanced summary::-webkit-details-marker {
  display: none;
}

.filter-group-advanced summary::before {
  content: "+";
  margin-right: 8px;
  color: #94a3b8;
}

.filter-group-advanced[open] summary::before {
  content: "−";
}

.filter-group-advanced-body {
  display: grid;
  gap: 9px;
}

.stack-field span {
  color: #64748b;
  font-weight: 650;
}

.left-panel-body input,
.left-panel-body select {
  background: #fbfcfe;
}

body.library-entry-active .left-panel-body .stack-field > span {
  font-size: 12px;
  color: #475569;
}

body.library-entry-active .left-panel-body input,
body.library-entry-active .left-panel-body select {
  min-height: 46px;
  padding: 11px 13px;
  border-color: #dbe4ff;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

body.library-entry-active #q-input {
  min-height: 50px;
  font-size: 15px;
  border-color: #c7d2fe;
  box-shadow: 0 0 0 4px rgba(199, 210, 254, 0.16);
}

body.library-entry-active #domain-select {
  font-size: 15px;
}

body.library-entry-active .field-note {
  font-size: 11px;
  line-height: 1.5;
}

body.library-entry-active .filter-group-advanced summary {
  color: #475569;
}

.left-panel-summary {
  padding-top: 4px;
}

.result-pill.light-pill {
  background: #f8fafc;
}

.main-toolbar {
  gap: 12px;
}

.main-tabs {
  align-items: center;
}

.library-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.library-quick-filter-group {
  display: grid;
  gap: 8px;
}

.administrative-subfilters {
  display: grid;
  gap: 6px;
}

.composite-overview-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #ddd6fe;
  background: linear-gradient(180deg, #faf5ff 0%, #f5f3ff 100%);
}

.composite-overview-head {
  display: grid;
  gap: 2px;
}

.composite-overview-head span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7c3aed;
}

.composite-overview-head strong {
  color: #4c1d95;
  font-size: 14px;
}

.composite-overview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.composite-overview-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(196, 181, 253, 0.9);
  color: #5b21b6;
  font-size: 12px;
}

.composite-overview-meta em {
  font-style: normal;
  margin-right: 6px;
  opacity: 0.72;
}

.composite-overview-card p {
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.7;
}

.composite-overview-role-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.composite-role-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px dashed rgba(167, 139, 250, 0.8);
  color: #6d28d9;
  font-size: 12px;
  box-shadow: none;
}

.composite-role-chip.active,
.composite-role-chip:hover {
  background: rgba(255, 255, 255, 0.92);
  border-style: solid;
  border-color: rgba(139, 92, 246, 0.9);
  color: #4c1d95;
}

.composite-role-chip em {
  font-style: normal;
  margin-right: 6px;
  opacity: 0.72;
}

.administrative-subfilters-label {
  font-size: 11px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.subfilter-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: #64748b;
}

.source-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-type-chip {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #dbe4ff;
  background: #fff;
  color: #64748b;
  box-shadow: none;
}

.source-type-chip span {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.78;
}

.source-type-chip.active.is-guiding {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #312e81;
}

.source-type-chip.active.is-reference {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.source-type-badge.is-guiding {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #312e81;
}

.source-type-badge.is-reference {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.administrative-subfilters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.administrative-subfilter-chip {
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.administrative-subfilter-chip.active,
.administrative-subfilter-chip:hover {
  background: #ffedd5;
  border-color: #fb923c;
  color: #7c2d12;
}

.administrative-subfilter-chip span {
  font-size: 11px;
  font-weight: 700;
  color: inherit;
  opacity: 0.78;
}

.administrative-subfilter-chip:disabled,
.administrative-subfilter-chip.is-unavailable {
  background: #fffaf5;
  border-color: #fed7aa;
  color: #c2410c;
  opacity: 0.46;
  cursor: not-allowed;
}

.quick-filter-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: #64748b;
}

.library-topic-chip {
  border-radius: 999px;
  padding: 8px 12px;
  background: #f8fafc;
  color: #475569;
  box-shadow: none;
}

.library-topic-chip.active,
.library-topic-chip:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #312e81;
}

.library-topic-chip:disabled,
.library-topic-chip.is-unavailable {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.56;
}

.library-topic-chip:hover:disabled {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
}

.search-meta-item.secondary-domain,
.badge-secondary-domain {
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.2);
}

.search-meta-item.admin-subtype,
.badge-admin-subtype {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
}

.search-meta-item.civil-composite,
.badge-civil-composite {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.search-meta-item.civil-composite-role.is-primary {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.search-meta-item.civil-composite-role.is-secondary {
  background: #ecfeff;
  color: #0f766e;
  border-color: #99f6e4;
}

.search-meta-item.civil-composite-role.is-neutral {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

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

.related-case-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
  display: grid;
  gap: 10px;
}

.related-case-card strong {
  font-size: 14px;
  line-height: 1.6;
  color: #122031;
}

.related-case-role {
  display: flex;
}

.related-case-role span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.related-case-card p {
  margin: 0;
  color: #5b6b82;
  font-size: 13px;
}

.related-case-reason {
  color: #6d28d9;
  font-weight: 600;
}

.related-case-insight {
  color: #475569;
}

.related-case-composite {
  color: #6d28d9;
}

.search-meta-item.primary-domain,
.badge-primary-domain {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.main-stats {
  grid-template-columns: minmax(0, 240px);
}

.surface-switch {
  display: inline-flex;
  gap: 8px;
}

.surface-tab {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #475569;
  box-shadow: none;
}

.surface-tab.active {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #312e81;
}

.surface-tab:disabled {
  opacity: 0.42;
  cursor: default;
}

.surface-tab:hover:disabled {
  transform: none;
  box-shadow: none;
}

.stat-card {
  border-radius: 12px;
  background: #fbfcfe;
}

.stat-card span {
  color: #64748b;
}

.library-workbench-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #dbe4ff;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f7ff 100%);
}

.library-workbench-copy {
  display: grid;
  gap: 4px;
}

.library-workbench-copy strong {
  color: #1e293b;
  font-size: 14px;
}

.library-workbench-copy span,
.workbench-recent-text {
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
}

.library-workbench-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workbench-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  font-size: 12px;
}

.main-worksurface {
  grid-template-columns: 1fr;
}

.result-panel,
.detail-panel {
  border-radius: 18px;
}

.detail-head {
  margin-bottom: 12px;
}

.result-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.detail-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 248, 252, 0.98) 100%);
}

.result-panel .panel-head,
.detail-panel .panel-head {
  border-bottom-color: #eef2f7;
}

.case-list {
  gap: 8px;
}

.case-item {
  padding: 16px 14px;
  border-top: 0;
  border-radius: 14px;
  border: 1px solid #edf1f5;
  background: #fff;
}

.case-item.first-look {
  border-color: #dbe7ff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.06);
}

.case-item:hover {
  background: #f8fafc;
}

.case-item.active,
.folder-item.active,
.card-item.active {
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.62) 0%, rgba(248, 250, 252, 1) 100%);
}

.case-item.active::before,
.folder-item.active::before,
.card-item.active::before {
  background: #4f46e5;
}

.result-row h4 {
  font-size: 17px;
  line-height: 1.55;
  color: #1d4ed8;
}

.result-first-look {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef4ff;
  border: 1px solid #dbe7ff;
  color: #3158a3;
  font-size: 11px;
  font-weight: 700;
}

.case-core-facts {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.case-core-facts-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}

.case-core-facts-inline span {
  position: relative;
}

.case-core-facts-inline span + span::before {
  content: "·";
  margin-right: 10px;
  color: #cbd5e1;
}

.case-core-facts span,
.search-facts-line span {
  color: #334155;
  font-size: 13px;
  line-height: 1.7;
}

.case-core-facts em,
.search-facts-line em {
  font-style: normal;
  color: #94a3b8;
  margin-right: 8px;
}

.search-meta-line,
.search-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.search-badge-row {
  margin-top: 8px;
}

.search-meta-line-priority {
  margin-top: 8px;
  gap: 6px;
}

.search-meta-line-support {
  margin-top: 10px;
}

.search-meta-line-support-minimal {
  margin-top: 8px;
}

.search-meta-item,
.search-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.search-meta-item {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.search-meta-item em,
.badge em {
  font-style: normal;
  margin-right: 6px;
  opacity: 0.72;
}

.search-meta-item.doc-ready {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.search-meta-item.doc-empty {
  background: #fbfcfe;
  border-color: #edf2f7;
  color: #94a3b8;
}

.search-meta-item.sample-warning {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.search-meta-line-support-minimal .search-meta-item {
  min-height: 24px;
  padding: 3px 9px;
  font-size: 11px;
}

.search-badge {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.graph-role-badge {
  background: #f8fafc;
  color: #475569;
  border-color: #dbe4ff;
}

.search-meta-item.graph-hit-badge {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.search-meta-item.graph-hit-origin {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

.search-meta-item.graph-hit-latest,
.search-meta-item.graph-hit-turning {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.search-snippet {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.search-snippet-compact {
  margin-top: 10px;
}

.search-snippet-compact p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.search-snippet-compact .snippet-label {
  flex: 0 0 auto;
  margin-top: 1px;
}

.search-snippet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.snippet-label {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.snippet-label.is-match {
  background: #eff6ff;
  color: #1d4ed8;
}

.snippet-source {
  color: #94a3b8;
  font-size: 12px;
}

.search-snippet p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.75;
}

.search-conclusion-line {
  margin-top: 10px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.72;
}

.search-conclusion-line em {
  font-style: normal;
  color: #94a3b8;
  margin-right: 8px;
  font-weight: 700;
}

.composite-compact-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #faf5ff 100%);
  border: 1px solid #dbeafe;
  color: #475569;
  font-size: 12px;
  line-height: 1.7;
}

.composite-role-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1.7;
}

.case-item mark {
  background: #fef3c7;
  color: #92400e;
  padding: 0 2px;
  border-radius: 4px;
}

.case-detail mark {
  background: #fef3c7;
  color: #92400e;
  padding: 0 2px;
  border-radius: 4px;
}

.holding-line {
  color: #475569;
  line-height: 1.72;
  margin-top: 12px;
}

.search-facts-line {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}

.case-actions {
  margin-top: 14px;
}

.case-actions button {
  min-height: 38px;
  border-radius: 10px;
}

.detail-intro {
  display: grid;
  gap: 12px;
}

.detail-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-workspace-bar {
  margin: 16px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #dbe4ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8faff 0%, #f2f6ff 100%);
}

.detail-workspace-bar-compact {
  margin: 10px 0 16px;
  padding: 12px 14px;
}

.workspace-bar-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workspace-bar-copy strong {
  font-size: 14px;
  color: #1e293b;
}

.workspace-bar-copy span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
}

.workspace-bar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace-bar-actions button {
  min-height: 40px;
  border-radius: 10px;
}

.workspace-bar-actions .is-added {
  background: linear-gradient(180deg, #eef2ff 0%, #dfe7ff 100%);
  color: #312e81;
  border-color: #c7d2fe;
}

.detail-kicker {
  color: #64748b;
}

.detail-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.detail-state-pill.active {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
}

.detail-state-pill.warning {
  border-color: #fdba74;
  background: #fff7ed;
  color: #c2410c;
}

.detail-reading-badge.is-guiding {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #312e81;
}

.detail-reading-badge.is-reference {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.sample-alert {
  margin: 14px 0 0;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid #fdba74;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf3 0%, #fff7ed 100%);
}

.sample-alert strong {
  color: #9a3412;
  font-size: 14px;
}

.sample-alert span {
  color: #9a3412;
  font-size: 12px;
  line-height: 1.7;
}

.detail-graph-link {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f8ff 100%);
}

.detail-graph-link strong {
  color: #1d4ed8;
  font-size: 13px;
}

.detail-graph-link span {
  color: #475569;
  font-size: 12px;
  line-height: 1.7;
}

.detail-section-note {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
}

.case-detail h3 {
  font-size: 20px;
  line-height: 1.65;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  border-radius: 999px;
  padding: 6px 10px;
}

.detail-overview-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 2px 0 2px;
}

.detail-overview-strip span {
  color: #475569;
  font-size: 12px;
  line-height: 1.7;
}

.detail-overview-strip em {
  font-style: normal;
  color: #94a3b8;
  margin-right: 8px;
}

.detail-overview-reading {
  color: #64748b;
}

.detail-overview-reading.is-guiding em {
  color: #a16207;
}

.detail-highlight-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid #e6ebf2;
  background: linear-gradient(180deg, #fffdf8 0%, #fffaf0 100%);
}

.detail-highlight-card span {
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
}

.detail-highlight-card strong {
  color: #1f2937;
  font-size: 14px;
  line-height: 1.9;
}

.detail-highlight-card p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.75;
}

.inline-toolbar {
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr) auto;
  align-items: stretch;
}

.detail-section {
  background: rgba(255, 255, 255, 0.86);
  width: 100%;
  border: 1px solid #edf1f5;
}

.detail-section h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.detail-section pre {
  line-height: 1.8;
  width: 100%;
  max-width: none;
}

.detail-richtext {
  width: 100%;
  max-width: none;
}

.detail-richtext p {
  margin: 0;
  line-height: 1.9;
  width: 100%;
  max-width: none;
}

.detail-laws {
  width: 100%;
  max-width: none;
}

.detail-law-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: flex-start;
}

.detail-law-item {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 1320px) {
  .research-overview-strip {
    grid-template-columns: 1fr;
  }

  .detail-workspace-bar,
  .inline-toolbar {
    grid-template-columns: 1fr;
  }

  .workspace-bar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 960px) {
  .library-workbench-strip,
  .detail-overview-grid,
  .detail-workspace-bar {
    grid-template-columns: 1fr;
  }

  .library-workbench-status {
    justify-content: flex-start;
  }
}

.utility-block {
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.utility-block-head h4 {
  color: #0f172a;
}

.utility-link {
  min-height: 46px;
  background: #fbfcfe;
  font-weight: 650;
}

.utility-link:hover {
  background: #f8fafc;
}

.utility-link:disabled,
.topbar-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background: #f8fafc;
  color: #94a3b8;
}

.utility-link::after {
  content: "→";
  font-size: 16px;
}

.utility-link:disabled::after {
  content: "受限";
  font-size: 12px;
}

.premium-link {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #f8faff 0%, #eef2ff 100%);
}

.premium-link::before {
  content: "PRO";
  margin-right: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #4338ca;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.workspace-note {
  background: linear-gradient(180deg, #fcfcff 0%, #f6f7ff 100%);
  border-color: #dbe4ff;
}

.workspace-note-list {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  font-size: 12px;
  line-height: 1.7;
}

.workspace-note-list li + li {
  margin-top: 6px;
}

.dashboard-right {
  opacity: 0.98;
}

.dashboard-right .panel-head,
.dashboard-right .utility-block {
  background: rgba(255, 255, 255, 0.94);
}

.dashboard-right {
  padding: 14px;
}

.dashboard-right .panel-head {
  padding-bottom: 10px;
}

.dashboard-right .panel-subhead {
  max-width: 18ch;
}

.right-panel-body {
  gap: 12px;
}

.utility-block {
  padding: 12px;
}

.utility-block-head {
  gap: 8px;
}

.utility-block-head h4 {
  font-size: 13px;
}

.utility-actions {
  gap: 8px;
}

.utility-link {
  min-height: 42px;
  padding: 10px 12px;
  font-size: 13px;
}

.dock-actions {
  gap: 8px;
}

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

.workspace-note-list {
  font-size: 11px;
  line-height: 1.6;
}

.subscribe-shell {
  display: block;
}

.subscribe-main {
  width: 100%;
}

.subscribe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.subscribe-card {
  display: grid;
  gap: 14px;
}

.subscribe-card.pro {
  border-color: #c7d2fe;
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.08);
}

.subscribe-price {
  font-size: 34px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.subscribe-price span {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
}

.subscribe-list {
  font-size: 13px;
}

.subscribe-actions {
  justify-content: flex-start;
}

.subscribe-panel {
  display: grid;
  gap: 14px;
}

.account-grid {
  margin-bottom: 18px;
}

.account-meta-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.account-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.capability-panel {
  display: grid;
  gap: 12px;
}

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

.capability-block {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  gap: 10px;
}

.capability-block.is-allowed {
  border-color: #bfdbfe;
  background: rgba(239, 246, 255, 0.88);
}

.capability-block.is-limited {
  border-color: #fde68a;
  background: rgba(255, 251, 235, 0.92);
}

.capability-block.is-backstage {
  border-color: #c7d2fe;
  background: rgba(238, 242, 255, 0.9);
}

.capability-block h4 {
  margin: 0;
  font-size: 15px;
}

.capability-block p {
  margin: 0;
  font-size: 13px;
  color: #526075;
  line-height: 1.7;
}

.access-tip {
  margin: 0;
  color: #526075;
}

.capability-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
}

/* 用户中心页面样式 */
.user-center-page {
  background: var(--bg);
  min-height: calc(100vh - 104px);
}

.user-center-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px;
}

/* Hero区域 */
.user-center-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border: 1px solid var(--line);
}

.user-center-hero .page-kicker {
  font-size: var(--font-sm);
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px 0;
}

.user-center-hero h2 {
  font-size: var(--font-2xl);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
}

.user-center-hero .page-desc {
  font-size: var(--font-base);
  color: var(--text-soft);
  line-height: var(--line-height-base);
  margin: 0;
  max-width: 500px;
}

.user-center-hero-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.user-center-hero-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  color: var(--text-soft);
}

.user-center-hero-summary strong {
  color: var(--accent);
  font-weight: 600;
}

/* 账号概览网格 */
.account-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* 账号状态卡片 */
.account-status-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 20px;
}

.account-status-card .panel-head {
  margin-bottom: 20px;
}

.account-status-card .panel-head h3 {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
}

.account-status-card .panel-head .panel-subhead {
  font-size: var(--font-sm);
  color: var(--text-soft);
  margin: 0;
}

.account-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.account-info-grid .report-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
}

.account-info-grid .report-meta-item span {
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.account-info-grid .report-meta-item strong {
  font-size: var(--font-base);
  color: var(--text);
  font-weight: 500;
}

/* 账号通知 */
.account-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--accent-quiet);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 16px;
}

.account-notice span {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.account-notice strong {
  font-size: var(--font-sm);
  color: var(--text);
  font-weight: 400;
}

/* 账号状态标签 */
.account-status-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.account-status-tags span {
  padding: 4px 10px;
  background: var(--surface-soft);
  border-radius: var(--radius-xs);
  font-size: var(--font-sm);
  color: var(--text-soft);
}

.account-status-tags span:first-child {
  background: var(--accent-soft);
  color: var(--accent);
}

/* 资产概览卡片 */
.asset-overview-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 20px;
}

.asset-overview-card .panel-head {
  margin-bottom: 20px;
}

.asset-overview-card .panel-head h3 {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
}

.asset-overview-card .panel-head .panel-subhead {
  font-size: var(--font-sm);
  color: var(--text-soft);
  margin: 0;
}

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

.asset-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all 0.2s ease;
}

.asset-stat-card:hover {
  background: var(--accent-quiet);
}

.asset-stat-card span {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-bottom: 8px;
}

.asset-stat-card strong {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.2;
}

.asset-stat-card em {
  font-size: var(--font-sm);
  color: var(--text-soft);
  font-style: normal;
}

.asset-stat-card.is-workbench {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}

.asset-stat-card.is-workbench strong {
  color: var(--accent);
}

/* 快捷入口区域 */
.quick-entry-section {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 20px;
  margin-bottom: 24px;
}

.quick-entry-section .panel-head {
  margin-bottom: 12px;
}

.quick-entry-section .panel-head h3 {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
}

.quick-entry-section .panel-head .panel-subhead {
  font-size: var(--font-sm);
  color: var(--text-soft);
  margin: 0;
}

.quick-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.quick-entry-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.quick-entry-card:hover {
  border-color: var(--accent);
  background: var(--accent-quiet);
  transform: translateY(-1px);
}

.quick-entry-card.is-primary {
  background: var(--accent);
  border-color: var(--accent);
}

.quick-entry-card.is-primary strong,
.quick-entry-card.is-primary span {
  color: #fff;
}

.quick-entry-card.is-primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.quick-entry-card strong {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.quick-entry-card span {
  font-size: var(--font-sm);
  color: var(--text-soft);
}

.quick-entry-card:disabled,
.quick-entry-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 能力区域 */
.capability-section {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 20px;
  margin-bottom: 24px;
}

.capability-section .panel-head {
  margin-bottom: 16px;
}

.capability-section .panel-head h3 {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
}

.capability-section .panel-head .panel-subhead {
  font-size: var(--font-sm);
  color: var(--text-soft);
  margin: 0;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.capability-card {
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.capability-card.is-allowed {
  background: rgba(239, 246, 255, 0.9);
  border: 1px solid rgba(22, 93, 255, 0.2);
}

.capability-card.is-limited {
  background: rgba(255, 251, 235, 0.9);
  border: 1px solid rgba(250, 173, 20, 0.2);
}

.capability-card.is-backstage {
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.capability-card h4 {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.capability-card h4::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.capability-card.is-allowed h4::before {
  background: var(--success);
}

.capability-card.is-limited h4::before {
  background: var(--warn);
}

.capability-card.is-backstage h4::before {
  background: var(--text-muted);
}

.capability-card .capability-list {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: var(--font-sm);
}

.capability-card .capability-list li {
  line-height: 1.6;
}

/* 响应式 */
@media (max-width: 1200px) {
  .user-center-container {
    padding: 20px;
  }
  
  .asset-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .quick-entry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .user-center-hero {
    flex-direction: column;
    gap: 16px;
  }
  
  .user-center-hero-summary {
    justify-content: flex-start;
  }
  
  .account-overview-grid {
    grid-template-columns: 1fr;
  }
  
  .account-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .user-center-container {
    padding: 16px;
  }
  
  .user-center-hero-summary {
    gap: 12px;
  }
  
  .quick-entry-grid {
    grid-template-columns: 1fr;
  }
  
  .capability-grid {
    grid-template-columns: 1fr;
  }
  
  .asset-stat-card strong {
    font-size: 24px;
  }
}

.quality-shell {
  display: grid;
  gap: 18px;
}

.quality-overview-grid,
.quality-bottom-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

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

.quality-score-pill {
  border: 1px solid #d7deea;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  background: #f8fafc;
}

.quality-list-wrap {
  min-height: 120px;
}

.quality-credibility-summary {
  margin-top: 16px;
}

.quality-credibility-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  display: grid;
  gap: 8px;
}

.quality-credibility-card.is-high {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
}

.quality-credibility-card.is-medium {
  border-color: #cbd5e1;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.quality-credibility-card.is-low {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fffaf9 0%, #fff1f2 100%);
}

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

.quality-credibility-head strong {
  font-size: 15px;
  color: #0f172a;
}

.quality-credibility-score {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e2e8f0;
}

.quality-credibility-card p {
  margin: 0;
  color: #526075;
  line-height: 1.7;
}

.quality-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.quality-list-item {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
}

.quality-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.quality-list-head strong {
  font-size: 15px;
}

.quality-list-meta {
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
}

.quality-list-item p {
  margin: 0;
  color: #64748b;
  line-height: 1.65;
}

.quality-inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 10px;
}

.quality-inline-meta span {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  color: #526075;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.quality-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.quality-item-actions .ghost {
  padding: 8px 12px;
}

.graph-side-list {
  display: grid;
  gap: 8px;
}

.graph-side-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.graph-side-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 4px;
}

.graph-question-card.active {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #f7f9ff 0%, #eef2ff 100%);
}

.graph-question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.graph-question-meta span {
  display: inline-flex;
  align-items: center;
}

.graph-problem-block {
  margin-bottom: 22px;
  padding-bottom: 6px;
}

.graph-current-problem,
.graph-problem-card {
  display: grid;
  gap: 12px;
}

.graph-problem-card {
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.graph-problem-card strong {
  font-size: 18px;
  color: #0f172a;
}

.graph-problem-card p {
  margin: 6px 0 0;
  color: #64748b;
  line-height: 1.7;
}

.graph-problem-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.graph-reading-path {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.graph-reading-path-compact {
  gap: 10px;
  padding: 8px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.graph-problem-brief {
  display: grid;
  gap: 10px;
}

.graph-problem-brief-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.graph-problem-brief-chip {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  color: #475569;
  font-size: 11px;
  line-height: 1.5;
}

.graph-problem-brief-chip em {
  font-style: normal;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
}

.graph-problem-brief-item {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
}

.graph-problem-brief-item strong {
  font-size: 12px;
  color: #334155;
  letter-spacing: 0.02em;
}

.graph-problem-brief-item p {
  margin: 0;
  color: #475569;
  line-height: 1.65;
}

.graph-reading-path strong {
  font-size: 12px;
  color: #334155;
  letter-spacing: 0.02em;
}

.graph-reading-path p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.graph-reading-path-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.graph-problem-actions-compact {
  gap: 8px;
}

.graph-problem-actions-compact .ghost {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}

.graph-reading-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #dbe4ff;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
}

.graph-reading-step em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-style: normal;
  font-weight: 700;
}

.graph-side-item p,
.graph-case-card p,
.graph-timeline-card p {
  margin: 0;
  color: #64748b;
  line-height: 1.6;
}

.graph-side-item span,
.graph-case-card span {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
}

.graph-timeline {
  display: grid;
  gap: 22px;
}

.graph-timeline-horizontal {
  display: grid;
  gap: 20px;
  padding-top: 6px;
}

.graph-stage-band {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.graph-stage-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid #dbe4ff;
  background: linear-gradient(180deg, #f8faff 0%, #eef2ff 100%);
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.graph-timeline-axis {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(112px, 1fr);
  gap: 8px;
  align-items: start;
  overflow-x: auto;
  padding: 12px 2px 14px;
}

.graph-timeline-axis::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 38px;
  height: 2px;
  background: #dbe4ff;
}

.graph-axis-node {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.graph-axis-year {
  position: relative;
  z-index: 1;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.graph-axis-dot {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #4f46e5;
  box-shadow: 0 0 0 5px #eef2ff;
}

.graph-axis-node-origin .graph-axis-dot {
  background: #0f766e;
  box-shadow: 0 0 0 5px #ccfbf1;
}

.graph-axis-node-turning .graph-axis-dot {
  background: #7c3aed;
  box-shadow: 0 0 0 5px #ede9fe;
}

.graph-axis-node-latest .graph-axis-dot {
  background: #c2410c;
  box-shadow: 0 0 0 5px #ffedd5;
}

.graph-axis-keyword {
  position: relative;
  z-index: 1;
  min-height: 40px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.graph-axis-role {
  position: relative;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.graph-axis-node.active .graph-axis-keyword {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #f7f9ff 0%, #eef2ff 100%);
  color: #3730a3;
}

.graph-axis-node.active .graph-axis-dot {
  background: #3730a3;
  box-shadow: 0 0 0 5px #e0e7ff;
}

.graph-axis-node-origin .graph-axis-keyword {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.graph-axis-node-turning .graph-axis-keyword {
  border-color: #ddd6fe;
  background: #faf5ff;
}

.graph-axis-node-latest .graph-axis-keyword {
  border-color: #fdba74;
  background: #fff7ed;
}

.graph-axis-role-origin {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #0f766e;
}

.graph-axis-role-turning {
  background: #faf5ff;
  border-color: #ddd6fe;
  color: #7c3aed;
}

.graph-axis-role-latest {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.graph-timeline-detail {
  display: grid;
}

.graph-timeline-card,
.graph-case-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
}

.graph-timeline-card-story {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.035);
}

.graph-delta-block {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fbfdff;
}

.graph-delta-block-compact {
  gap: 4px;
  padding: 8px 10px;
}

.graph-delta-block strong {
  font-size: 12px;
  color: #334155;
  letter-spacing: 0.02em;
}

.graph-delta-subtle {
  background: #f8fafc;
}

.graph-delta-why {
  background: #fffdf6;
  border-color: #fde68a;
}

.graph-delta-block p {
  color: #334155;
  line-height: 1.75;
}

.graph-delta-block-compact p {
  font-size: 13px;
  line-height: 1.65;
}

.graph-timeline-card h4,
.graph-case-card strong {
  margin: 8px 0;
  font-size: 17px;
}

.graph-case-card strong {
  margin-bottom: 4px;
}

.graph-case-hint {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.65;
}

.graph-case-meta,
.graph-context-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.graph-case-meta span,
.graph-context-summary span {
  display: inline-flex;
  align-items: center;
}

.graph-context-line {
  margin-bottom: 8px !important;
  color: #475569 !important;
  font-size: 13px;
}

.graph-timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.graph-timeline-role {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

.graph-timeline-role-origin {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #0f766e;
}

.graph-timeline-role-turning {
  background: #faf5ff;
  border-color: #ddd6fe;
  color: #7c3aed;
}

.graph-timeline-role-latest {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.graph-shift-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #dbe4ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
}

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

.graph-context-panel {
  display: grid;
  gap: 10px;
}

.graph-context-card {
  display: grid;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
}

.graph-context-head {
  display: grid;
  gap: 4px;
}

.graph-context-head strong {
  font-size: 16px;
  color: #0f172a;
}

.graph-context-head span {
  color: #64748b;
  font-size: 12px;
}

.graph-context-section {
  display: grid;
  gap: 6px;
}

.graph-context-section h5 {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.graph-context-list {
  display: grid;
  gap: 6px;
}

.graph-context-row {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fafcff;
}

.graph-context-row strong {
  font-size: 13px;
  color: #0f172a;
}

.graph-context-row span {
  color: #64748b;
  font-size: 12px;
}

.graph-case-actions-compact {
  gap: 8px;
}

.graph-case-actions-compact button {
  padding: 8px 12px;
}

.graph-case-actions-compact button.ghost {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}

.graph-context-section-compact {
  margin-top: -2px;
}

#view-evolution .dashboard-main {
  background:
    radial-gradient(circle at top right, rgba(79, 70, 229, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 255, 0.98) 100%);
}

#view-evolution .dashboard-main > .panel-head {
  padding: 16px 16px 14px;
  border: 1px solid #dbe4ff;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 248, 255, 0.98) 100%);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.05);
  margin-bottom: 12px;
}

#view-evolution .dashboard-main > .panel-head h3 {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

#view-evolution .dashboard-main > .panel-head .panel-subhead {
  max-width: 52ch;
  line-height: 1.65;
}

#view-evolution #graph-topic-stats {
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#view-evolution #graph-topic-stats .report-meta-item {
  border-color: #dbe4ff;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.04);
  padding: 10px 12px;
  border-radius: 12px;
  gap: 6px;
}

#view-evolution #graph-topic-stats .report-meta-item span {
  font-size: 10px;
  color: #64748b;
}

#view-evolution #graph-topic-stats .report-meta-item strong {
  font-size: 15px;
  line-height: 1.35;
  color: #0f172a;
  overflow-wrap: anywhere;
}

#view-evolution #graph-topic-stats .report-meta-item:nth-child(1) {
  background: linear-gradient(180deg, #f8fbff 0%, #eef2ff 100%);
}

#view-evolution #graph-topic-stats .report-meta-item:nth-child(2) {
  background: linear-gradient(180deg, #fbfcff 0%, #f5f3ff 100%);
}

#view-evolution #graph-topic-stats .report-meta-item:nth-child(3) {
  background: linear-gradient(180deg, #ffffff 0%, #ecfeff 100%);
}

#view-evolution #graph-topic-stats .report-meta-item:nth-child(4) {
  background: linear-gradient(180deg, #fffdf7 0%, #fff7ed 100%);
}

#view-evolution .graph-problem-block {
  padding: 14px 14px 12px;
  border-radius: 18px;
  border-color: #dbe4ff;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.04);
}

#view-evolution .graph-current-problem {
  gap: 0;
}

#view-evolution .graph-problem-card {
  border-left: 4px solid #4f46e5;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

#view-evolution .graph-problem-meta .search-meta-item {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

#view-evolution .graph-timeline-horizontal {
  padding: 14px 12px 12px;
  border: 1px solid #dbe4ff;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 255, 0.98) 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.045);
}

#view-evolution .graph-stage-band {
  gap: 6px;
}

#view-evolution .graph-stage-chip {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 650;
  box-shadow: none;
}

#view-evolution .graph-stage-chip.stage-emergence {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #bfdbfe;
  color: #1d4ed8;
}

#view-evolution .graph-stage-chip.stage-establishment {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  border-color: #cbd5e1;
  color: #334155;
}

#view-evolution .graph-stage-chip.stage-expansion {
  background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%);
  border-color: #ddd6fe;
  color: #6d28d9;
}

#view-evolution .graph-stage-chip.stage-divergence {
  background: linear-gradient(180deg, #fdf2f8 0%, #fce7f3 100%);
  border-color: #fbcfe8;
  color: #be185d;
}

#view-evolution .graph-stage-chip.stage-contraction {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fed7aa;
  color: #c2410c;
}

#view-evolution .graph-stage-chip.stage-stable {
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #a7f3d0;
  color: #047857;
}

#view-evolution .graph-timeline-axis {
  padding: 12px 6px 16px;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.9) 0%, rgba(255, 255, 255, 0.96) 100%);
  border-radius: 18px;
  border: 1px solid #e2e8f0;
}

#view-evolution .graph-timeline-axis::before {
  top: 40px;
  background: linear-gradient(90deg, #c7d2fe 0%, #cbd5e1 50%, #fdba74 100%);
}

#view-evolution .graph-axis-node {
  gap: 8px;
  padding-bottom: 2px;
  transition: transform 0.18s ease, filter 0.18s ease;
}

#view-evolution .graph-axis-node:hover {
  transform: translateY(-2px);
}

#view-evolution .graph-axis-year {
  font-size: 11px;
  color: #64748b;
}

#view-evolution .graph-axis-dot {
  width: 12px;
  height: 12px;
}

#view-evolution .graph-axis-keyword {
  min-height: 36px;
  padding: 7px 8px;
  font-size: 10px;
  line-height: 1.35;
  color: #475569;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025);
}

#view-evolution .graph-axis-node.active .graph-axis-keyword {
  color: #312e81;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.1);
}

#view-evolution .graph-axis-role {
  padding: 2px 7px;
  font-size: 10px;
  opacity: 0.72;
}

#view-evolution .graph-axis-node.active .graph-axis-role {
  opacity: 1;
}

#view-evolution .graph-timeline-detail {
  margin-top: 2px;
}

#view-evolution .graph-timeline-card-story {
  border-color: #dbe4ff;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

#view-evolution .graph-timeline-card-story h4 {
  font-size: 18px;
  line-height: 1.45;
}

#view-evolution .graph-case-card {
  border-color: #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#view-evolution .graph-case-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  border-color: #c7d2fe;
}

#view-evolution .graph-context-card {
  border-color: #dbe4ff;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

#view-evolution .graph-context-row {
  background: #ffffff;
}

#view-evolution .graph-context-head strong {
  font-size: 17px;
}

#view-evolution .graph-context-section h5 {
  color: #475569;
}

#view-evolution .graph-sidebar-handle {
  border-color: #c7d2fe;
}

/* Final homepage entry-state overrides */
body.library-entry-active #view-library.view.active {
  width: 100%;
}

body.library-entry-active #view-library .library-dashboard {
  display: block;
  width: 100%;
}

body.library-entry-active #view-library .dashboard-left,
body.library-entry-active #view-library .sidebar-handle-left {
  display: none !important;
}

body.library-entry-active #view-library .dashboard-main {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 12px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.library-entry-active #view-library .main-worksurface.is-entry {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

body.library-entry-active #view-library .main-worksurface.is-entry .result-panel {
  position: relative;
  overflow: hidden;
  width: min(100%, 1520px);
  max-width: none;
  margin: 0 auto;
  min-height: 640px;
  border: 1px solid rgba(147, 123, 86, 0.34);
  background:
    linear-gradient(180deg, rgba(242, 246, 245, 0.34) 0%, rgba(241, 242, 236, 0.42) 24%, rgba(239, 233, 219, 0.58) 46%, rgba(230, 216, 193, 0.82) 70%, rgba(214, 190, 158, 0.96) 100%);
  box-shadow:
    0 34px 58px rgba(84, 59, 30, 0.16),
    0 8px 16px rgba(84, 59, 30, 0.08),
    inset 0 1px 0 rgba(255, 252, 246, 0.74),
    inset 0 -26px 34px rgba(118, 84, 49, 0.1);
  opacity: 1 !important;
  filter: none !important;
}

body.library-entry-active #view-library .main-worksurface.is-entry .result-panel::before,
body.library-entry-active #view-library .main-worksurface.is-entry .result-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0.8;
}

body.library-entry-active #view-library .main-worksurface.is-entry .result-panel::before {
  inset: 16px;
  border-radius: 28px;
  border: 1px solid rgba(255, 247, 234, 0.24);
  box-shadow: inset 0 0 0 1px rgba(124, 90, 57, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 251, 241, 0.14) 0%, transparent 26%),
    repeating-linear-gradient(180deg, rgba(128, 96, 64, 0.03) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(90deg, rgba(151, 118, 83, 0.025) 0 1px, transparent 1px 28px);
}

body.library-entry-active #view-library .main-worksurface.is-entry .result-panel::after {
  left: 48px;
  right: 48px;
  bottom: -56px;
  height: 132px;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at center, rgba(122, 87, 51, 0.18) 0%, rgba(122, 87, 51, 0.08) 44%, transparent 72%);
}

body.library-entry-active #view-library .main-worksurface.is-entry .panel-head {
  display: none !important;
}

body.library-entry-active #view-library .search-empty-guide {
  width: 100%;
  max-width: none;
  padding: 84px 78px 66px;
  background:
    linear-gradient(180deg, rgba(233, 242, 248, 0.22) 0%, rgba(241, 239, 231, 0.14) 34%, rgba(238, 228, 207, 0.12) 56%, rgba(232, 217, 193, 0.16) 68%, transparent 72%);
  opacity: 1 !important;
  filter: none !important;
}

body.library-entry-active #view-library .search-empty-guide::before {
  content: "";
  position: absolute;
  inset: 22px 24px 28px;
  border-radius: 30px;
  border: 1px solid rgba(116, 83, 51, 0.12);
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 249, 237, 0.28) 0%, transparent 52%);
}

body.library-entry-active #view-library .search-empty-guide,
body.library-entry-active #view-library .search-empty-guide * {
  opacity: 1 !important;
  filter: none !important;
}

body.library-entry-active #view-library .entry-search-bar {
  grid-template-columns: minmax(0, 1.9fr) minmax(220px, 0.72fr) auto auto;
  gap: 14px;
  max-width: 1220px;
  align-items: center;
}

body.library-entry-active #view-library .search-empty-guide-copy strong {
  font-size: 44px !important;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-weight: 700;
  color: #2f2316 !important;
  letter-spacing: -0.03em;
  text-shadow: 0 1px 0 rgba(255, 248, 236, 0.66);
  opacity: 1 !important;
}

body.library-entry-active #view-library .entry-search-field input,
body.library-entry-active #view-library .entry-search-field select {
  min-height: 62px;
  border: 1px solid rgba(145, 113, 79, 0.26);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(250, 245, 236, 0.96) 0%, rgba(244, 235, 219, 0.96) 100%) !important;
  color: #2f2418 !important;
  box-shadow:
    inset 0 2px 4px rgba(132, 98, 64, 0.08),
    0 8px 18px rgba(120, 91, 58, 0.08);
  opacity: 1 !important;
}

body.library-entry-active #view-library .entry-search-field input::placeholder {
  color: #8d7456 !important;
  opacity: 1;
}

body.library-entry-active #view-library .search-empty-guide-actions {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: stretch;
  flex-wrap: nowrap;
}

body.library-entry-active #view-library .search-empty-guide-actions button {
  display: inline-flex;
  min-height: 62px;
  min-width: 158px;
  padding: 0 26px;
  border-radius: 18px;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, #7a2a22 0%, #5e1813 100%) !important;
  color: #f9efe2 !important;
  border-color: rgba(94, 24, 19, 0.84);
  box-shadow:
    0 14px 24px rgba(96, 39, 29, 0.22),
    inset 0 1px 0 rgba(255, 228, 209, 0.18);
  opacity: 1 !important;
}

body.library-entry-active #view-library .entry-advanced-inline {
  display: flex;
  width: auto;
  flex: 0 0 auto;
  align-self: stretch;
  justify-self: start;
  margin: 0;
}

body.library-entry-active #view-library .entry-advanced-inline summary {
  min-height: 62px;
  min-width: 158px;
  width: 158px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(145, 113, 79, 0.24);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 240, 225, 0.94) 0%, rgba(241, 230, 210, 0.94) 100%);
  color: #6a5339 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 251, 241, 0.4),
    0 8px 18px rgba(120, 91, 58, 0.08);
  opacity: 1 !important;
  font-weight: 700;
}

body.library-entry-active #view-library .entry-advanced-inline summary::before {
  color: #8f6540;
  margin-right: 6px;
}

body.library-entry-active #view-library .entry-advanced-inline[open] {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  margin-top: 4px;
}

body.library-entry-active #view-library .entry-advanced-inline[open] summary {
  margin-bottom: 10px;
}

body.library-entry-active #view-library .entry-advanced-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.library-entry-active #view-library .search-empty-guide-examples {
  max-width: 1120px;
  margin: 16px auto 0;
  justify-content: center;
  gap: 12px;
}

body.library-entry-active #view-library .search-empty-guide-examples .ghost {
  min-height: 50px;
  padding: 10px 18px;
  border-color: rgba(146, 112, 79, 0.18);
  background:
    linear-gradient(180deg, rgba(249, 241, 227, 0.96) 0%, rgba(242, 231, 209, 0.96) 100%);
  color: #5b4531 !important;
  font-weight: 650;
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 240, 0.44),
    0 8px 18px rgba(120, 91, 58, 0.06);
  opacity: 1 !important;
  border-radius: 12px;
}

body.library-entry-active #view-library .search-empty-guide-examples .ghost:hover {
  border-color: rgba(146, 112, 79, 0.32);
  background: linear-gradient(180deg, rgba(252, 245, 232, 0.98) 0%, rgba(245, 235, 214, 0.98) 100%);
  color: #463120 !important;
}

@media (max-width: 1180px) {
  body.library-entry-active #view-library .entry-search-bar {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  }

  body.library-entry-active #view-library .search-empty-guide-actions {
    grid-column: span 2;
    flex-wrap: wrap;
  }

  body.library-entry-active #view-library .entry-advanced-inline[open] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  body.library-entry-active #view-library .entry-search-bar,
  body.library-entry-active #view-library .entry-advanced-grid {
    grid-template-columns: 1fr;
  }

  body.library-entry-active #view-library .main-worksurface.is-entry .result-panel {
    min-height: 540px;
  }
}

:root {
  --sky-paper: #f3f6f3;
  --earth-paper: #f2e5cc;
  --earth-paper-deep: #e3cfaf;
  --earth-grain: rgba(132, 108, 75, 0.08);
  --board-line: rgba(33, 61, 111, 0.78);
  --board-line-soft: rgba(47, 78, 128, 0.22);
  --board-line-faint: rgba(47, 78, 128, 0.1);
  --board-ink: #223a69;
  --board-ink-soft: #536785;
  --board-shadow: 0 16px 34px rgba(83, 66, 42, 0.08);
}

body {
  background:
    radial-gradient(circle at top center, rgba(225, 236, 246, 0.46) 0%, rgba(225, 236, 246, 0) 28%),
    linear-gradient(180deg, #f7faf8 0%, #f3efe3 26%, #efe3cd 100%);
}

.panel,
.modal-panel {
  border-color: rgba(56, 88, 138, 0.14);
  background:
    linear-gradient(180deg, rgba(250, 251, 247, 0.96) 0%, rgba(246, 241, 229, 0.95) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 28px rgba(99, 81, 53, 0.06);
}

.panel-head,
.result-panel .panel-head,
.detail-panel .panel-head,
.dashboard-left .panel-head,
.dashboard-right .panel-head {
  border-bottom-color: rgba(47, 78, 128, 0.16);
}

.panel-head h3,
.research-workbench-panel .panel-head h3,
.dashboard-main > .panel-head h3,
.dashboard-left .panel-head h3,
.dashboard-right .panel-head h3 {
  color: var(--board-ink);
}

.panel-subhead,
.panel-head span,
.panel-head p,
.result-panel .panel-head span,
.detail-panel .panel-head span {
  color: var(--board-ink-soft);
}

.result-panel,
.detail-panel {
  background:
    linear-gradient(180deg, rgba(250, 251, 247, 0.98) 0%, rgba(245, 239, 227, 0.97) 100%);
}

.case-item,
.detail-highlight-card,
.detail-section,
.compare-column,
.compare-block,
.compare-overview-card,
.related-case-card,
.research-overview-card,
.workbench-case-item,
.detail-workspace-bar,
.detail-graph-link {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(43, 73, 122, 0.26);
  background:
    linear-gradient(180deg, rgba(251, 247, 237, 0.98) 0%, rgba(241, 228, 202, 0.97) 100%),
    repeating-linear-gradient(
      180deg,
      rgba(33, 61, 111, 0.075) 0 1px,
      rgba(33, 61, 111, 0) 1px 42px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 18%, rgba(33, 61, 111, 0.04) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 235, 0.72),
    inset 0 -26px 40px rgba(166, 132, 91, 0.08),
    var(--board-shadow);
}

.case-item::after,
.detail-highlight-card::after,
.detail-section::after,
.compare-column::after,
.compare-block::after,
.compare-overview-card::after,
.related-case-card::after,
.research-overview-card::after,
.workbench-case-item::after,
.detail-workspace-bar::after,
.detail-graph-link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 15px;
  height: 1px;
  background: linear-gradient(90deg, rgba(33, 61, 111, 0.58), rgba(33, 61, 111, 0.18) 72%, rgba(33, 61, 111, 0));
  pointer-events: none;
}

.case-item:hover,
.compare-overview-card:hover,
.research-overview-card:hover,
.workbench-case-item:hover,
.related-case-card:hover {
  background:
    linear-gradient(180deg, rgba(253, 249, 240, 1) 0%, rgba(243, 231, 208, 0.98) 100%),
    repeating-linear-gradient(
      180deg,
      rgba(33, 61, 111, 0.085) 0 1px,
      rgba(33, 61, 111, 0) 1px 40px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 18%, rgba(33, 61, 111, 0.05) 100%);
}

.case-item.active,
.folder-item.active,
.card-item.active {
  background:
    linear-gradient(180deg, rgba(241, 235, 223, 0.98) 0%, rgba(233, 220, 195, 0.98) 100%),
    repeating-linear-gradient(
      180deg,
      rgba(33, 61, 111, 0.09) 0 1px,
      rgba(33, 61, 111, 0) 1px 36px
    );
  border-color: rgba(33, 61, 111, 0.36);
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 240, 0.7),
    inset 0 -20px 34px rgba(109, 91, 68, 0.09),
    0 18px 30px rgba(83, 66, 42, 0.1);
}

.case-item.active::before,
.folder-item.active::before,
.card-item.active::before {
  background: linear-gradient(180deg, rgba(33, 61, 111, 0.96) 0%, rgba(62, 90, 140, 0.9) 100%);
}

.case-item.first-look,
.detail-highlight-card,
.compare-overview-card,
.research-overview-card {
  border-color: rgba(33, 61, 111, 0.34);
}

.result-row h4,
.case-item h4,
.compare-column h3,
.compare-overview-card h3,
.case-detail h3,
.related-case-card strong,
.research-overview-card strong {
  color: var(--board-ink);
}

.case-detail h3 {
  text-shadow: 0 1px 0 rgba(255, 250, 240, 0.42);
}

.result-row-meta,
.detail-kicker-row,
.compare-overview-head,
.compare-column-title-row {
  position: relative;
  z-index: 1;
}

.result-year,
.compare-overview-year,
.detail-kicker,
.snippet-source,
.detail-overview-strip span,
.detail-overview-reading,
.case-core-facts span,
.search-facts-line span,
.search-snippet p,
.detail-richtext p,
.detail-section p,
.detail-section pre,
.compare-block-body,
.compare-block-lead,
.related-case-card p,
.research-overview-card p,
.workspace-bar-copy span,
.detail-section-note,
.compare-source-type-note {
  color: #495a74;
}

.case-core-facts em,
.search-facts-line em,
.detail-overview-strip em,
.search-conclusion-line em {
  color: rgba(34, 58, 105, 0.58);
}

.search-conclusion-line,
.detail-highlight-card strong,
.workspace-bar-copy strong,
.detail-graph-link strong {
  color: #20375f;
}

.search-facts-line,
.compare-block-details,
.compare-column-title-row {
  border-color: rgba(33, 61, 111, 0.18);
}

.search-meta-item,
.search-badge,
.badge,
.detail-state-pill,
.compare-column-kicker,
.compare-overview-label,
.related-case-role span,
.result-first-look,
.snippet-label,
.detail-reading-badge.is-guiding,
.detail-reading-badge.is-reference,
.workbench-count-pill {
  background: rgba(247, 244, 234, 0.92);
  border-color: rgba(47, 78, 128, 0.24);
  color: var(--board-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.snippet-label.is-match,
.detail-state-pill.active,
.search-badge,
.compare-overview-label,
.result-first-look,
.detail-reading-badge.is-guiding {
  background: rgba(232, 238, 247, 0.92);
  border-color: rgba(47, 78, 128, 0.28);
  color: var(--board-ink);
}

.search-meta-item.doc-ready {
  background: rgba(232, 243, 236, 0.92);
  border-color: rgba(83, 132, 110, 0.24);
  color: #345f4d;
}

.search-meta-item.sample-warning,
.detail-state-pill.warning {
  background: rgba(250, 238, 222, 0.94);
  border-color: rgba(160, 103, 43, 0.3);
  color: #875523;
}

.detail-highlight-card span,
.detail-section h4,
.compare-block h4,
.research-overview-card span,
.detail-graph-link strong,
.compare-column-kicker {
  color: var(--board-ink);
  letter-spacing: 0.08em;
}

.detail-highlight-card span,
.detail-section h4,
.compare-block h4 {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(236, 241, 248, 0.9);
  border: 1px solid rgba(47, 78, 128, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.detail-section {
  padding-top: 18px;
}

.detail-section h4,
.compare-block h4 {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.detail-highlight-card,
.detail-workspace-bar,
.detail-graph-link {
  padding-top: 18px;
}

.detail-workspace-bar {
  border-color: rgba(33, 61, 111, 0.24);
}

.detail-graph-link {
  align-items: center;
}

.compare-column {
  padding-top: 18px;
}

.compare-block,
.compare-overview-card,
.related-case-card,
.research-overview-card,
.workbench-case-item {
  padding-top: 18px;
}

.compare-column-title-row,
.compare-overview-head {
  padding-top: 6px;
}

.research-overview-card span,
.compare-block h4,
.detail-section h4 {
  text-transform: none;
}

.related-case-reason,
.related-case-composite {
  color: var(--board-ink);
}

.detail-law-item {
  background: rgba(246, 240, 227, 0.92);
  border-color: rgba(47, 78, 128, 0.2);
  color: #27406d;
}

.original-text-card {
  border: 1px solid rgba(47, 78, 128, 0.18);
  background:
    linear-gradient(180deg, rgba(250, 247, 239, 0.96) 0%, rgba(243, 233, 213, 0.95) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.64),
    0 12px 24px rgba(83, 66, 42, 0.06);
}

.case-actions button.ghost,
.workspace-bar-actions button.ghost,
.detail-graph-link .ghost,
.workbench-case-actions button.ghost {
  background: rgba(247, 243, 232, 0.9);
  border-color: rgba(47, 78, 128, 0.24);
  color: var(--board-ink);
}

.case-actions button,
.workspace-bar-actions button,
.detail-graph-link button,
.workbench-case-actions button {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 10px 22px rgba(79, 39, 24, 0.08);
}

@media (max-width: 860px) {
  .case-item::after,
  .detail-highlight-card::after,
  .detail-section::after,
  .compare-column::after,
  .compare-block::after,
  .compare-overview-card::after,
  .related-case-card::after,
  .research-overview-card::after,
  .workbench-case-item::after,
  .detail-workspace-bar::after,
  .detail-graph-link::after {
    left: 12px;
    right: 12px;
  }
}

/* Release visual polish: presentation-only overrides. */
:root {
  --release-bg: #f5f7fb;
  --release-surface: #ffffff;
  --release-surface-soft: #f8fafc;
  --release-border: #dfe7f2;
  --release-border-strong: #cbd6e5;
  --release-text: #172033;
  --release-muted: #6b778c;
  --release-primary: #172033;
  --release-primary-hover: #263246;
  --release-focus: rgba(47, 78, 128, 0.18);
  --release-success: #0f766e;
  --release-danger: #b42318;
  --release-warn-bg: #fff8eb;
  --release-success-bg: #eefbf6;
  --release-danger-bg: #fff1f1;
  --release-radius-xl: 24px;
  --release-radius-lg: 18px;
  --release-radius-md: 14px;
  --release-shadow-sm: 0 8px 20px rgba(18, 32, 51, 0.06);
  --release-shadow-md: 0 18px 48px rgba(18, 32, 51, 0.12);
  --release-shadow-lg: 0 28px 90px rgba(18, 32, 51, 0.18);
}

body {
  color: var(--release-text);
  background:
    radial-gradient(circle at 8% 0%, rgba(214, 225, 238, 0.52), transparent 28%),
    radial-gradient(circle at 92% 4%, rgba(231, 220, 196, 0.44), transparent 26%),
    linear-gradient(180deg, #f7fafc 0%, #f4f6fa 48%, #efe6d5 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.topbar {
  min-height: 58px;
  border: 1px solid rgba(203, 214, 229, 0.68);
  border-radius: 0 0 22px 22px;
  box-shadow: 0 10px 28px rgba(18, 32, 51, 0.06);
}

body.library-entry-active .topbar {
  margin: 16px;
  min-height: 76px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 9% 25%, rgba(231, 220, 196, 0.5), transparent 9%),
    radial-gradient(circle at 91% 35%, rgba(220, 228, 237, 0.72), transparent 13%),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 42px rgba(18, 32, 51, 0.08);
}

.topbar-brand h1,
.page-head h2,
.preview-head-copy h3,
.panel-head h3 {
  color: var(--release-text);
  letter-spacing: -0.02em;
}

.topbar .nav-item,
.topbar-status .status-pill,
.topbar-toggle,
.surface-tab,
.result-pill,
.topic-chip {
  border-radius: 999px;
}

button,
.button-link,
.utility-link,
.mini-button,
.surface-tab {
  min-height: 40px;
  border-radius: var(--release-radius-md);
  border: 1px solid rgba(23, 32, 51, 0.08);
  background: linear-gradient(180deg, var(--release-primary) 0%, #0f172a 100%);
  color: #fff;
  font-weight: 750;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 22px rgba(18, 32, 51, 0.12);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

button:hover,
.button-link:hover,
.utility-link:hover,
.mini-button:hover,
.surface-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(18, 32, 51, 0.16);
}

button:active,
.button-link:active,
.utility-link:active,
.mini-button:active,
.surface-tab:active {
  transform: translateY(0);
  box-shadow: 0 7px 16px rgba(18, 32, 51, 0.12);
}

button:disabled,
button[disabled],
.feature-disabled button {
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  opacity: 0.52;
}

button.ghost,
.ghost,
.surface-tab:not(.active),
.utility-link.ghost {
  background: rgba(255, 255, 255, 0.84);
  color: var(--release-text);
  border-color: var(--release-border);
  box-shadow: 0 6px 16px rgba(18, 32, 51, 0.05);
}

button.ghost:hover,
.ghost:hover,
.surface-tab:not(.active):hover {
  background: #ffffff;
  border-color: var(--release-border-strong);
  color: #0f172a;
}

.case-actions button,
.workspace-bar-actions button,
.detail-graph-link button,
.workbench-case-actions button,
.login-form-actions button,
.left-panel-actions button,
.preview-head-actions button {
  border-radius: var(--release-radius-md);
}

input,
select,
textarea {
  border-radius: var(--release-radius-md);
  border: 1px solid var(--release-border);
  background: rgba(255, 255, 255, 0.96);
  color: var(--release-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--release-border-strong);
}

input:focus,
select:focus,
textarea:focus,
.login-form .stack-field input:focus {
  outline: none;
  border-color: #6d87ad;
  box-shadow: 0 0 0 4px var(--release-focus), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

input::placeholder,
textarea::placeholder {
  color: #98a3b3;
}

.stack-field {
  gap: 7px;
}

.stack-field span,
.login-form .stack-field span,
.entry-advanced-grid .stack-field > span,
.entry-source-type-block > span {
  color: #556174;
  font-size: 12px;
  font-weight: 750;
}

.dashboard-main,
.dashboard-left,
.dashboard-right,
.subscribe-card,
.subscribe-panel,
.account-grid .subscribe-card,
.quality-card,
.case-detail,
.case-item,
.detail-section,
.detail-highlight-card,
.original-text-card,
.report-meta-item,
.empty-state,
.main-toolbar,
.entry-advanced-grid,
.entry-source-type-block {
  border-color: rgba(203, 214, 229, 0.74);
  box-shadow: var(--release-shadow-sm);
}

.dashboard-main,
.subscribe-card,
.subscribe-panel,
.account-grid .subscribe-card,
.quality-card,
.case-detail,
.detail-section,
.detail-highlight-card,
.report-meta-item {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 252, 255, 0.96) 100%);
}

.panel-head {
  gap: 14px;
  border-bottom-color: rgba(203, 214, 229, 0.7);
}

.panel-subhead,
.page-desc,
.field-note,
.access-tip {
  color: var(--release-muted);
  line-height: 1.72;
}

body.library-entry-active .search-empty-guide {
  border: 1px solid rgba(203, 214, 229, 0.72);
  background:
    radial-gradient(circle at 22% 48%, rgba(255, 255, 255, 0.78), transparent 28%),
    linear-gradient(180deg, rgba(249, 251, 253, 0.95) 0%, rgba(242, 237, 226, 0.88) 100%);
  box-shadow: 0 28px 80px rgba(18, 32, 51, 0.08);
}

.main-worksurface.is-entry .search-empty-guide-copy strong {
  color: #263246;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 700;
}

.entry-search-bar {
  gap: 14px;
}

.entry-search-field input,
.entry-search-field select {
  min-height: 62px;
  border-radius: 18px;
  border-color: #d9e2ef;
  box-shadow: 0 12px 28px rgba(18, 32, 51, 0.07);
}

.entry-search-field-query input {
  border-color: #d0d9e8;
  box-shadow:
    0 0 0 5px rgba(47, 78, 128, 0.08),
    0 16px 34px rgba(18, 32, 51, 0.08);
}

#starter-search-btn,
#search-btn {
  min-height: 54px;
  padding-inline: 28px;
}

.entry-advanced-search summary,
.filter-group-advanced summary {
  border-radius: 999px;
  padding: 8px 12px;
}

.entry-advanced-search summary:hover,
.filter-group-advanced summary:hover {
  background: rgba(255, 255, 255, 0.8);
  color: #263246;
}

.modal-backdrop {
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.12), transparent 34%),
    rgba(9, 18, 32, 0.58);
  backdrop-filter: blur(10px);
}

.modal-panel {
  border-radius: 28px;
  border: 1px solid rgba(226, 232, 240, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
  box-shadow: var(--release-shadow-lg);
}

#login-modal .modal-panel,
#forgot-password-modal .modal-panel,
#reset-password-modal .modal-panel {
  width: min(560px, calc(100vw - 32px));
  padding: 24px;
}

#forgot-password-modal .modal-panel {
  width: min(680px, calc(100vw - 32px));
}

.modal-panel > .panel-head {
  padding: 4px 4px 16px;
  border-bottom: 1px solid rgba(203, 214, 229, 0.68);
}

.preview-head-actions {
  gap: 10px;
}

.preview-close-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
}

.login-form {
  margin-top: 16px;
  max-height: min(680px, calc(100vh - 180px));
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(203, 214, 229, 0.7);
  background:
    radial-gradient(circle at top right, rgba(231, 220, 196, 0.26), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.login-form .stack-field {
  margin-bottom: 14px;
}

.login-form .stack-field input,
.login-form .stack-field select,
.login-form .stack-field textarea {
  min-height: 46px;
  padding: 11px 13px;
  font-size: 14px;
}

.login-form-actions {
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(203, 214, 229, 0.66);
}

.login-form-actions button {
  min-height: 44px;
  border-radius: 14px;
}

.error,
.success,
.panel-inline-note,
.access-tip,
#login-error,
#forgot-password-error,
#reset-password-error {
  border-radius: 14px;
}

.error,
#login-error:not(.hidden),
#forgot-password-error:not(.hidden),
#reset-password-error:not(.hidden) {
  padding: 10px 12px;
  border: 1px solid rgba(180, 35, 24, 0.18);
  background: var(--release-danger-bg);
  color: var(--release-danger);
  font-size: 13px;
  line-height: 1.55;
}

.success:not(.hidden),
#login-success:not(.hidden),
#forgot-password-success:not(.hidden),
#reset-password-success:not(.hidden) {
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: var(--release-success-bg);
  color: var(--release-success);
  font-size: 13px;
  line-height: 1.55;
}

.account-grid {
  gap: 18px;
}

.account-meta-grid,
.report-meta-grid {
  gap: 12px;
}

.report-meta-item {
  border-radius: 18px;
  padding: 14px 16px;
}

.report-meta-item span {
  color: var(--release-muted);
  letter-spacing: 0.02em;
}

.report-meta-item strong {
  color: var(--release-text);
  line-height: 1.35;
}

#account-identity-resubmit-panel:not(.hidden) {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(180, 83, 9, 0.22);
  border-radius: 18px;
  background: var(--release-warn-bg);
}

.capability-panel,
.quality-inline-meta {
  gap: 10px;
}

.preview-content {
  border-radius: 24px;
  border-color: rgba(203, 214, 229, 0.76);
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.preview-content p,
.preview-raw-paragraph,
.preview-section-body {
  color: #253047;
  font-size: 15px;
  line-height: 2;
}

.preview-section {
  border-radius: 22px;
  border-color: rgba(203, 214, 229, 0.74);
  box-shadow: 0 14px 32px rgba(18, 32, 51, 0.06);
}

.preview-section-heading,
.preview-heading-card {
  border-radius: 18px;
}

.preview-editor {
  border-radius: 22px;
  border-color: rgba(47, 78, 128, 0.2);
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
}

.preview-editor textarea,
.preview-editor input {
  border-radius: 16px;
}

.empty-state {
  padding: 18px;
  border-radius: 20px;
  border-color: rgba(203, 214, 229, 0.85);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76) 0%, rgba(248, 250, 252, 0.92) 100%);
  color: var(--release-muted);
}

.empty-state.large {
  padding: 30px;
}

.result-pill,
.panel-inline-note,
.search-meta-item,
.quality-score-pill {
  border-radius: 999px;
}

.original-text-card {
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.66), transparent 30%),
    linear-gradient(180deg, rgba(255, 252, 245, 0.98) 0%, rgba(245, 238, 224, 0.94) 100%);
}

.original-text-copy {
  gap: 7px;
}

@media (max-width: 860px) {
  body.library-entry-active .topbar {
    margin: 10px;
    min-height: auto;
    border-radius: 18px;
  }

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

  .entry-search-field input,
  .entry-search-field select,
  #starter-search-btn {
    min-height: 52px;
  }

  .modal-panel,
  #login-modal .modal-panel,
  #forgot-password-modal .modal-panel,
  #reset-password-modal .modal-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 22px;
    padding: 16px;
  }

  .login-form {
    padding: 16px;
  }

  .login-form-actions {
    flex-direction: column;
  }

.login-form-actions button {
  width: 100%;
}
}

/* Login mode switch: password login / SMS code login. */
.login-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid rgba(203, 214, 229, 0.88);
  border-radius: 16px;
  background: rgba(241, 245, 249, 0.88);
}

.login-mode-tab {
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent !important;
  color: #5d687b !important;
  box-shadow: none !important;
  font-size: 14px;
  font-weight: 760;
}

.login-mode-tab:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.72) !important;
  color: #172033 !important;
}

.login-mode-tab.active {
  background: #ffffff !important;
  color: #172033 !important;
  border-color: rgba(203, 214, 229, 0.9);
  box-shadow: 0 8px 18px rgba(18, 32, 51, 0.08) !important;
}

.login-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: end;
}

.login-code-row.hidden,
#login-send-code-btn.hidden {
  display: none !important;
}

#login-send-code-btn {
  min-height: 46px;
  margin-bottom: 14px;
  border-radius: 14px;
}

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

.forgot-password-btn {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: #475569 !important;
  box-shadow: none !important;
  font-size: 13px;
  font-weight: 700;
}

.forgot-password-btn:hover {
  transform: none;
  color: #172033 !important;
  text-decoration: underline;
  box-shadow: none !important;
}

@media (max-width: 520px) {
  .login-code-row {
    grid-template-columns: minmax(0, 1fr);
  }

  #login-send-code-btn {
    width: 100%;
    margin-bottom: 0;
  }
}

/* Homepage search-only polish: layout and advanced panel overlay. */
body.library-entry-active #view-library .entry-search-bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 146px 132px;
  gap: 12px;
  align-items: stretch;
  width: min(1120px, 100%);
  max-width: 1120px;
  margin: 0 auto;
  z-index: 6;
}

body.library-entry-active #view-library .entry-search-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 10px;
  min-width: 0;
}

body.library-entry-active #view-library .entry-search-field {
  min-width: 0;
}

body.library-entry-active #view-library .entry-search-field input,
body.library-entry-active #view-library .entry-search-field select {
  width: 100%;
  min-height: 56px;
  height: 56px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(126, 143, 166, 0.28);
  background: rgba(255, 252, 246, 0.94) !important;
  color: #2b3445 !important;
  font-size: 15px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 8px 18px rgba(42, 54, 74, 0.06);
}

body.library-entry-active #view-library .entry-search-field-query input {
  font-size: 16px;
  border-color: rgba(99, 115, 139, 0.34);
  box-shadow:
    0 0 0 4px rgba(47, 78, 128, 0.07),
    0 12px 24px rgba(42, 54, 74, 0.07);
}

body.library-entry-active #view-library .entry-search-field input:focus,
body.library-entry-active #view-library .entry-search-field select:focus {
  border-color: rgba(47, 78, 128, 0.52);
  box-shadow:
    0 0 0 4px rgba(47, 78, 128, 0.12),
    0 12px 24px rgba(42, 54, 74, 0.08);
}

body.library-entry-active #view-library .entry-start-btn,
body.library-entry-active #view-library .entry-advanced-toggle {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  height: 56px;
  padding: 0 18px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

body.library-entry-active #view-library .entry-start-btn {
  background: linear-gradient(180deg, #192235 0%, #0f172a 100%) !important;
  color: #fff !important;
  border-color: rgba(15, 23, 42, 0.5);
  font-size: 15px;
  letter-spacing: 0.03em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 14px 26px rgba(15, 23, 42, 0.18);
}

body.library-entry-active #view-library .entry-start-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 32px rgba(15, 23, 42, 0.22);
}

body.library-entry-active #view-library .entry-advanced-toggle {
  background: rgba(255, 252, 246, 0.84) !important;
  color: #344055 !important;
  border: 1px solid rgba(126, 143, 166, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 8px 18px rgba(42, 54, 74, 0.06);
}

body.library-entry-active #view-library .entry-advanced-toggle:hover,
body.library-entry-active #view-library .entry-advanced-toggle.active {
  background: #ffffff !important;
  border-color: rgba(47, 78, 128, 0.34);
  color: #172033 !important;
}

body.library-entry-active #view-library .entry-advanced-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

body.library-entry-active #view-library .entry-advanced-toggle.active svg {
  transform: rotate(180deg);
}

body.library-entry-active #view-library .entry-advanced-container {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(880px, 100%);
  z-index: 30;
}

body.library-entry-active #view-library .entry-advanced-container.hidden {
  display: none !important;
}

body.library-entry-active #view-library .entry-advanced-panel {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(203, 214, 229, 0.86);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(231, 220, 196, 0.26), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
  box-shadow:
    0 24px 70px rgba(18, 32, 51, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

body.library-entry-active #view-library .entry-advanced-panel::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 46px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border-left: 1px solid rgba(203, 214, 229, 0.86);
  border-top: 1px solid rgba(203, 214, 229, 0.86);
  background: rgba(255, 255, 255, 0.98);
}

body.library-entry-active #view-library .entry-advanced-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.library-entry-active #view-library .entry-advanced-grid .stack-field {
  display: grid;
  gap: 7px;
}

body.library-entry-active #view-library .entry-advanced-grid .stack-field > span,
body.library-entry-active #view-library .entry-source-type-block > span {
  color: #5d687b;
  font-size: 12px;
  font-weight: 760;
}

body.library-entry-active #view-library .entry-advanced-grid input,
body.library-entry-active #view-library .entry-advanced-grid select {
  width: 100%;
  min-height: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 13px;
  border: 1px solid rgba(203, 214, 229, 0.92);
  background: #fff;
  font-size: 13px;
  box-shadow: none;
}

body.library-entry-active #view-library .entry-toggle-field {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 13px;
  border: 1px solid rgba(203, 214, 229, 0.92);
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.library-entry-active #view-library .entry-toggle-field input {
  width: 15px;
  height: 15px;
  min-height: 0;
  padding: 0;
  box-shadow: none;
}

body.library-entry-active #view-library .entry-source-type-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(203, 214, 229, 0.72);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.72);
  box-shadow: none;
}

body.library-entry-active #view-library .entry-advanced-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

body.library-entry-active #view-library .entry-advanced-footer button {
  min-height: 40px;
  min-width: 104px;
  padding: 0 16px;
  border-radius: 13px;
}

body.library-entry-active #view-library .entry-advanced-footer .btn-reset {
  background: #ffffff !important;
  color: #445166 !important;
  border: 1px solid rgba(203, 214, 229, 0.92);
  box-shadow: 0 6px 14px rgba(18, 32, 51, 0.05);
}

body.library-entry-active #view-library .entry-advanced-footer .btn-submit {
  background: linear-gradient(180deg, #192235 0%, #0f172a 100%) !important;
  color: #fff !important;
}

body.library-entry-active #view-library .search-empty-guide-examples {
  position: relative;
  z-index: 1;
}

@media (max-width: 980px) {
  body.library-entry-active #view-library .entry-search-bar {
    grid-template-columns: minmax(0, 1fr) 132px;
  }

  body.library-entry-active #view-library .entry-search-main {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) 180px;
  }

  body.library-entry-active #view-library .entry-advanced-container {
    left: 0;
    right: auto;
    width: 100%;
  }

  body.library-entry-active #view-library .entry-advanced-panel::before {
    right: 64px;
  }

  body.library-entry-active #view-library .entry-advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.library-entry-active #view-library .entry-search-bar,
  body.library-entry-active #view-library .entry-search-main {
    grid-template-columns: minmax(0, 1fr);
  }

  body.library-entry-active #view-library .entry-search-field input,
  body.library-entry-active #view-library .entry-search-field select,
  body.library-entry-active #view-library .entry-start-btn,
  body.library-entry-active #view-library .entry-advanced-toggle {
    min-height: 50px;
    height: 50px;
  }

  body.library-entry-active #view-library .entry-advanced-container {
    top: calc(100% + 10px);
  }

  body.library-entry-active #view-library .entry-advanced-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.library-entry-active #view-library .entry-advanced-footer {
    flex-direction: column-reverse;
  }

  body.library-entry-active #view-library .entry-advanced-footer button {
    width: 100%;
  }
}

/* UI architecture refresh for the launch-ready case library. */
:root {
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-soft: #F5F7FA;
  --surface-muted: #F5F7FA;
  --line: #E5E6EB;
  --line-strong: #C9CDD4;
  --text: #333333;
  --text-soft: #666666;
  --text-muted: #86909C;
  --ink: #333333;
  --ink-soft: #333333;
  --accent: #165DFF;
  --accent-deep: #0E42D2;
  --accent-soft: #E8F0FF;
  --accent-quiet: rgba(22, 93, 255, 0.08);
  --shadow: 0 8px 24px rgba(29, 33, 41, 0.06);
  --shadow-md: 0 12px 32px rgba(29, 33, 41, 0.08);
  --shadow-lg: 0 18px 44px rgba(29, 33, 41, 0.12);
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --font-sm: 12px;
  --font-base: 14px;
  --font-lg: 18px;
  --font-xl: 18px;
  --font-2xl: 24px;
  --font-3xl: 24px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg) !important;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 24px auto 0;
  flex: 1 0 auto;
}

.topbar,
body.library-entry-active .topbar {
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  display: grid;
  grid-template-columns: 270px minmax(220px, 1fr) auto;
  grid-template-rows: 64px auto;
  align-items: center;
  gap: 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #FFFFFF !important;
  box-shadow: none;
  position: relative;
  top: auto;
  left: auto;
  right: auto;
}

.topbar::before,
.topbar::after {
  content: none !important;
}

.topbar-brand {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.brand-home-btn,
body.library-entry-active .brand-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font: 700 18px/1.2 "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  text-shadow: none;
  white-space: nowrap;
}

.brand-home-btn img,
.brand-logo {
  width: 28px !important;
  height: 28px !important;
  margin: 0 !important;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: none;
}

.topbar-nav {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.topbar-side {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-status {
  grid-column: 2 / 4;
  grid-row: 1;
  justify-self: center;
  position: static;
  min-width: 0;
}

.topbar-workbench-strip {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0 0 10px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: none;
}

.topbar .nav-item,
.topbar-status .status-pill,
.topbar-toggle,
.ghost,
button {
  min-height: 36px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.topbar .nav-item,
.topbar-status .status-pill {
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}

.topbar .nav-item.active,
.topbar .nav-item:hover,
.topbar-status .status-pill.active,
.topbar-status .status-pill:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
  transform: none;
}

button:not(.ghost):not(.nav-item):not(.status-pill):not(.brand-home-btn),
.btn-submit,
.entry-start-btn {
  color: #FFFFFF;
  background: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}

button:not(.ghost):not(.nav-item):not(.status-pill):not(.brand-home-btn):hover,
.btn-submit:hover,
.entry-start-btn:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  transform: translateY(-1px);
}

.ghost,
.btn-reset {
  color: var(--accent);
  background: #FFFFFF;
  border: 1px solid var(--accent);
  box-shadow: none;
}

.ghost:hover,
.btn-reset:hover {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: none;
}

button:disabled,
.ghost:disabled {
  color: var(--text-muted) !important;
  background: #F2F3F5 !important;
  border-color: var(--line) !important;
  cursor: not-allowed;
  transform: none;
}

input,
select,
textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #FFFFFF;
  color: var(--text);
  font-size: 14px;
  box-shadow: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.12);
}

.panel,
.dashboard-left,
.dashboard-main,
.dashboard-right,
.result-panel,
.detail-panel,
.inner-panel,
.case-item,
.workbench-case-item,
.detail-section,
.original-text-card,
.related-case-card,
.modal-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: none;
}

.panel-head h3,
.page-head h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.panel-subhead,
.field-note,
.search-meta-line,
.result-row-meta,
.detail-section-note {
  color: var(--text-soft);
  font-size: 12px;
}

.badge,
.panel-tag,
.search-meta-item,
.result-pill,
.status-pill,
.compare-pill {
  border-radius: 4px;
  padding: 4px 8px;
  background: var(--surface-soft);
  color: var(--text-soft);
  border: 1px solid var(--line);
}

.primary-domain,
.detail-reading-badge.is-guiding,
.free-tag {
  color: #FFFFFF;
  background: var(--accent);
  border-color: var(--accent);
}

.library-dashboard,
body.library-entry-active #view-library .library-dashboard {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
}

.dashboard-left,
body.library-entry-active #view-library .dashboard-left {
  width: 280px;
  min-width: 280px;
  position: sticky;
  top: 16px;
  padding: 18px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.dashboard-left .panel-head {
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.filter-group,
.filter-group-primary,
.filter-group-secondary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FFFFFF;
  padding: 14px;
  margin-bottom: 12px;
}

.filter-group-head {
  gap: 10px;
}

.filter-group-step {
  color: #FFFFFF;
  background: var(--accent);
  border-radius: 4px;
}

.left-panel-footer {
  position: sticky;
  bottom: 0;
  padding: 14px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0), #FFFFFF 22%);
}

.left-panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.result-panel {
  padding: 20px;
}

.result-panel .panel-head,
.main-toolbar {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.main-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

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

.case-item,
.workbench-case-item {
  padding: 20px;
  margin: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.case-item:hover,
.workbench-case-item:hover,
.related-case-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 93, 255, 0.32);
  box-shadow: var(--shadow-md);
}

.case-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.08);
}

.case-item h4,
.workbench-case-item h4,
.related-case-card strong {
  font-size: 18px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--text);
}

.search-snippet,
.search-conclusion-line,
.case-core-facts {
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.case-actions,
.case-actions-muted,
.workbench-case-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pagination {
  justify-content: center;
  gap: 8px;
  padding: 20px 0 4px;
}

.pagination button,
.pagination .ghost {
  min-width: 38px;
  height: 36px;
  border-radius: 6px;
}

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

.case-detail {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.detail-reading-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.detail-toc {
  position: sticky;
  top: 16px;
  padding: 16px 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FFFFFF;
}

.detail-toc-title {
  padding: 0 16px 12px 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.detail-toc a {
  display: block;
  padding: 9px 16px 9px 14px;
  color: var(--text-soft);
  text-decoration: none;
  border-left: 2px solid var(--line);
  font-size: 14px;
}

.detail-toc a:hover,
.detail-toc a.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.detail-reading-main {
  min-width: 0;
}

.detail-intro,
.detail-graph-link,
.sample-alert,
.detail-workspace-bar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FFFFFF;
  padding: 24px;
  margin-bottom: 24px;
}

.detail-intro h3 {
  font-size: 24px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--text);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.detail-overview-strip,
.detail-info-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #FFFFFF;
}

.detail-overview-strip span,
.detail-info-table dt,
.detail-info-table dd {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.detail-overview-strip em,
.detail-info-table dt {
  color: var(--text-soft);
  font-size: 12px;
  font-style: normal;
}

.detail-info-table dt {
  background: var(--surface-soft);
}

.detail-highlight-card {
  margin-top: 20px;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--surface-soft);
}

.detail-highlight-card span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.detail-highlight-card strong {
  display: block;
  margin: 10px 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.7;
}

.detail-section {
  padding: 24px;
  margin-bottom: 24px;
  scroll-margin-top: 24px;
}

.detail-section h4 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.detail-richtext,
.detail-section pre,
.preview-content {
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.detail-richtext p {
  margin: 0 0 16px;
}

.detail-laws {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-laws li,
.detail-laws span,
.detail-laws p {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-soft);
  border: 1px solid var(--line);
}

.original-text-card {
  padding: 20px;
  background: #FFFFFF;
}

.original-text-copy p {
  margin: 0;
  color: var(--text-soft);
}

.related-case-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 320px);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.related-case-card {
  padding: 16px;
}

.detail-workspace-bar-compact {
  position: sticky;
  bottom: 16px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-md);
}

.site-footer,
.footer-content {
  margin-top: 40px;
  color: var(--text-soft);
  font-size: 12px;
  text-align: center;
}

.site-footer a,
.footer-content a {
  color: var(--text-soft);
}

@media (max-width: 1024px) {
  .topbar,
  body.library-entry-active .topbar {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    padding: 12px 16px;
  }

  .topbar-brand,
  .topbar-nav,
  .topbar-side,
  .topbar-status,
  .topbar-workbench-strip {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }

  .library-dashboard,
  body.library-entry-active #view-library .library-dashboard,
  .detail-reading-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-left,
  body.library-entry-active #view-library .dashboard-left,
  .detail-toc {
    position: static;
    width: 100%;
    min-width: 0;
    max-height: none;
  }

  .main-toolbar,
  .detail-overview-strip,
  .detail-info-table {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-shell {
    width: min(100% - 20px, 1280px);
    margin-top: 14px;
  }

  .case-actions,
  .case-actions-muted,
  .workbench-case-actions,
  .detail-workspace-bar-compact {
    align-items: stretch;
    flex-direction: column;
  }

  .case-actions button,
  .workbench-case-actions button,
  .detail-workspace-bar-compact button {
    width: 100%;
  }
}

/* Results list page refinement: professional search-system layout. */
body:not(.library-entry-active) #view-library.view.active {
  width: 100%;
  max-width: none;
}

body:not(.library-entry-active) #view-library .library-dashboard {
  width: min(100% - 48px, 1280px);
  max-width: 1280px;
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: minmax(280px, 310px) minmax(0, 1fr) !important;
  gap: 24px;
  align-items: start;
}

body:not(.library-entry-active) #view-library .dashboard-left {
  width: auto;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(15, 35, 70, 0.08);
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

body:not(.library-entry-active) #view-library .dashboard-left .panel-head {
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

body:not(.library-entry-active) #view-library .dashboard-left .panel-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

body:not(.library-entry-active) #view-library .dashboard-left .panel-head p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

body:not(.library-entry-active) #view-library .left-panel-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  display: grid;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 93, 255, 0.22) transparent;
}

body:not(.library-entry-active) #view-library .left-panel-body::-webkit-scrollbar {
  width: 6px;
}

body:not(.library-entry-active) #view-library .left-panel-body::-webkit-scrollbar-thumb {
  background: rgba(22, 93, 255, 0.22);
  border-radius: 999px;
}

body:not(.library-entry-active) #view-library .filter-group {
  padding: 14px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 16px;
  background: #f8faff;
  box-shadow: none;
}

body:not(.library-entry-active) #view-library .filter-group-primary {
  background: linear-gradient(180deg, rgba(22, 93, 255, 0.07), rgba(255, 255, 255, 0.96));
  border-color: rgba(22, 93, 255, 0.16);
}

body:not(.library-entry-active) #view-library .filter-group-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
}

body:not(.library-entry-active) #view-library .filter-group-head h3,
body:not(.library-entry-active) #view-library .filter-group-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

body:not(.library-entry-active) #view-library .filter-group-head p {
  grid-column: 2;
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

body:not(.library-entry-active) #view-library .filter-group-step {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

body:not(.library-entry-active) #view-library .filter-group-advanced,
body:not(.library-entry-active) #view-library .filter-group-collapsible {
  background: #fff;
}

body:not(.library-entry-active) #view-library .filter-group-advanced-body,
body:not(.library-entry-active) #view-library .filter-group-collapsible-body {
  padding-top: 12px;
  display: grid;
  gap: 12px;
}

body:not(.library-entry-active) #view-library .stack-field {
  gap: 6px;
}

body:not(.library-entry-active) #view-library .stack-field span,
body:not(.library-entry-active) #view-library .stack-field label {
  font-size: 13px;
  font-weight: 700;
  color: #3f4c5a;
}

body:not(.library-entry-active) #view-library .stack-field input,
body:not(.library-entry-active) #view-library .stack-field select,
body:not(.library-entry-active) #view-library .left-panel-body input,
body:not(.library-entry-active) #view-library .left-panel-body select {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(15, 35, 70, 0.1);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  box-shadow: 0 1px 0 rgba(15, 35, 70, 0.02);
}

body:not(.library-entry-active) #view-library .left-panel-body input:focus,
body:not(.library-entry-active) #view-library .left-panel-body select:focus {
  border-color: rgba(22, 93, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.12);
}

body:not(.library-entry-active) #view-library .left-panel-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 10px -2px -2px;
  padding: 16px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 24%, #fff);
}

body:not(.library-entry-active) #view-library .left-panel-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body:not(.library-entry-active) #view-library #search-btn,
body:not(.library-entry-active) #view-library #reset-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
}

body:not(.library-entry-active) #view-library #search-btn {
  background: linear-gradient(135deg, var(--accent), #123c73);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 28px rgba(22, 93, 255, 0.2);
}

body:not(.library-entry-active) #view-library #reset-btn {
  background: #fff;
  border: 1px solid rgba(22, 93, 255, 0.25);
  color: var(--accent-deep);
  box-shadow: none;
}

body:not(.library-entry-active) #view-library .dashboard-main {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body:not(.library-entry-active) #view-library .main-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(15, 35, 70, 0.07);
}

body:not(.library-entry-active) #view-library .main-toolbar.hidden {
  display: none;
}

body:not(.library-entry-active) #view-library .library-quick-filter-group,
body:not(.library-entry-active) #view-library .main-toolbar-actions,
body:not(.library-entry-active) #view-library .main-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

body:not(.library-entry-active) #view-library .library-quick-filters,
body:not(.library-entry-active) #view-library .administrative-subfilters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body:not(.library-entry-active) #view-library .library-topic-chip,
body:not(.library-entry-active) #view-library .quick-filter-chip,
body:not(.library-entry-active) #view-library .administrative-subfilter {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(15, 35, 70, 0.1);
  background: #f7f9fd;
  color: #526173;
  font-size: 12px;
  font-weight: 700;
}

body:not(.library-entry-active) #view-library .library-topic-chip.active,
body:not(.library-entry-active) #view-library .quick-filter-chip.active,
body:not(.library-entry-active) #view-library .administrative-subfilter.active {
  background: rgba(22, 93, 255, 0.1);
  border-color: rgba(22, 93, 255, 0.24);
  color: var(--accent);
}

body:not(.library-entry-active) #view-library .result-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 42px rgba(15, 35, 70, 0.07);
}

body:not(.library-entry-active) #view-library .result-panel > .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

body:not(.library-entry-active) #view-library #library-results-title {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

body:not(.library-entry-active) #view-library #library-results-meta,
body:not(.library-entry-active) #view-library .library-filter-summary,
body:not(.library-entry-active) #view-library .case-count-chip {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

body:not(.library-entry-active) #view-library .library-filter-summary,
body:not(.library-entry-active) #view-library .results-handoff,
body:not(.library-entry-active) #view-library .result-inline-search {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 16px;
  background: #f8faff;
}

body:not(.library-entry-active) #view-library .result-inline-search {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

body:not(.library-entry-active) #view-library .result-inline-search input,
body:not(.library-entry-active) #view-library .result-inline-search select {
  min-height: 40px;
  border-radius: 12px;
}

body:not(.library-entry-active) #view-library .case-list {
  display: grid;
  gap: 16px;
}

body:not(.library-entry-active) #view-library .case-item {
  position: relative;
  overflow: visible;
  padding: 18px 20px;
  border: 1px solid rgba(15, 35, 70, 0.09);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 35, 70, 0.055);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body:not(.library-entry-active) #view-library .case-item::before,
body:not(.library-entry-active) #view-library .case-item::after {
  content: none !important;
}

body:not(.library-entry-active) #view-library .case-item:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 93, 255, 0.24);
  box-shadow: 0 18px 36px rgba(15, 35, 70, 0.09);
}

body:not(.library-entry-active) #view-library .case-item.active {
  border-color: rgba(22, 93, 255, 0.36);
  box-shadow: 0 18px 38px rgba(22, 93, 255, 0.12);
}

body:not(.library-entry-active) #view-library .result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

body:not(.library-entry-active) #view-library .result-row h4 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

body:not(.library-entry-active) #view-library .result-row h4 a,
body:not(.library-entry-active) #view-library .result-row h4 button {
  color: inherit;
}

body:not(.library-entry-active) #view-library .result-year {
  min-width: 58px;
  height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.09);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

body:not(.library-entry-active) #view-library .search-meta-line {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

body:not(.library-entry-active) #view-library .search-meta-item {
  min-height: 28px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  background: #f7f9fd;
  color: #526173;
  font-size: 12px;
  font-weight: 700;
}

body:not(.library-entry-active) #view-library .search-badge-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

body:not(.library-entry-active) #view-library .search-badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.08);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 750;
}

body:not(.library-entry-active) #view-library .search-snippet {
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(15, 35, 70, 0.07);
  border-radius: 14px;
  background: #f8faff;
  color: #3f4c5a;
  font-size: 14px;
  line-height: 1.75;
}

body:not(.library-entry-active) #view-library .search-snippet p {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body:not(.library-entry-active) #view-library .case-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 35, 70, 0.07);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

body:not(.library-entry-active) #view-library .case-actions button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

body:not(.library-entry-active) #view-library .case-actions button[data-action="open"] {
  background: linear-gradient(135deg, var(--accent), #123c73);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 20px rgba(22, 93, 255, 0.16);
}

body:not(.library-entry-active) #view-library .case-actions button:not([data-action="open"]) {
  background: #fff;
  border: 1px solid rgba(22, 93, 255, 0.22);
  color: var(--accent-deep);
  box-shadow: none;
}

body:not(.library-entry-active) #view-library .case-actions .favorite-btn.is-active,
body:not(.library-entry-active) #view-library .case-actions button[data-action="toggle-favorite"].is-active {
  background: rgba(22, 93, 255, 0.1);
  border-color: rgba(22, 93, 255, 0.34);
  color: var(--accent-deep);
}

/* Final related-cases layout override: fixed 2-column grid, no horizontal scroll. */
#view-library #detail-related-cases,
#view-library #detail-related-cases .related-case-grid,
body.library-reading-active #view-library #detail-related-cases,
body.library-reading-active #view-library #detail-related-cases .related-case-grid {
  overflow: visible !important;
}

#view-library #detail-related-cases .related-case-grid,
body.library-reading-active #view-library #detail-related-cases .related-case-grid {
  display: grid !important;
  grid-auto-flow: row !important;
  grid-auto-columns: unset !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  width: 100%;
  padding-bottom: 0 !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  scroll-snap-type: none !important;
  white-space: normal !important;
}

#view-library #detail-related-cases .related-case-card,
body.library-reading-active #view-library #detail-related-cases .related-case-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: none !important;
  scroll-snap-align: unset !important;
}

#view-library #detail-related-cases .related-case-card *,
body.library-reading-active #view-library #detail-related-cases .related-case-card * {
  min-width: 0;
}

@media (max-width: 1024px) {
  #view-library #detail-related-cases .related-case-grid,
  body.library-reading-active #view-library #detail-related-cases .related-case-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Final guard: detail related cases must be a normal wrapping grid, never a horizontal carousel. */
#view-library #detail-related-cases,
#view-library #detail-related-cases .related-case-grid,
body.library-reading-active #view-library #detail-related-cases,
body.library-reading-active #view-library #detail-related-cases .related-case-grid {
  overflow: visible !important;
}

#view-library #detail-related-cases .related-case-grid,
body.library-reading-active #view-library #detail-related-cases .related-case-grid {
  display: grid !important;
  grid-auto-flow: row !important;
  grid-auto-columns: unset !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  width: 100%;
  padding-bottom: 0 !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  scroll-snap-type: none !important;
  white-space: normal !important;
}

#view-library #detail-related-cases .related-case-card,
body.library-reading-active #view-library #detail-related-cases .related-case-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: none !important;
  scroll-snap-align: unset !important;
}

#view-library #detail-related-cases .related-case-card *,
body.library-reading-active #view-library #detail-related-cases .related-case-card * {
  min-width: 0;
}

@media (max-width: 1024px) {
  #view-library #detail-related-cases .related-case-grid,
  body.library-reading-active #view-library #detail-related-cases .related-case-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Final research workbench overrides: align collection -> comparison -> research workflow with the unified product style. */
body:not(.library-entry-active) #view-research {
  background:
    radial-gradient(circle at 8% 8%, rgba(22, 93, 255, 0.07), transparent 32%),
    linear-gradient(180deg, #f5f7fb 0%, #eef3fa 100%);
  color: #1f2a37;
}

body:not(.library-entry-active) #view-research .research-shell {
  width: min(1280px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 24px 0 36px;
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 24px;
  overflow: visible;
  align-items: start;
}

body:not(.library-entry-active) #view-research .research-side-panel,
body:not(.library-entry-active) #view-research .research-hero-card,
body:not(.library-entry-active) #view-research .research-overview-card,
body:not(.library-entry-active) #view-research .ai-lab-card,
body:not(.library-entry-active) #view-research .sample-pool-card,
body:not(.library-entry-active) #view-research .research-workspace-panel,
body:not(.library-entry-active) #view-research .research-report-panel {
  border: 1px solid rgba(15, 35, 70, 0.09);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(15, 35, 70, 0.08);
}

body:not(.library-entry-active) #view-research .research-side-panel {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 112px);
  padding: 18px;
  overflow: hidden;
}

body:not(.library-entry-active) #view-research .research-side-panel .panel-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15, 35, 70, 0.08);
}

body:not(.library-entry-active) #view-research .research-side-panel .page-kicker,
body:not(.library-entry-active) #view-research .research-head .page-kicker {
  color: #165dff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

body:not(.library-entry-active) #view-research .research-side-panel h3,
body:not(.library-entry-active) #view-research .research-head h2 {
  color: #0f2547;
  letter-spacing: -0.02em;
}

body:not(.library-entry-active) #view-research .sidebar-scroll {
  max-height: calc(100vh - 198px);
  overflow: auto;
  padding: 14px 4px 2px 0;
  display: grid;
  gap: 16px;
}

body:not(.library-entry-active) #view-research .sidebar-section {
  padding: 12px;
  border: 1px solid rgba(15, 35, 70, 0.07);
  border-radius: 16px;
  background: rgba(245, 247, 251, 0.72);
}

body:not(.library-entry-active) #view-research .section-head h4,
body:not(.library-entry-active) #view-research .recent-group h5 {
  color: #1f2a37;
  font-weight: 800;
}

body:not(.library-entry-active) #view-research .research-side-status-card {
  border-color: rgba(22, 93, 255, 0.18);
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.1), rgba(255, 255, 255, 0.96));
  box-shadow: inset 4px 0 0 #165dff;
}

body:not(.library-entry-active) #view-research .research-side-status-card strong {
  color: #0f2547;
  font-size: 26px;
}

body:not(.library-entry-active) #view-research .action-stack,
body:not(.library-entry-active) #view-research .topic-grid {
  grid-template-columns: 1fr;
}

body:not(.library-entry-active) #view-research .action-line,
body:not(.library-entry-active) #view-research .topic-chip,
body:not(.library-entry-active) #view-research .mini-button {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(15, 35, 70, 0.1);
  background: #fff;
  box-shadow: none;
  color: #334155;
  font-weight: 700;
}

body:not(.library-entry-active) #view-research .action-line:hover,
body:not(.library-entry-active) #view-research .topic-chip:hover,
body:not(.library-entry-active) #view-research .mini-button:hover {
  border-color: rgba(22, 93, 255, 0.3);
  color: #165dff;
  background: rgba(22, 93, 255, 0.06);
}

body:not(.library-entry-active) #view-research .research-main {
  min-width: 0;
  display: grid;
  gap: 18px;
  overflow: visible;
}

body:not(.library-entry-active) #view-research .research-hero-card {
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

body:not(.library-entry-active) #view-research .research-hero-card h2 {
  margin: 4px 0 10px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.24;
}

body:not(.library-entry-active) #view-research .research-hero-card .page-desc {
  max-width: 680px;
  margin: 0;
  color: #526173;
  font-size: 15px;
  line-height: 1.8;
}

body:not(.library-entry-active) #view-research .research-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body:not(.library-entry-active) #view-research .research-stat-grid,
body:not(.library-entry-active) #view-research .research-overview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
}

body:not(.library-entry-active) #view-research .research-overview-card {
  padding: 18px;
  box-shadow: 0 12px 30px rgba(15, 35, 70, 0.06);
}

body:not(.library-entry-active) #view-research .research-overview-card span {
  color: #64748b;
  font-weight: 800;
  letter-spacing: 0.08em;
}

body:not(.library-entry-active) #view-research .research-overview-card strong {
  color: #0f2547;
  font-size: 22px;
}

body:not(.library-entry-active) #view-research .research-overview-card p,
body:not(.library-entry-active) #view-research .panel-subhead,
body:not(.library-entry-active) #view-research .panel-gate-note {
  color: #5f6e80;
  line-height: 1.7;
}

body:not(.library-entry-active) #view-research .research-toolbar {
  display: none;
}

body:not(.library-entry-active) #view-research .ai-lab-card {
  padding: 22px;
}

body:not(.library-entry-active) #view-research .ai-lab-card .panel-head,
body:not(.library-entry-active) #view-research .sample-pool-card .panel-head,
body:not(.library-entry-active) #view-research .research-workspace-panel .panel-head {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(15, 35, 70, 0.08);
}

body:not(.library-entry-active) #view-research .ai-lab-card h3,
body:not(.library-entry-active) #view-research .sample-pool-card h3,
body:not(.library-entry-active) #view-research .research-workspace-panel h3 {
  color: #0f2547;
  font-size: 18px;
  font-weight: 800;
}

body:not(.library-entry-active) #view-research .premium-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

body:not(.library-entry-active) #view-research .premium-card,
body:not(.library-entry-active) #view-research .ai-feature-card {
  border: 1px solid rgba(15, 35, 70, 0.09);
  border-radius: 16px;
  background: #f8fbff;
  padding: 16px;
  box-shadow: none;
}

body:not(.library-entry-active) #view-research .premium-badge,
body:not(.library-entry-active) #view-research .pro-tag {
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
}

body:not(.library-entry-active) #view-research .planned-button,
body:not(.library-entry-active) #view-research .premium-card button {
  background: rgba(100, 116, 139, 0.08);
  border-color: rgba(100, 116, 139, 0.22);
  color: #475569;
  box-shadow: none;
}

body:not(.library-entry-active) #view-research .sample-pool-card {
  padding: 22px;
  border-color: rgba(22, 93, 255, 0.14);
}

body:not(.library-entry-active) #view-research .panel-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

body:not(.library-entry-active) #view-research #research-workbench-count,
body:not(.library-entry-active) #view-research .panel-inline-note {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.08);
  border: 1px solid rgba(22, 93, 255, 0.16);
  color: #123c73;
  font-size: 12px;
  font-weight: 800;
}

body:not(.library-entry-active) #view-research .research-workbench-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 14px 0 16px;
}

body:not(.library-entry-active) #view-research #research-open-compare-btn {
  background: #165dff;
  border-color: #165dff;
  color: #fff;
  box-shadow: 0 12px 24px rgba(22, 93, 255, 0.18);
}

body:not(.library-entry-active) #view-research .danger-ghost-button,
body:not(.library-entry-active) #view-research button[data-action="remove"] {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.2);
  background: rgba(180, 35, 24, 0.04);
  box-shadow: none;
}

body:not(.library-entry-active) #view-research .research-flow-hint {
  margin: 0 0 16px;
  border: 1px solid rgba(22, 93, 255, 0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.08), rgba(255, 255, 255, 0.96));
  padding: 18px;
}

body:not(.library-entry-active) #view-research .research-task-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body:not(.library-entry-active) #view-research .research-task-step {
  border: 1px solid rgba(15, 35, 70, 0.09);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 8px;
}

body:not(.library-entry-active) #view-research .research-task-step::before {
  display: none;
}

body:not(.library-entry-active) #view-research .research-task-step.is-active {
  border-color: rgba(22, 93, 255, 0.35);
  box-shadow: inset 4px 0 0 #165dff;
}

body:not(.library-entry-active) #view-research .research-task-step.is-completed {
  background: rgba(22, 93, 255, 0.055);
}

body:not(.library-entry-active) #view-research .workbench-case-list,
body:not(.library-entry-active) #view-research .sample-case-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body:not(.library-entry-active) #view-research .workbench-case-item,
body:not(.library-entry-active) #view-research .sample-case-card {
  margin: 0;
  border: 1px solid rgba(15, 35, 70, 0.09);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(15, 35, 70, 0.055);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body:not(.library-entry-active) #view-research .workbench-case-item:hover {
  border-color: rgba(22, 93, 255, 0.24);
  box-shadow: 0 16px 34px rgba(15, 35, 70, 0.1);
  transform: translateY(-1px);
}

body:not(.library-entry-active) #view-research .workbench-case-item h4 {
  color: #0f2547;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body:not(.library-entry-active) #view-research .workbench-source-type-line,
body:not(.library-entry-active) #view-research .sample-case-meta {
  margin-top: 10px;
}

body:not(.library-entry-active) #view-research .sample-case-facts,
body:not(.library-entry-active) #view-research .result-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

body:not(.library-entry-active) #view-research .sample-case-facts span,
body:not(.library-entry-active) #view-research .result-facts span {
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 999px;
  background: #f5f7fb;
  padding: 6px 10px;
  color: #475569;
  font-size: 12px;
}

body:not(.library-entry-active) #view-research .workbench-case-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

body:not(.library-entry-active) #view-research .workbench-case-actions button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: none;
}

body:not(.library-entry-active) #view-research .research-workspace-grid,
body:not(.library-entry-active) #view-research .research-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1fr) minmax(280px, 1.1fr);
  gap: 16px;
}

body:not(.library-entry-active) #view-research .research-workspace-panel {
  padding: 18px;
  min-width: 0;
}

body:not(.library-entry-active) #view-research .folder-list,
body:not(.library-entry-active) #view-research .card-list {
  display: grid;
  gap: 10px;
}

body:not(.library-entry-active) #view-research .empty-state {
  border: 1px dashed rgba(22, 93, 255, 0.24);
  border-radius: 16px;
  background: rgba(22, 93, 255, 0.045);
  color: #526173;
  line-height: 1.75;
  padding: 18px;
}

body:not(.library-entry-active) #view-research .editor-form label span {
  color: #475569;
  font-weight: 800;
  font-size: 13px;
}

body:not(.library-entry-active) #view-research .editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 1180px) {
  body:not(.library-entry-active) #view-research .research-shell {
    grid-template-columns: 1fr;
  }

  body:not(.library-entry-active) #view-research .research-side-panel {
    position: static;
    max-height: none;
  }

  body:not(.library-entry-active) #view-research .sidebar-scroll {
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.library-entry-active) #view-research .research-workspace-grid,
  body:not(.library-entry-active) #view-research .research-grid {
    grid-template-columns: 1fr 1fr;
  }

  body:not(.library-entry-active) #view-research .current-research-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  body:not(.library-entry-active) #view-research .research-shell {
    width: min(100%, calc(100vw - 28px));
    padding-top: 16px;
  }

  body:not(.library-entry-active) #view-research .research-hero-card,
  body:not(.library-entry-active) #view-research .research-stat-grid,
  body:not(.library-entry-active) #view-research .research-overview-strip,
  body:not(.library-entry-active) #view-research .premium-grid,
  body:not(.library-entry-active) #view-research .workbench-case-list,
  body:not(.library-entry-active) #view-research .research-workspace-grid,
  body:not(.library-entry-active) #view-research .research-grid,
  body:not(.library-entry-active) #view-research .research-task-steps,
  body:not(.library-entry-active) #view-research .sidebar-scroll {
    grid-template-columns: 1fr;
  }

  body:not(.library-entry-active) #view-research .research-hero-actions,
  body:not(.library-entry-active) #view-research .research-workbench-actions,
  body:not(.library-entry-active) #view-research .workbench-case-actions {
    justify-content: stretch;
  }

  body:not(.library-entry-active) #view-research .research-hero-actions button,
  body:not(.library-entry-active) #view-research .research-workbench-actions button,
  body:not(.library-entry-active) #view-research .workbench-case-actions button {
    flex: 1 1 auto;
  }
}

body:not(.library-entry-active) #view-research.research-left-collapsed .research-shell {
  grid-template-columns: minmax(0, 1fr);
}

body:not(.library-entry-active) #view-research.research-left-collapsed .research-side-panel {
  position: absolute;
  width: 0;
  min-width: 0;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body:not(.library-entry-active) #view-research.research-left-collapsed .research-side-panel .panel-head,
body:not(.library-entry-active) #view-research.research-left-collapsed .research-side-panel .sidebar-scroll {
  display: none;
}

body:not(.library-entry-active) #view-research.research-left-collapsed #research-left-sidebar-toggle {
  position: fixed;
  left: max(16px, calc((100vw - 1280px) / 2 + 16px));
  top: 126px;
  z-index: 30;
}

/* Detail related-cases bug fix: no horizontal carousel, always wrap as a 2-column grid. */
#view-library #detail-related-cases,
#view-library #detail-related-cases .related-case-grid,
body.library-reading-active #view-library #detail-related-cases,
body.library-reading-active #view-library #detail-related-cases .related-case-grid {
  overflow: visible !important;
}

#view-library #detail-related-cases .related-case-grid,
body.library-reading-active #view-library #detail-related-cases .related-case-grid {
  display: grid !important;
  grid-auto-flow: row !important;
  grid-auto-columns: unset !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  width: 100%;
  padding-bottom: 0 !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  scroll-snap-type: none !important;
  white-space: normal !important;
}

#view-library #detail-related-cases .related-case-card,
body.library-reading-active #view-library #detail-related-cases .related-case-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: none !important;
  scroll-snap-align: unset !important;
}

#view-library #detail-related-cases .related-case-card *,
body.library-reading-active #view-library #detail-related-cases .related-case-card * {
  min-width: 0;
}

@media (max-width: 1024px) {
  #view-library #detail-related-cases .related-case-grid,
  body.library-reading-active #view-library #detail-related-cases .related-case-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Detail bug-fix guard: TOC anchors should scroll inside detail, and related cases must wrap fully. */
body.library-reading-active #view-library .detail-section,
body.library-reading-active #view-library [data-detail-section],
body.library-reading-active #view-library .detail-highlight-card {
  scroll-margin-top: 104px;
}

#view-library .detail-section,
#view-library [data-detail-section],
#view-library .detail-highlight-card {
  scroll-margin-top: 104px;
}

body.library-reading-active #view-library .detail-toc button,
body.library-reading-active #view-library .detail-toc .detail-toc-link,
#view-library .detail-toc button,
#view-library .detail-toc .detail-toc-link {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 10px 8px 14px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #526173;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

body.library-reading-active #view-library .detail-toc button:hover,
body.library-reading-active #view-library .detail-toc button.active,
body.library-reading-active #view-library .detail-toc button.is-active,
#view-library .detail-toc button:hover,
#view-library .detail-toc button.active,
#view-library .detail-toc button.is-active {
  border-left-color: #165dff;
  background: rgba(22, 93, 255, 0.08);
  color: #123c73;
}

body.library-reading-active #view-library .detail-reading-main,
body.library-reading-active #view-library #detail-related-cases,
body.library-reading-active #view-library .related-case-grid,
#view-library .detail-reading-main,
#view-library #detail-related-cases,
#view-library .related-case-grid {
  overflow: visible;
}

body.library-reading-active #view-library .related-case-grid,
#view-library .related-case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

body.library-reading-active #view-library .related-case-card,
#view-library .related-case-card {
  min-width: 0;
  width: 100%;
}

@media (max-width: 1024px) {
  #view-library .related-case-grid,
  body.library-reading-active #view-library .related-case-grid {
    grid-template-columns: 1fr;
  }
}

body:not(.library-entry-active) #view-library .pagination {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 35, 70, 0.055);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body:not(.library-entry-active) #view-library .pagination button,
body:not(.library-entry-active) #view-library .pagination .page-number {
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(15, 35, 70, 0.1);
  background: #fff;
  color: #526173;
  font-size: 13px;
  font-weight: 750;
}

body:not(.library-entry-active) #view-library .pagination button:hover,
body:not(.library-entry-active) #view-library .pagination .page-number:hover {
  border-color: rgba(22, 93, 255, 0.32);
  color: var(--accent);
  background: rgba(22, 93, 255, 0.06);
}

body:not(.library-entry-active) #view-library .pagination button.active,
body:not(.library-entry-active) #view-library .pagination .page-number.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

body:not(.library-entry-active) #view-library .pagination button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  background: #f7f9fd;
}

body:not(.library-entry-active) #view-library #list-empty {
  min-height: 190px;
  padding: 28px;
  border: 1px dashed rgba(22, 93, 255, 0.24);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f8faff);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

body:not(.library-entry-active) #view-library #list-empty::before {
  content: "未找到匹配案例";
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}

@media (max-width: 1120px) {
  body:not(.library-entry-active) #view-library .library-dashboard {
    width: min(100% - 32px, 1200px);
    grid-template-columns: minmax(248px, 280px) minmax(0, 1fr) !important;
    gap: 18px;
  }

  body:not(.library-entry-active) #view-library .main-toolbar,
  body:not(.library-entry-active) #view-library .result-panel > .panel-head {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body:not(.library-entry-active) #view-library .library-dashboard {
    width: min(100% - 28px, 760px);
    grid-template-columns: 1fr !important;
  }

  body:not(.library-entry-active) #view-library .dashboard-left {
    position: static;
    max-height: none;
    overflow: visible;
  }

  body:not(.library-entry-active) #view-library .left-panel-body {
    max-height: none;
    overflow: visible;
  }

  body:not(.library-entry-active) #view-library .left-panel-footer {
    position: static;
  }
}

@media (max-width: 720px) {
  body:not(.library-entry-active) #view-library .library-dashboard {
    width: min(100% - 24px, 560px);
    margin-top: 16px;
  }

  body:not(.library-entry-active) #view-library .dashboard-left,
  body:not(.library-entry-active) #view-library .result-panel,
  body:not(.library-entry-active) #view-library .main-toolbar,
  body:not(.library-entry-active) #view-library .case-item {
    border-radius: 16px;
  }

  body:not(.library-entry-active) #view-library .result-row {
    grid-template-columns: 1fr;
  }

  body:not(.library-entry-active) #view-library .case-actions {
    justify-content: stretch;
  }

  body:not(.library-entry-active) #view-library .case-actions button,
  body:not(.library-entry-active) #view-library .result-inline-search input,
  body:not(.library-entry-active) #view-library .result-inline-search select,
  body:not(.library-entry-active) #view-library .result-inline-search button {
    width: 100%;
  }
}

/* Conservative homepage alignment pass.
   This block only adjusts layout/styling for the homepage entry state. */
html,
body {
  overflow-x: hidden;
}

body.library-entry-active {
  background:
    radial-gradient(circle at 18% 12%, rgba(22, 93, 255, 0.08), transparent 34%),
    linear-gradient(180deg, #F6F8FC 0%, #F2F5FA 100%) !important;
}

body.library-entry-active .app-shell {
  min-height: 100vh;
  padding-top: 0 !important;
}

body.library-entry-active .topbar {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: 100%;
  max-width: none;
  min-height: 64px;
  margin: 0 !important;
  padding: 14px max(24px, calc((100vw - 1200px) / 2));
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(360px, 1.25fr) minmax(260px, 0.85fr);
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(15, 35, 70, 0.08);
  box-shadow: 0 8px 24px rgba(15, 35, 70, 0.04);
}

body.library-entry-active .topbar *,
body.library-entry-active .main-shell * {
  min-width: 0;
}

body.library-entry-active .topbar-brand {
  justify-self: start;
}

body.library-entry-active .brand-home-btn {
  gap: 10px;
  color: #0F2547;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

body.library-entry-active .brand-home-btn img {
  width: 28px;
  height: 28px !important;
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(22, 93, 255, 0.16);
}

body.library-entry-active .topbar-nav {
  justify-content: center;
  gap: 8px;
}

body.library-entry-active .topbar-status {
  justify-self: center;
  gap: 8px;
}

body.library-entry-active .topbar-side {
  justify-self: end;
}

body.library-entry-active .topbar-workbench-strip {
  grid-column: 1 / -1;
  width: 100%;
  margin: 4px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(22, 93, 255, 0.12);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.06), rgba(255, 255, 255, 0.92));
  box-shadow: 0 10px 24px rgba(15, 35, 70, 0.05);
}

body.library-entry-active .library-workbench-summary {
  gap: 10px;
}

body.library-entry-active .library-workbench-title {
  color: #0F2547;
  font-weight: 700;
}

body.library-entry-active .library-workbench-copy {
  color: #5F6B7A;
}

body.library-entry-active .library-workbench-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.08);
  color: #165DFF;
  font-size: 12px;
  font-weight: 600;
}

body.library-entry-active .main-shell {
  width: min(100% - 48px, 1200px);
  max-width: 1200px;
  margin: 28px auto 0;
  padding: 0;
}

body.library-entry-active #view-library.view.active,
body.library-entry-active #view-library .dashboard-main,
body.library-entry-active #view-library .main-worksurface,
body.library-entry-active #view-library .main-worksurface.is-entry {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  overflow: visible;
}

body.library-entry-active #view-library .library-dashboard {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0;
  overflow: visible;
}

body.library-entry-active #view-library .dashboard-left,
body.library-entry-active #view-library .dashboard-right {
  display: none !important;
}

body.library-entry-active #view-library .main-worksurface.is-entry .result-panel {
  width: 100%;
  max-width: 1200px;
  min-height: 540px;
  margin: 0 auto;
  padding: 44px;
  overflow: visible !important;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96)),
    #FFFFFF;
  box-shadow: 0 22px 50px rgba(15, 35, 70, 0.08);
}

body.library-entry-active #view-library .main-worksurface.is-entry .result-panel::before,
body.library-entry-active #view-library .main-worksurface.is-entry .result-panel::after {
  content: none !important;
}

body.library-entry-active #view-library .main-worksurface.is-entry .panel-head {
  max-width: 720px;
  margin: 0 0 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

body.library-entry-active #view-library .main-worksurface.is-entry .panel-head h3 {
  color: #0F2547;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.library-entry-active #view-library .main-worksurface.is-entry .panel-head .muted {
  max-width: 640px;
  color: #5F6B7A;
  font-size: 15px;
  line-height: 1.8;
}

body.library-entry-active #view-library .search-empty-guide {
  width: 100%;
  max-width: none;
  min-height: 360px;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 32px;
  align-items: center;
  overflow: visible !important;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.library-entry-active #view-library .search-empty-guide::after {
  content: "案例检索\A 规则演化\A 原文阅读\A 收藏对比\A 研究沉淀";
  white-space: pre-line;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 36px;
  border: 1px solid rgba(22, 93, 255, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(22, 93, 255, 0.12), rgba(255, 255, 255, 0.94) 44%),
    #FFFFFF;
  color: #0F2547;
  font-size: 18px;
  line-height: 2.35;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 40px rgba(15, 35, 70, 0.07);
}

body.library-entry-active #view-library .search-empty-guide-copy,
body.library-entry-active #view-library .entry-search-bar,
body.library-entry-active #view-library .search-empty-guide-examples {
  grid-column: 1;
  max-width: 720px;
}

body.library-entry-active #view-library .entry-search-bar {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 12px;
  align-items: stretch;
  position: relative;
  z-index: 2;
}

body.library-entry-active #view-library .entry-search-main {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 12px;
  min-height: 54px;
}

body.library-entry-active #view-library .entry-search-main input,
body.library-entry-active #view-library .entry-search-main select {
  height: 54px;
  border-radius: 12px;
  border-color: rgba(15, 35, 70, 0.12);
  background: #FFFFFF;
  box-shadow: 0 8px 18px rgba(15, 35, 70, 0.04);
}

body.library-entry-active #view-library .entry-start-btn {
  grid-column: 1;
  min-height: 46px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(22, 93, 255, 0.18);
}

body.library-entry-active #view-library .entry-advanced-toggle {
  grid-column: 2;
  min-height: 46px;
  border-radius: 12px;
  background: #FFFFFF;
}

body.library-entry-active #view-library .search-empty-guide-examples {
  justify-content: flex-start;
  gap: 10px;
}

body.library-entry-active #view-library .search-empty-guide-examples button,
body.library-entry-active #view-library .search-chip {
  border-radius: 999px;
  border: 1px solid rgba(22, 93, 255, 0.12);
  background: rgba(22, 93, 255, 0.06);
  color: #24415F;
}

body.library-entry-active .site-footer,
body.library-entry-active .footer-content {
  width: min(100% - 48px, 1200px);
  margin: 44px auto 22px;
}

@media (max-width: 1024px) {
  body.library-entry-active .topbar {
    padding: 12px 20px;
    grid-template-columns: 1fr;
  }

  body.library-entry-active .topbar-brand,
  body.library-entry-active .topbar-nav,
  body.library-entry-active .topbar-side,
  body.library-entry-active .topbar-status,
  body.library-entry-active .topbar-workbench-strip {
    justify-self: stretch;
  }

  body.library-entry-active .topbar-nav,
  body.library-entry-active .topbar-status,
  body.library-entry-active .topbar-side {
    justify-content: flex-start;
  }

  body.library-entry-active .main-shell {
    width: min(100% - 32px, 1200px);
    margin-top: 20px;
  }

  body.library-entry-active #view-library .main-worksurface.is-entry .result-panel {
    min-height: auto;
    padding: 32px;
  }

  body.library-entry-active #view-library .search-empty-guide {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  body.library-entry-active #view-library .search-empty-guide::after {
    min-height: 180px;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  body.library-entry-active .main-shell {
    width: min(100% - 24px, 1200px);
  }

  body.library-entry-active #view-library .main-worksurface.is-entry .result-panel {
    padding: 24px;
    border-radius: 16px;
  }

  body.library-entry-active #view-library .entry-search-bar,
  body.library-entry-active #view-library .entry-search-main {
    grid-template-columns: 1fr;
  }

  body.library-entry-active #view-library .entry-start-btn,
  body.library-entry-active #view-library .entry-advanced-toggle {
    grid-column: 1;
    width: 100%;
  }

  body.library-entry-active #view-library .search-empty-guide::after {
    display: none;
  }
}

/* Homepage product-experience refinement.
   Presentational only: preserves existing IDs, data attributes and click handlers. */
body.library-entry-active .topbar {
  grid-template-columns: minmax(250px, 1fr) auto auto minmax(170px, 0.72fr);
  row-gap: 14px;
  color: #1F2A37;
}

body.library-entry-active .topbar-brand {
  grid-column: 1;
  grid-row: 1;
}

body.library-entry-active .topbar-nav {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  padding: 4px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 999px;
  background: rgba(245, 247, 251, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.library-entry-active .topbar .nav-item {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  color: #526173;
  font-size: 13px;
  font-weight: 650;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.library-entry-active .topbar .nav-item.active,
body.library-entry-active .topbar .nav-item:hover {
  color: #123C73;
  background: #FFFFFF;
  border-color: rgba(22, 93, 255, 0.12);
  box-shadow: 0 8px 18px rgba(15, 35, 70, 0.08);
  transform: none;
}

body.library-entry-active .topbar-status {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  padding: 4px;
  border: 1px solid rgba(22, 93, 255, 0.13);
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.06);
}

body.library-entry-active .topbar-status .status-pills {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}

body.library-entry-active .topbar-status .status-pill {
  min-height: 30px;
  min-width: 54px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #4D6680;
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.library-entry-active .topbar-status .status-pill.active,
body.library-entry-active .topbar-status .status-pill:hover {
  color: #123C73;
  background: #FFFFFF;
  border-color: rgba(22, 93, 255, 0.14);
  box-shadow: 0 8px 18px rgba(22, 93, 255, 0.09);
  transform: none;
}

body.library-entry-active .topbar-status .status-pill#library-switch-sep,
body.library-entry-active .topbar-status #status-pill-workbench,
body.library-entry-active .topbar-status #status-pill-governance {
  display: none !important;
}

body.library-entry-active .topbar-side {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  gap: 8px;
}

body.library-entry-active .topbar-toggle {
  min-height: 34px;
  padding: 6px 12px;
  color: #5F6B7A;
  border-color: rgba(15, 35, 70, 0.08);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

body.library-entry-active .topbar-toggle:hover {
  color: #123C73;
  border-color: rgba(22, 93, 255, 0.18);
  background: #FFFFFF;
}

body.library-entry-active .topbar-workbench-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 18px;
  border-color: rgba(22, 93, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(22, 93, 255, 0.08), rgba(255, 255, 255, 0.94) 56%),
    #FFFFFF;
  box-shadow: 0 16px 34px rgba(15, 35, 70, 0.06);
}

body.library-entry-active .library-workbench-copy {
  display: grid;
  gap: 5px;
}

body.library-entry-active .library-workbench-copy strong {
  color: #123C73;
  font-size: 15px;
  font-weight: 800;
}

body.library-entry-active .library-workbench-copy span {
  color: #526173;
  font-size: 13px;
  line-height: 1.65;
}

body.library-entry-active .library-workbench-status {
  padding: 0;
  background: transparent;
  color: inherit;
  gap: 10px;
}

body.library-entry-active .workbench-count-pill {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.1);
  border: 1px solid rgba(22, 93, 255, 0.14);
  color: #123C73;
  font-weight: 700;
}

body.library-entry-active .workbench-recent-text {
  color: #6B7280;
  font-size: 12px;
}

body.library-entry-active #library-view-workbench-btn {
  color: #FFFFFF;
  border-color: #165DFF;
  background: linear-gradient(135deg, #165DFF, #123C73);
  box-shadow: 0 12px 22px rgba(22, 93, 255, 0.2);
}

body.library-entry-active #library-resume-research-btn {
  background: #FFFFFF;
}

body.library-entry-active #view-library .main-worksurface.is-entry .result-panel {
  padding: 40px;
  border-radius: 24px;
  border-color: rgba(15, 35, 70, 0.09);
  background:
    radial-gradient(circle at 76% 18%, rgba(22, 93, 255, 0.08), transparent 28%),
    linear-gradient(145deg, #FFFFFF 0%, #FBFCFF 100%);
}

body.library-entry-active #view-library .main-worksurface.is-entry .panel-head {
  display: none;
}

body.library-entry-active #view-library .search-empty-guide {
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.86fr);
  gap: 34px;
  align-items: stretch;
}

body.library-entry-active #view-library .search-empty-guide::after {
  content: none !important;
  display: none !important;
}

body.library-entry-active #view-library .search-empty-guide-copy {
  align-self: end;
  display: grid;
  gap: 12px;
  max-width: 700px;
}

.home-eyebrow {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(22, 93, 255, 0.14);
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.07);
  color: #165DFF;
  font-size: 12px;
  font-weight: 750;
}

.home-hero-subtitle {
  max-width: 640px;
  margin: 0;
  color: #3F4C5A;
  font-size: 15px;
  line-height: 1.8;
}

body.library-entry-active #view-library .entry-search-bar {
  max-width: 720px;
  padding: 16px;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 12px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 32px rgba(15, 35, 70, 0.06);
}

body.library-entry-active #view-library .entry-search-main {
  min-height: 52px;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 10px;
}

body.library-entry-active #view-library .entry-search-main input,
body.library-entry-active #view-library .entry-search-main select {
  height: 52px;
  border-radius: 12px;
  border-color: rgba(15, 35, 70, 0.12);
  color: #1F2A37;
  font-size: 14px;
}

body.library-entry-active #view-library .entry-search-main input:focus,
body.library-entry-active #view-library .entry-search-main select:focus {
  border-color: #165DFF;
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.12);
  outline: none;
}

body.library-entry-active #view-library .entry-start-btn,
body.library-entry-active #view-library .entry-advanced-toggle {
  min-height: 46px;
  border-radius: 12px;
  font-size: 14px;
}

body.library-entry-active #view-library .entry-start-btn {
  background: linear-gradient(135deg, #123C73, #165DFF);
  box-shadow: 0 14px 28px rgba(22, 93, 255, 0.22);
}

body.library-entry-active #view-library .entry-advanced-toggle {
  color: #123C73;
  border-color: rgba(22, 93, 255, 0.14);
}

.home-hot-issues {
  grid-column: 1;
  max-width: 720px;
  display: grid;
  gap: 12px;
}

.home-hot-title {
  color: #1F2A37;
  font-size: 14px;
  font-weight: 800;
}

body.library-entry-active #view-library .home-hot-issues .search-empty-guide-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: none;
}

body.library-entry-active #view-library .home-hot-issues .search-empty-guide-examples button {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 12px;
  border-color: rgba(18, 60, 115, 0.13);
  background: #FFFFFF;
  color: #123C73;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 35, 70, 0.05);
}

body.library-entry-active #view-library .home-hot-issues .search-empty-guide-examples button:hover {
  border-color: rgba(22, 93, 255, 0.24);
  background: rgba(22, 93, 255, 0.07);
  transform: translateY(-1px);
}

.home-capability-card {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: stretch;
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(22, 93, 255, 0.13);
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(22, 93, 255, 0.1), rgba(255, 255, 255, 0.98) 38%),
    #FFFFFF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 18px 38px rgba(15, 35, 70, 0.07);
}

.home-capability-head {
  display: grid;
  gap: 6px;
}

.home-capability-head span {
  color: #165DFF;
  font-size: 12px;
  font-weight: 800;
}

.home-capability-head strong {
  color: #1F2A37;
  font-size: 20px;
  line-height: 1.35;
}

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

.home-capability-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px;
  border: 1px solid rgba(15, 35, 70, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.home-capability-item em {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: rgba(22, 93, 255, 0.09);
  color: #165DFF;
  font-style: normal;
  font-weight: 800;
}

.home-capability-item strong {
  display: block;
  margin-bottom: 4px;
  color: #123C73;
  font-size: 14px;
  font-weight: 800;
}

.home-capability-item span {
  color: #5F6B7A;
  font-size: 12px;
  line-height: 1.65;
}

@media (max-width: 1024px) {
  body.library-entry-active .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.library-entry-active .topbar-nav,
  body.library-entry-active .topbar-status,
  body.library-entry-active .topbar-side {
    justify-self: start;
  }

  body.library-entry-active .topbar-workbench-strip {
    grid-template-columns: 1fr;
  }

  body.library-entry-active #view-library .search-empty-guide {
    grid-template-columns: 1fr;
  }

  .home-capability-card {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  body.library-entry-active .topbar {
    padding: 14px 16px;
  }

  body.library-entry-active .topbar-nav,
  body.library-entry-active .topbar-status .status-pills,
  body.library-entry-active .topbar-side,
  body.library-entry-active .library-workbench-status {
    flex-wrap: wrap;
  }

  body.library-entry-active #view-library .main-worksurface.is-entry .result-panel {
    padding: 20px;
  }

  body.library-entry-active #view-library .entry-search-bar,
  body.library-entry-active #view-library .entry-search-main {
    grid-template-columns: 1fr;
  }

  .home-capability-card {
    padding: 18px;
  }
}

/* Site-wide visual unification based on the refined homepage. */
:root {
  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --surface-soft: #F6F8FC;
  --surface-muted: #EEF3FA;
  --line: rgba(15, 35, 70, 0.10);
  --line-strong: rgba(15, 35, 70, 0.16);
  --text: #1F2A37;
  --text-soft: #526173;
  --text-muted: #6B7280;
  --ink: #0F2547;
  --ink-soft: #123C73;
  --accent: #165DFF;
  --accent-deep: #123C73;
  --accent-soft: rgba(22, 93, 255, 0.08);
  --accent-quiet: rgba(22, 93, 255, 0.04);
  --shadow: 0 10px 26px rgba(15, 35, 70, 0.06);
  --shadow-md: 0 16px 34px rgba(15, 35, 70, 0.08);
  --shadow-lg: 0 24px 56px rgba(15, 35, 70, 0.12);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
}

body {
  background:
    radial-gradient(circle at 16% 8%, rgba(22, 93, 255, 0.06), transparent 30%),
    linear-gradient(180deg, #F6F8FC 0%, #F1F5FA 100%);
  color: var(--text);
}

.app-shell {
  background: transparent;
  padding-top: 0 !important;
}

.main-shell,
.view.active,
.page-head,
.compact-head,
.research-shell,
.subscribe-shell,
.compare-context,
.compare-grid {
  width: min(100% - 48px, 1200px);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

#view-library.view.active,
#view-evolution.view.active,
#view-research.view.active,
#view-compare.view.active,
#view-subscribe.view.active,
#view-account.view.active {
  min-width: 0;
}

.topbar {
  width: 100%;
  max-width: none;
  min-height: 64px;
  margin: 0;
  padding: 14px max(24px, calc((100vw - 1200px) / 2));
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto auto minmax(170px, 0.72fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 14px 18px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(15, 35, 70, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(15, 35, 70, 0.04);
}

.topbar::before,
.topbar::after {
  content: none !important;
}

.topbar-brand {
  grid-column: 1;
  grid-row: 1;
}

.topbar-nav {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 999px;
  background: rgba(245, 247, 251, 0.86);
}

.topbar-status {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  padding: 4px;
  border: 1px solid rgba(22, 93, 255, 0.13);
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.06);
}

.topbar-side {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topbar-workbench-strip {
  grid-column: 1 / -1;
  grid-row: 2;
}

.brand-home-btn,
body.library-entry-active .brand-home-btn {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.01em;
  background: transparent;
}

.topbar .nav-item,
.topbar-status .status-pill {
  min-height: 32px;
  padding: 6px 13px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.topbar .nav-item.active,
.topbar .nav-item:hover,
.topbar-status .status-pill.active,
.topbar-status .status-pill:hover {
  color: var(--accent-deep);
  background: #FFFFFF;
  border-color: rgba(22, 93, 255, 0.14);
  box-shadow: 0 8px 18px rgba(15, 35, 70, 0.08);
  transform: none;
}

.topbar-status .status-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.topbar-status .status-pill#library-switch-sep,
.topbar-status #status-pill-workbench,
.topbar-status #status-pill-governance,
.topbar-nav .nav-item[data-view="sep"],
.topbar-nav .nav-item[data-view="subscribe"],
.topbar-nav .nav-item[data-view="account"] {
  display: none !important;
}

.topbar-toggle,
.ghost,
button {
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

button:not(.brand-home-btn):not(.nav-item):not(.status-pill),
.btn-submit {
  min-height: 38px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
}

button:not(.ghost):not(.brand-home-btn):not(.nav-item):not(.status-pill):not(.topbar-toggle),
.btn-submit,
.login-form-actions button:first-child {
  color: #FFFFFF;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  box-shadow: 0 12px 22px rgba(22, 93, 255, 0.18);
}

.ghost,
.topbar-toggle,
.btn-reset,
.utility-link,
.surface-tab {
  color: var(--accent-deep);
  border: 1px solid rgba(22, 93, 255, 0.14);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

.ghost:hover,
.topbar-toggle:hover,
.btn-reset:hover,
.utility-link:hover,
.surface-tab:hover {
  color: var(--accent);
  border-color: rgba(22, 93, 255, 0.24);
  background: rgba(22, 93, 255, 0.07);
  transform: translateY(-1px);
}

button:disabled,
.ghost:disabled,
.topbar-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

input,
select,
textarea,
.search-input {
  border: 1px solid rgba(15, 35, 70, 0.12);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus,
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.12);
  outline: none;
}

.library-workbench-strip,
.topbar-workbench-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(22, 93, 255, 0.16);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(22, 93, 255, 0.08), rgba(255, 255, 255, 0.94) 56%),
    #FFFFFF;
  box-shadow: var(--shadow);
}

.library-workbench-copy strong {
  color: var(--accent-deep);
  font-size: 15px;
  font-weight: 800;
}

.library-workbench-copy span,
.workbench-recent-text {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
}

.workbench-count-pill,
.compare-pill,
.search-meta-item,
.search-badge,
.result-pill,
.detail-state-pill,
.detail-reading-badge,
.graph-role-badge,
.quality-inline-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(22, 93, 255, 0.12);
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.07);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.panel,
.inner-panel,
.dashboard-left,
.dashboard-main,
.search-toolbar-panel,
.main-toolbar,
.detail-panel,
.compare-dock-panel,
.research-side-panel,
.research-main,
.subscribe-card,
.report-meta-item,
.quality-card,
.graph-problem-card,
.graph-timeline-card,
.graph-case-card,
.graph-context-card,
.research-overview-card,
.research-side-status-card,
.research-workbench-panel,
.compare-column,
.compare-block,
.compare-overview-card,
.modal-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.panel-head,
.page-head,
.research-head,
.compact-head {
  border-color: rgba(15, 35, 70, 0.08);
}

.panel-head h3,
.page-head h2,
.research-head h2,
.preview-head-copy h3 {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.panel-subhead,
.field-note,
.toolbar-meta,
.search-facts-line,
.search-snippet p,
.detail-section-note {
  color: var(--text-soft);
}

.library-dashboard,
.evolution-dashboard {
  width: min(100%, 1200px);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  gap: 18px;
}

body:not(.library-entry-active) #view-library .library-dashboard,
#view-evolution .library-dashboard,
#view-evolution .evolution-dashboard {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
}

.dashboard-left {
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.filter-group,
.filter-group-advanced,
.filter-group-collapsible,
.entry-advanced-panel,
.entry-source-type-block {
  border-color: rgba(15, 35, 70, 0.09);
  border-radius: var(--radius-md);
  background: rgba(246, 248, 252, 0.72);
}

.filter-group-head,
.filter-group summary {
  color: var(--ink);
  font-weight: 800;
}

.left-panel-footer {
  border-top-color: rgba(15, 35, 70, 0.08);
}

.main-toolbar,
.result-inline-search,
#results-inline-search {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(246, 248, 252, 0.72);
}

.case-list,
.graph-case-list,
.sep-case-list,
.workbench-case-list,
.folder-list,
.card-list,
.report-list {
  display: grid;
  gap: 14px;
}

.case-item,
.workbench-case-item,
.folder-item,
.card-item,
.sep-case-card,
.graph-case-card,
.related-case-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  box-shadow: 0 8px 20px rgba(15, 35, 70, 0.04);
}

.case-item::after,
.workbench-case-item::after,
.folder-item::after,
.card-item::after,
.detail-section::after,
.detail-highlight-card::after,
.compare-block::after,
.research-overview-card::after {
  content: none !important;
}

.case-item:hover,
.workbench-case-item:hover,
.folder-item:hover,
.card-item:hover,
.sep-case-card:hover,
.graph-case-card:hover,
.related-case-card:hover {
  border-color: rgba(22, 93, 255, 0.22);
  box-shadow: 0 16px 34px rgba(15, 35, 70, 0.08);
  transform: translateY(-1px);
}

.case-item.active,
.folder-item.active,
.card-item.active {
  border-color: rgba(22, 93, 255, 0.42);
  background: linear-gradient(180deg, #FFFFFF 0%, rgba(22, 93, 255, 0.04) 100%);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.08), var(--shadow);
}

.case-item h4,
.workbench-case-item h4,
.folder-item h4,
.card-item h4,
.graph-case-card strong,
.related-case-card strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 800;
}

.search-meta-line,
.search-badge-row,
.detail-meta,
.detail-tags,
.quality-inline-meta,
.case-actions,
.workbench-case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-snippet,
.detail-highlight-card,
.sample-alert,
.detail-workspace-bar,
.detail-graph-link,
.original-text-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(246, 248, 252, 0.72);
}

.search-snippet {
  padding: 12px 14px;
}

.snippet-label {
  color: var(--accent-deep);
  font-weight: 800;
}

.pagination {
  justify-content: center;
  gap: 8px;
  padding: 18px 0 4px;
}

.pagination button,
.pagination .ghost {
  min-width: 40px;
  height: 38px;
  border-radius: var(--radius-xs);
}

.pagination-copy {
  min-width: 110px;
  color: var(--text-soft);
  text-align: center;
}

.empty-state {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 120px;
  padding: 24px;
  border: 1px dashed rgba(22, 93, 255, 0.22);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 248, 252, 0.78));
  color: var(--text-soft);
  text-align: center;
  line-height: 1.7;
}

.empty-state.large {
  min-height: 220px;
  padding: 40px;
}

.case-detail,
.detail-reading-main,
.preview-content {
  color: var(--text);
}

.detail-reading-layout {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
}

.detail-toc {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  box-shadow: var(--shadow);
}

.detail-toc-title {
  color: var(--ink);
  font-weight: 800;
}

.detail-toc a {
  border-left: 3px solid transparent;
  color: var(--text-soft);
}

.detail-toc a:hover,
.detail-toc a.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.detail-intro,
.detail-section,
.detail-highlight-card,
.detail-graph-link,
.detail-workspace-bar,
.original-text-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #FFFFFF;
  box-shadow: var(--shadow);
}

.detail-intro h3,
.detail-headline h3 {
  color: var(--ink);
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.45;
  font-weight: 850;
}

.detail-highlight-card {
  border-left: 4px solid var(--accent);
  background: linear-gradient(180deg, rgba(22, 93, 255, 0.06), rgba(255, 255, 255, 0.96));
}

.detail-section h4 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.detail-richtext,
.detail-section pre,
.preview-content,
.preview-raw-paragraph,
.preview-section-body {
  color: #253047;
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.detail-overview-strip,
.detail-info-table {
  border-color: var(--line);
  border-radius: var(--radius-md);
}

.detail-info-table dt {
  background: var(--surface-soft);
  color: var(--text-soft);
}

.modal-backdrop {
  background: rgba(9, 18, 32, 0.58);
  backdrop-filter: blur(8px);
}

.modal-panel {
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 52px);
  padding: 22px;
  border-radius: var(--radius-xl);
  background: #FFFFFF;
  box-shadow: var(--shadow-lg);
}

#preview-modal .modal-panel {
  width: min(1180px, calc(100vw - 48px));
}

.preview-content {
  max-height: min(70vh, 760px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #FFFFFF;
}

.preview-section,
.preview-heading-card,
.preview-editor {
  border-color: var(--line);
  border-radius: var(--radius-lg);
  background: #FFFFFF;
}

.login-form,
.editor-form {
  gap: 14px;
}

.login-form .stack-field,
.editor-form .stack-field,
.stack-field {
  display: grid;
  gap: 7px;
}

.stack-field span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.login-code-row {
  gap: 12px;
}

.login-form-actions {
  padding-top: 4px;
}

.login-form-actions button {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius-sm);
}

#login-error,
.panel-subhead.error {
  padding: 10px 12px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.07);
  color: #B42318;
}

.evolution-dashboard .dashboard-main,
.graph-problem-card,
.graph-timeline-card,
.graph-context-card,
.graph-case-card {
  background: #FFFFFF;
}

.graph-axis-node,
.graph-reading-step,
.topic-chip,
.library-topic-chip,
.source-type-chip,
.administrative-subfilter-chip,
.composite-role-chip {
  border-radius: 999px;
  border-color: rgba(22, 93, 255, 0.14);
  background: #FFFFFF;
  color: var(--accent-deep);
}

.graph-axis-node.active,
.topic-chip.active,
.library-topic-chip.active,
.source-type-chip.active,
.administrative-subfilter-chip.active,
.composite-role-chip.active {
  color: #FFFFFF;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  box-shadow: 0 10px 20px rgba(22, 93, 255, 0.16);
}

.research-shell {
  padding: 0;
  gap: 18px;
}

.research-grid {
  gap: 18px;
}

.research-overview-strip {
  gap: 14px;
}

.research-overview-card,
.research-side-status-card {
  background: #FFFFFF;
}

.compare-context {
  margin-top: 18px;
  margin-bottom: 14px;
}

.compare-grid {
  padding: 0;
}

.compare-column {
  padding: 18px;
}

.site-footer,
.footer-content {
  width: min(100% - 48px, 1200px);
  margin: 44px auto 22px;
  color: var(--text-muted);
  font-size: 12px;
}

@media (max-width: 1280px) {
  .main-shell,
  .view.active,
  .page-head,
  .compact-head,
  .research-shell,
  .subscribe-shell,
  .compare-context,
  .compare-grid {
    width: min(100% - 36px, 1200px);
  }

  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 1024px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 18px;
  }

  .topbar-brand,
  .topbar-nav,
  .topbar-status,
  .topbar-side,
  .topbar-workbench-strip {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }

  .topbar-nav,
  .topbar-status .status-pills,
  .topbar-side {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .library-workbench-strip,
  .topbar-workbench-strip {
    grid-template-columns: 1fr;
  }

  body:not(.library-entry-active) #view-library .library-dashboard,
  #view-evolution .library-dashboard,
  #view-evolution .evolution-dashboard,
  .research-shell,
  .research-grid,
  .detail-reading-layout,
  .compare-grid-row {
    grid-template-columns: 1fr;
  }

  .detail-toc {
    position: static;
  }
}

@media (max-width: 720px) {
  .main-shell,
  .view.active,
  .page-head,
  .compact-head,
  .research-shell,
  .subscribe-shell,
  .compare-context,
  .compare-grid,
  .site-footer,
  .footer-content {
    width: min(100% - 24px, 1200px);
  }

  .panel,
  .inner-panel,
  .modal-panel,
  .case-item,
  .detail-section,
  .detail-intro,
  .detail-highlight-card {
    border-radius: var(--radius-md);
  }

  .modal-panel {
    width: min(100% - 24px, 1120px);
    padding: 16px;
  }

  .preview-head-actions,
  .case-actions,
  .workbench-case-actions,
  .left-panel-actions,
  .utility-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .preview-head-actions button,
  .case-actions button,
  .workbench-case-actions button,
  .left-panel-actions button,
  .utility-actions button {
    width: 100%;
  }

  .detail-richtext,
  .detail-section pre,
  .preview-content,
  .preview-raw-paragraph,
  .preview-section-body {
    font-size: 14px;
    line-height: 1.8;
  }
}

/* Final results-list overrides: keep the case-search page aligned with the homepage system. */
body:not(.library-entry-active) #view-library .library-dashboard {
  width: min(100% - 48px, 1280px);
  max-width: 1280px;
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: minmax(280px, 310px) minmax(0, 1fr) !important;
  gap: 24px;
  align-items: start;
}

body:not(.library-entry-active) #view-library .dashboard-left {
  width: auto;
  min-width: 0;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(15, 35, 70, 0.08);
}

body:not(.library-entry-active) #view-library .left-panel-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  display: grid;
  gap: 12px;
}

body:not(.library-entry-active) #view-library .dashboard-left .panel-head {
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

body:not(.library-entry-active) #view-library .dashboard-left .panel-head h3 {
  font-size: 18px;
  font-weight: 850;
}

body:not(.library-entry-active) #view-library .filter-group {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  background: #f8faff;
  box-shadow: none;
}

body:not(.library-entry-active) #view-library .filter-group-primary {
  background: linear-gradient(180deg, rgba(22, 93, 255, 0.07), rgba(255, 255, 255, 0.96));
  border-color: rgba(22, 93, 255, 0.16);
}

body:not(.library-entry-active) #view-library .filter-group-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
}

body:not(.library-entry-active) #view-library .filter-group-head h3,
body:not(.library-entry-active) #view-library .filter-group-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

body:not(.library-entry-active) #view-library .filter-group-head p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

body:not(.library-entry-active) #view-library .filter-group-step {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

body:not(.library-entry-active) #view-library .stack-field span,
body:not(.library-entry-active) #view-library .stack-field label {
  color: #3f4c5a;
  font-size: 13px;
  font-weight: 750;
}

body:not(.library-entry-active) #view-library .left-panel-body input,
body:not(.library-entry-active) #view-library .left-panel-body select {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(15, 35, 70, 0.1);
  background: #fff;
  font-size: 13px;
}

body:not(.library-entry-active) #view-library .left-panel-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 10px -2px -2px;
  padding: 16px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 24%, #fff);
}

body:not(.library-entry-active) #view-library .left-panel-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body:not(.library-entry-active) #view-library #search-btn,
body:not(.library-entry-active) #view-library #reset-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 850;
}

body:not(.library-entry-active) #view-library #search-btn {
  background: linear-gradient(135deg, var(--accent), #123c73);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(22, 93, 255, 0.2);
}

body:not(.library-entry-active) #view-library #reset-btn {
  background: #fff;
  color: var(--accent-deep);
  border: 1px solid rgba(22, 93, 255, 0.25);
  box-shadow: none;
}

body:not(.library-entry-active) #view-library .dashboard-main {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body:not(.library-entry-active) #view-library .main-toolbar,
body:not(.library-entry-active) #view-library .result-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 42px rgba(15, 35, 70, 0.07);
}

body:not(.library-entry-active) #view-library .main-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
}

body:not(.library-entry-active) #view-library .main-toolbar.hidden {
  display: none;
}

body:not(.library-entry-active) #view-library .library-topic-chip,
body:not(.library-entry-active) #view-library .quick-filter-chip,
body:not(.library-entry-active) #view-library .administrative-subfilter {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(15, 35, 70, 0.1);
  background: #f7f9fd;
  color: #526173;
  font-size: 12px;
  font-weight: 750;
}

body:not(.library-entry-active) #view-library .library-topic-chip.active,
body:not(.library-entry-active) #view-library .quick-filter-chip.active,
body:not(.library-entry-active) #view-library .administrative-subfilter.active {
  border-color: rgba(22, 93, 255, 0.24);
  background: rgba(22, 93, 255, 0.1);
  color: var(--accent);
}

body:not(.library-entry-active) #view-library .result-panel {
  padding: 18px;
}

body:not(.library-entry-active) #view-library .result-panel > .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

body:not(.library-entry-active) #view-library #library-results-title {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

body:not(.library-entry-active) #view-library .library-filter-summary,
body:not(.library-entry-active) #view-library .results-handoff,
body:not(.library-entry-active) #view-library .result-inline-search {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 16px;
  background: #f8faff;
}

body:not(.library-entry-active) #view-library .case-list {
  display: grid;
  gap: 16px;
}

body:not(.library-entry-active) #view-library .case-item {
  position: relative;
  overflow: visible;
  padding: 18px 20px;
  border: 1px solid rgba(15, 35, 70, 0.09);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 35, 70, 0.055);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body:not(.library-entry-active) #view-library .case-item::before,
body:not(.library-entry-active) #view-library .case-item::after {
  content: none !important;
}

body:not(.library-entry-active) #view-library .case-item:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 93, 255, 0.24);
  box-shadow: 0 18px 36px rgba(15, 35, 70, 0.09);
}

body:not(.library-entry-active) #view-library .result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

body:not(.library-entry-active) #view-library .result-row h4 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

body:not(.library-entry-active) #view-library .result-year,
body:not(.library-entry-active) #view-library .search-meta-item,
body:not(.library-entry-active) #view-library .search-badge {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

body:not(.library-entry-active) #view-library .result-year {
  min-width: 58px;
  height: 30px;
  padding: 0 10px;
  background: rgba(22, 93, 255, 0.09);
  color: var(--accent);
}

body:not(.library-entry-active) #view-library .search-meta-item {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  background: #f7f9fd;
  color: #526173;
}

body:not(.library-entry-active) #view-library .search-badge {
  padding: 5px 9px;
  background: rgba(22, 93, 255, 0.08);
  color: var(--accent-deep);
}

body:not(.library-entry-active) #view-library .search-snippet {
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(15, 35, 70, 0.07);
  border-radius: 14px;
  background: #f8faff;
  color: #3f4c5a;
  font-size: 14px;
  line-height: 1.75;
}

body:not(.library-entry-active) #view-library .search-snippet p {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body:not(.library-entry-active) #view-library .case-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 35, 70, 0.07);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

body:not(.library-entry-active) #view-library .case-actions button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}

body:not(.library-entry-active) #view-library .case-actions button[data-action="open"] {
  background: linear-gradient(135deg, var(--accent), #123c73);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 20px rgba(22, 93, 255, 0.16);
}

body:not(.library-entry-active) #view-library .pagination {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 35, 70, 0.055);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body:not(.library-entry-active) #view-library .pagination button,
body:not(.library-entry-active) #view-library .pagination .ghost,
body:not(.library-entry-active) #view-library .pagination .page-number {
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(15, 35, 70, 0.1);
  background: #fff;
  color: #526173;
  font-size: 13px;
  font-weight: 750;
}

body:not(.library-entry-active) #view-library #list-empty {
  min-height: 190px;
  padding: 28px;
  border: 1px dashed rgba(22, 93, 255, 0.24);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f8faff);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

body:not(.library-entry-active) #view-library #list-empty::before {
  content: "未找到匹配案例";
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}

@media (max-width: 1120px) {
  body:not(.library-entry-active) #view-library .library-dashboard {
    width: min(100% - 32px, 1200px);
    grid-template-columns: minmax(248px, 280px) minmax(0, 1fr) !important;
    gap: 18px;
  }

  body:not(.library-entry-active) #view-library .main-toolbar,
  body:not(.library-entry-active) #view-library .result-panel > .panel-head {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body:not(.library-entry-active) #view-library .library-dashboard {
    width: min(100% - 28px, 760px);
    grid-template-columns: 1fr !important;
  }

  body:not(.library-entry-active) #view-library .dashboard-left {
    position: static;
    max-height: none;
    overflow: visible;
  }

  body:not(.library-entry-active) #view-library .left-panel-body {
    max-height: none;
    overflow: visible;
  }

  body:not(.library-entry-active) #view-library .left-panel-footer {
    position: static;
  }
}

@media (max-width: 720px) {
  body:not(.library-entry-active) #view-library .library-dashboard {
    width: min(100% - 24px, 560px);
    margin-top: 16px;
  }

  body:not(.library-entry-active) #view-library .result-row {
    grid-template-columns: 1fr;
  }

  body:not(.library-entry-active) #view-library .case-actions {
    justify-content: stretch;
  }

  body:not(.library-entry-active) #view-library .case-actions button {
    width: 100%;
  }
}

/* Final detail-page overrides: professional long-form legal reading layout. */
body.library-reading-active #view-library .library-dashboard {
  width: min(100% - 48px, 1360px);
  max-width: 1360px;
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) !important;
  gap: 24px;
  align-items: start;
}

body.library-reading-active #view-library .dashboard-left {
  width: auto;
  min-width: 0;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 32px rgba(15, 35, 70, 0.065);
}

body.library-reading-active #view-library .dashboard-left .panel-head {
  padding: 0 0 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

body.library-reading-active #view-library .dashboard-left .panel-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
}

body.library-reading-active #view-library .dashboard-left .panel-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

body.library-reading-active #view-library .left-panel-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  display: grid;
  gap: 10px;
}

body.library-reading-active #view-library .filter-group {
  padding: 12px;
  border-radius: 15px;
  border: 1px solid rgba(15, 35, 70, 0.075);
  background: #f8faff;
  box-shadow: none;
}

body.library-reading-active #view-library .filter-group-head h3,
body.library-reading-active #view-library .filter-group-head h4 {
  font-size: 13px;
  font-weight: 850;
}

body.library-reading-active #view-library .filter-group-head p {
  font-size: 12px;
  line-height: 1.5;
}

body.library-reading-active #view-library .left-panel-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 10px -2px -2px;
  padding: 14px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 24%, #fff);
}

body.library-reading-active #view-library .left-panel-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body.library-reading-active #view-library .dashboard-main {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.library-reading-active #view-library .detail-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.library-reading-active #view-library .detail-head {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(15, 35, 70, 0.065);
}

body.library-reading-active #view-library .detail-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}

body.library-reading-active #view-library .detail-head .panel-subhead {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

body.library-reading-active #view-library .detail-head #back-to-results-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(22, 93, 255, 0.24);
  background: #fff;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 850;
}

body.library-reading-active #view-library .case-detail {
  width: 100%;
  padding: 0;
}

body.library-reading-active #view-library .detail-reading-layout {
  display: grid;
  grid-template-columns: minmax(180px, 210px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

body.library-reading-active #view-library .detail-toc {
  position: sticky;
  top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 32px rgba(15, 35, 70, 0.065);
}

body.library-reading-active #view-library .detail-toc-title {
  padding: 0 0 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

body.library-reading-active #view-library .detail-toc a {
  position: relative;
  display: block;
  margin: 3px 0;
  padding: 9px 10px 9px 14px;
  border-left: 3px solid transparent;
  border-radius: 12px;
  color: #526173;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
  text-decoration: none;
}

body.library-reading-active #view-library .detail-toc a:hover,
body.library-reading-active #view-library .detail-toc a.active {
  border-left-color: var(--accent);
  background: rgba(22, 93, 255, 0.08);
  color: var(--accent-deep);
}

body.library-reading-active #view-library .detail-reading-main {
  min-width: 0;
  max-width: 920px;
}

body.library-reading-active #view-library .detail-intro,
body.library-reading-active #view-library .detail-graph-link,
body.library-reading-active #view-library .sample-alert,
body.library-reading-active #view-library .detail-workspace-bar,
body.library-reading-active #view-library .detail-section,
body.library-reading-active #view-library .detail-highlight-card,
body.library-reading-active #view-library .original-text-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 16px 38px rgba(15, 35, 70, 0.065);
}

body.library-reading-active #view-library .detail-intro {
  padding: 24px;
  margin-bottom: 18px;
}

body.library-reading-active #view-library .detail-kicker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

body.library-reading-active #view-library .detail-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

body.library-reading-active #view-library .detail-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f7f9fd;
  color: #526173;
  font-size: 12px;
  font-weight: 800;
}

body.library-reading-active #view-library .detail-state-pill.active {
  background: rgba(22, 93, 255, 0.1);
  color: var(--accent-deep);
}

body.library-reading-active #view-library .detail-state-pill.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

body.library-reading-active #view-library .detail-intro h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 850;
  line-height: 1.36;
  letter-spacing: -0.02em;
}

body.library-reading-active #view-library .detail-intro .detail-actions {
  display: none;
}

body.library-reading-active #view-library .detail-meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.library-reading-active #view-library .detail-meta .badge,
body.library-reading-active #view-library .detail-reading-badge {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  background: #f7f9fd;
  color: #526173;
  font-size: 12px;
  font-weight: 750;
}

body.library-reading-active #view-library .detail-reading-badge.is-guiding,
body.library-reading-active #view-library .detail-reading-badge.is-reference {
  border-color: rgba(22, 93, 255, 0.22);
  background: rgba(22, 93, 255, 0.08);
  color: var(--accent-deep);
}

body.library-reading-active #view-library .detail-overview-strip,
body.library-reading-active #view-library .detail-info-table {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 16px;
  background: #f8faff;
}

body.library-reading-active #view-library .detail-overview-strip span,
body.library-reading-active #view-library .detail-info-table dt,
body.library-reading-active #view-library .detail-info-table dd {
  min-width: 0;
  margin: 0;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(15, 35, 70, 0.07);
  color: var(--ink);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

body.library-reading-active #view-library .detail-overview-strip em,
body.library-reading-active #view-library .detail-info-table dt {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

body.library-reading-active #view-library .detail-info-table dt {
  background: rgba(15, 35, 70, 0.025);
}

body.library-reading-active #view-library .detail-highlight-card {
  position: relative;
  margin-top: 22px;
  padding: 24px 26px;
  border-left: 5px solid var(--accent);
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.09), rgba(255, 255, 255, 0.98));
}

body.library-reading-active #view-library .detail-highlight-card span {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.12);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 850;
}

body.library-reading-active #view-library .detail-highlight-card strong {
  display: block;
  margin: 12px 0 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.82;
}

body.library-reading-active #view-library .detail-highlight-card p {
  margin: 0;
  color: #3f4c5a;
  font-size: 15px;
  line-height: 1.85;
}

body.library-reading-active #view-library .detail-section {
  padding: 24px;
  margin-bottom: 18px;
  scroll-margin-top: 28px;
}

body.library-reading-active #view-library .detail-section h4 {
  position: relative;
  margin: 0 0 16px;
  padding-left: 14px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.4;
}

body.library-reading-active #view-library .detail-section h4::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
}

body.library-reading-active #view-library .detail-richtext,
body.library-reading-active #view-library .detail-section pre {
  color: #2f3b49;
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
}

body.library-reading-active #view-library .detail-richtext p {
  margin: 0 0 14px;
}

body.library-reading-active #view-library .detail-graph-link,
body.library-reading-active #view-library .sample-alert,
body.library-reading-active #view-library .detail-workspace-bar {
  padding: 18px 20px;
  margin-bottom: 18px;
}

body.library-reading-active #view-library .detail-graph-link strong,
body.library-reading-active #view-library .workspace-bar-copy strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

body.library-reading-active #view-library .detail-graph-link span,
body.library-reading-active #view-library .workspace-bar-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

body.library-reading-active #view-library .original-text-card {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.07), #fff);
}

body.library-reading-active #view-library .original-text-copy p {
  margin: 0;
  color: #3f4c5a;
  font-size: 14px;
  line-height: 1.7;
}

body.library-reading-active #view-library .original-text-actions button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #123c73);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 12px 24px rgba(22, 93, 255, 0.16);
}

body.library-reading-active #view-library .detail-laws,
body.library-reading-active #view-library .detail-law-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.library-reading-active #view-library .detail-laws li,
body.library-reading-active #view-library .detail-laws span,
body.library-reading-active #view-library .detail-laws p,
body.library-reading-active #view-library .detail-law-item {
  max-width: 100%;
  margin: 0;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  background: #f7f9fd;
  color: #526173;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body.library-reading-active #view-library .related-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  overflow: visible;
  padding-bottom: 0;
}

body.library-reading-active #view-library .related-case-card {
  padding: 16px;
  border: 1px solid rgba(15, 35, 70, 0.09);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 35, 70, 0.055);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body.library-reading-active #view-library .related-case-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 93, 255, 0.24);
  box-shadow: 0 18px 36px rgba(15, 35, 70, 0.09);
}

body.library-reading-active #view-library .related-case-card strong {
  display: -webkit-box;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.library-reading-active #view-library .related-case-card p {
  display: -webkit-box;
  color: #3f4c5a;
  font-size: 13px;
  line-height: 1.65;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.library-reading-active #view-library .related-case-card .case-actions button,
body.library-reading-active #view-library .detail-graph-link .case-actions button,
body.library-reading-active #view-library .workspace-bar-actions button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}

body.library-reading-active #view-library .related-case-card .case-actions button:not(.ghost),
body.library-reading-active #view-library .workspace-bar-actions button:not(.ghost) {
  background: linear-gradient(135deg, var(--accent), #123c73);
  color: #fff;
  border-color: transparent;
}

body.library-reading-active #view-library .detail-workspace-bar-compact {
  position: sticky;
  bottom: 16px;
  z-index: 12;
}

@media (max-width: 1180px) {
  body.library-reading-active #view-library .library-dashboard {
    width: min(100% - 32px, 1240px);
    grid-template-columns: minmax(236px, 270px) minmax(0, 1fr) !important;
    gap: 18px;
  }

  body.library-reading-active #view-library .detail-reading-layout {
    grid-template-columns: 1fr;
  }

  body.library-reading-active #view-library .detail-toc {
    position: static;
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  body.library-reading-active #view-library .detail-toc-title {
    flex: 0 0 auto;
    margin: 0;
    padding: 9px 10px;
    border: 0;
  }

  body.library-reading-active #view-library .detail-toc a {
    flex: 0 0 auto;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  body.library-reading-active #view-library .detail-toc a.active,
  body.library-reading-active #view-library .detail-toc a:hover {
    border-bottom-color: var(--accent);
  }
}

@media (max-width: 900px) {
  body.library-reading-active #view-library .library-dashboard {
    width: min(100% - 28px, 820px);
    grid-template-columns: 1fr !important;
  }

  body.library-reading-active #view-library .dashboard-left {
    position: static;
    max-height: none;
    overflow: visible;
  }

  body.library-reading-active #view-library .left-panel-body {
    max-height: none;
    overflow: visible;
  }

  body.library-reading-active #view-library .left-panel-footer,
  body.library-reading-active #view-library .detail-workspace-bar-compact {
    position: static;
  }
}

@media (max-width: 720px) {
  body.library-reading-active #view-library .library-dashboard {
    width: min(100% - 24px, 560px);
    margin-top: 16px;
  }

  body.library-reading-active #view-library .detail-head,
  body.library-reading-active #view-library .detail-intro,
  body.library-reading-active #view-library .detail-section,
  body.library-reading-active #view-library .detail-highlight-card,
  body.library-reading-active #view-library .original-text-card,
  body.library-reading-active #view-library .related-case-card,
  body.library-reading-active #view-library .detail-toc {
    border-radius: 16px;
  }

  body.library-reading-active #view-library .detail-head,
  body.library-reading-active #view-library .detail-overview-strip,
  body.library-reading-active #view-library .detail-info-table,
  body.library-reading-active #view-library .original-text-card,
  body.library-reading-active #view-library .detail-workspace-bar {
    grid-template-columns: 1fr;
  }

  body.library-reading-active #view-library .detail-intro h3 {
    font-size: 22px;
  }

  body.library-reading-active #view-library .workspace-bar-actions,
  body.library-reading-active #view-library .original-text-actions,
  body.library-reading-active #view-library .case-actions {
    width: 100%;
  }

  body.library-reading-active #view-library .workspace-bar-actions button,
  body.library-reading-active #view-library .original-text-actions button,
  body.library-reading-active #view-library .case-actions button {
    width: 100%;
  }
}

/* Final rule-evolution overrides: rule research workbench visual system. */
#view-evolution.view.active {
  width: 100%;
  max-width: none;
}

#view-evolution .evolution-dashboard,
#view-evolution .library-dashboard {
  width: min(100% - 48px, 1360px);
  max-width: 1360px;
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(280px, 320px);
  gap: 24px;
  align-items: start;
}

#view-evolution .dashboard-left,
#view-evolution .dashboard-right {
  width: auto;
  min-width: 0;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 16px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(15, 35, 70, 0.07);
}

#view-evolution .dashboard-main {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#view-evolution .left-panel-body,
#view-evolution .right-panel-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  display: grid;
  gap: 14px;
}

#view-evolution .dashboard-left .panel-head,
#view-evolution .dashboard-right .panel-head {
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

#view-evolution .dashboard-left .panel-head h3,
#view-evolution .dashboard-right .panel-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
}

#view-evolution .dashboard-left .panel-subhead,
#view-evolution .dashboard-right .panel-subhead {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

#view-evolution .panel-tag,
#view-evolution .pro-tag {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(22, 93, 255, 0.18);
  background: rgba(22, 93, 255, 0.08);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

#view-evolution .sep-topic-list {
  display: grid;
  gap: 8px;
}

#view-evolution .sep-topic-list button,
#view-evolution .topic-chip,
#view-evolution .library-topic-chip {
  width: 100%;
  justify-content: flex-start;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 35, 70, 0.09);
  background: #fff;
  color: #526173;
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
}

#view-evolution .sep-topic-list button:hover,
#view-evolution .topic-chip:hover,
#view-evolution .library-topic-chip:hover {
  border-color: rgba(22, 93, 255, 0.24);
  background: rgba(22, 93, 255, 0.06);
  color: var(--accent-deep);
}

#view-evolution .sep-topic-list button.active,
#view-evolution .topic-chip.active,
#view-evolution .library-topic-chip.active {
  border-color: rgba(22, 93, 255, 0.34);
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.12), #fff);
  color: var(--accent-deep);
  box-shadow: inset 3px 0 0 var(--accent);
}

#view-evolution .utility-block {
  padding: 14px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 18px;
  background: #f8faff;
}

#view-evolution .utility-block-head {
  margin-bottom: 10px;
}

#view-evolution .utility-block-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

#view-evolution .graph-side-list {
  display: grid;
  gap: 9px;
}

#view-evolution .graph-side-item {
  position: relative;
  padding: 12px 13px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

#view-evolution .graph-side-item:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 93, 255, 0.22);
  box-shadow: 0 10px 22px rgba(15, 35, 70, 0.07);
}

#view-evolution .graph-side-item strong {
  display: -webkit-box;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#view-evolution .graph-question-card.active {
  border-color: rgba(22, 93, 255, 0.34);
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.12), #fff);
  box-shadow: inset 4px 0 0 var(--accent), 0 12px 26px rgba(22, 93, 255, 0.09);
}

#view-evolution .graph-question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#view-evolution .graph-question-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f7f9fd;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}

#view-evolution .dashboard-main > .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  gap: 22px;
  align-items: center;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 42px rgba(15, 35, 70, 0.075);
}

#view-evolution .dashboard-main > .panel-head .page-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.05em;
}

#view-evolution .dashboard-main > .panel-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 2.3vw, 30px);
  font-weight: 850;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

#view-evolution #graph-topic-summary {
  max-width: 720px;
  margin-top: 8px;
  color: #3f4c5a;
  font-size: 14px;
  line-height: 1.75;
}

#view-evolution .graph-topic-head-actions {
  display: grid;
  gap: 12px;
}

#view-evolution #graph-return-btn {
  justify-self: end;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(22, 93, 255, 0.22);
  background: #fff;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 800;
}

#view-evolution #graph-topic-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#view-evolution #graph-topic-stats .report-meta-item {
  min-height: 76px;
  padding: 12px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 16px;
  background: #f8faff;
  box-shadow: none;
}

#view-evolution #graph-topic-stats .report-meta-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

#view-evolution #graph-topic-stats .report-meta-item strong {
  display: -webkit-box;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#view-evolution .graph-problem-block {
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}

#view-evolution .graph-problem-block > .utility-block-head {
  margin-bottom: 10px;
}

#view-evolution .graph-problem-block > .utility-block-head h4 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

#view-evolution .graph-problem-card {
  position: relative;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.08), rgba(255, 255, 255, 0.98));
  box-shadow: 0 16px 38px rgba(15, 35, 70, 0.07);
}

#view-evolution .graph-problem-card strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 850;
  line-height: 1.45;
}

#view-evolution .graph-problem-card p {
  margin: 8px 0 0;
  color: #3f4c5a;
  font-size: 14px;
  line-height: 1.75;
}

#view-evolution .graph-problem-meta,
#view-evolution .graph-problem-actions-compact,
#view-evolution .graph-case-actions-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#view-evolution .search-meta-item,
#view-evolution .search-badge,
#view-evolution .graph-role-badge {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

#view-evolution .graph-problem-brief-compact {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#view-evolution .graph-problem-brief-chip {
  padding: 12px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 16px;
  background: #fff;
  color: #3f4c5a;
  font-size: 12px;
  line-height: 1.65;
}

#view-evolution .graph-problem-brief-chip em {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.09);
  color: var(--accent-deep);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

#view-evolution .graph-reading-path {
  margin-top: 6px;
  padding: 13px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 16px;
  background: #fff;
}

#view-evolution .graph-reading-path strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

#view-evolution .graph-reading-path-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#view-evolution .graph-reading-step {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(22, 93, 255, 0.18);
  background: rgba(22, 93, 255, 0.06);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

#view-evolution .graph-reading-step em {
  background: var(--accent);
  color: #fff;
}

#view-evolution .graph-timeline {
  display: grid;
  gap: 18px;
}

#view-evolution .graph-timeline-horizontal {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 42px rgba(15, 35, 70, 0.07);
}

#view-evolution .graph-timeline-horizontal::before {
  content: "规则演化路径";
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

#view-evolution .graph-stage-band {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(130px, 1fr);
  gap: 8px;
}

#view-evolution .graph-stage-chip {
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(22, 93, 255, 0.18);
  background: rgba(22, 93, 255, 0.07);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 850;
}

#view-evolution .graph-timeline-axis {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(126px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding: 14px 2px 18px;
}

#view-evolution .graph-timeline-axis::before {
  top: 42px;
  background: rgba(22, 93, 255, 0.18);
}

#view-evolution .graph-axis-node {
  padding: 0;
  border: 0;
  background: transparent;
}

#view-evolution .graph-axis-year {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

#view-evolution .graph-axis-dot {
  width: 13px;
  height: 13px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(22, 93, 255, 0.1);
}

#view-evolution .graph-axis-keyword,
#view-evolution .graph-axis-role {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

#view-evolution .graph-axis-keyword {
  padding: 5px 8px;
  background: #f7f9fd;
  color: #526173;
}

#view-evolution .graph-axis-node.active .graph-axis-keyword,
#view-evolution .graph-axis-node:hover .graph-axis-keyword {
  background: rgba(22, 93, 255, 0.1);
  color: var(--accent-deep);
}

#view-evolution .graph-timeline-detail {
  padding: 0;
}

#view-evolution .graph-timeline-card,
#view-evolution .graph-case-card,
#view-evolution .graph-context-card {
  border: 1px solid rgba(15, 35, 70, 0.09);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 35, 70, 0.06);
}

#view-evolution .graph-timeline-card {
  padding: 18px;
}

#view-evolution .graph-timeline-meta,
#view-evolution .graph-case-meta,
#view-evolution .graph-context-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

#view-evolution .graph-timeline-meta span,
#view-evolution .graph-case-meta span,
#view-evolution .graph-context-summary span {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  background: #f7f9fd;
  color: #526173;
  font-size: 12px;
  font-weight: 750;
}

#view-evolution .graph-timeline-card h4 {
  margin: 12px 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.5;
}

#view-evolution .graph-delta-block {
  margin-top: 10px;
  padding: 13px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 16px;
  background: #f8faff;
}

#view-evolution .graph-delta-block strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

#view-evolution .graph-delta-block p {
  margin-top: 6px;
  color: #3f4c5a;
  font-size: 13px;
  line-height: 1.7;
}

#view-evolution .graph-shift-chip {
  display: inline-flex;
  width: fit-content;
  margin: 7px 0 2px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.1);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

#view-evolution .graph-case-list {
  display: grid;
  gap: 12px;
}

#view-evolution .graph-case-card {
  padding: 15px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#view-evolution .graph-case-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 93, 255, 0.24);
  box-shadow: 0 18px 36px rgba(15, 35, 70, 0.09);
}

#view-evolution .graph-case-card strong {
  display: -webkit-box;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#view-evolution .graph-case-card p,
#view-evolution .graph-context-line {
  color: #3f4c5a;
  font-size: 13px;
  line-height: 1.65;
}

#view-evolution .graph-context-card {
  padding: 15px;
}

#view-evolution .graph-context-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.5;
}

#view-evolution .graph-context-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 35, 70, 0.07);
}

#view-evolution .graph-context-section h5 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

#view-evolution .case-actions button,
#view-evolution .graph-case-actions-compact button,
#view-evolution .graph-problem-actions-compact button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}

#view-evolution .case-actions button:not(.ghost),
#view-evolution .graph-case-actions-compact button:not(.ghost),
#view-evolution .graph-problem-actions-compact button:not(.ghost) {
  background: linear-gradient(135deg, var(--accent), #123c73);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 20px rgba(22, 93, 255, 0.14);
}

#view-evolution .case-actions button.ghost,
#view-evolution .graph-case-actions-compact button.ghost,
#view-evolution .graph-problem-actions-compact button.ghost {
  background: #fff;
  border: 1px solid rgba(22, 93, 255, 0.22);
  color: var(--accent-deep);
  box-shadow: none;
}

@media (max-width: 1280px) {
  #view-evolution .evolution-dashboard,
  #view-evolution .library-dashboard {
    width: min(100% - 32px, 1180px);
    grid-template-columns: minmax(236px, 276px) minmax(0, 1fr);
  }

  #view-evolution .dashboard-right {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }

  #view-evolution .right-panel-body {
    overflow: visible;
  }

  #view-evolution .graph-case-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  #view-evolution .dashboard-main > .panel-head,
  #view-evolution #graph-topic-stats,
  #view-evolution .graph-problem-brief-compact {
    grid-template-columns: 1fr;
  }

  #view-evolution #graph-return-btn {
    justify-self: start;
  }
}

@media (max-width: 900px) {
  #view-evolution .evolution-dashboard,
  #view-evolution .library-dashboard {
    width: min(100% - 28px, 820px);
    grid-template-columns: 1fr !important;
  }

  #view-evolution .dashboard-left,
  #view-evolution .dashboard-right {
    position: static;
    max-height: none;
    overflow: visible;
  }

  #view-evolution .left-panel-body,
  #view-evolution .right-panel-body {
    overflow: visible;
  }
}

@media (max-width: 720px) {
  #view-evolution .evolution-dashboard,
  #view-evolution .library-dashboard {
    width: min(100% - 24px, 560px);
    margin-top: 16px;
  }

  #view-evolution .dashboard-left,
  #view-evolution .dashboard-main > .panel-head,
  #view-evolution .graph-problem-card,
  #view-evolution .graph-timeline-horizontal,
  #view-evolution .graph-timeline-card,
  #view-evolution .graph-case-card,
  #view-evolution .graph-context-card,
  #view-evolution .dashboard-right {
    border-radius: 16px;
  }

  #view-evolution .graph-stage-band,
  #view-evolution .graph-case-list {
    grid-template-columns: 1fr;
    grid-auto-flow: row;
  }

  #view-evolution .graph-timeline-axis {
    grid-auto-columns: minmax(112px, 150px);
  }

  #view-evolution .case-actions button,
  #view-evolution .graph-case-actions-compact button,
  #view-evolution .graph-problem-actions-compact button {
    width: 100%;
  }
}

/* Evolution header guard: avoid narrow stat column forcing the topic title into vertical wraps. */
#view-evolution .dashboard-main > .panel-head {
  grid-template-columns: 1fr !important;
  align-items: start;
}

#view-evolution .dashboard-main > .panel-head > div:first-child {
  min-width: 0;
  width: 100%;
}

#view-evolution .dashboard-main > .panel-head h3,
#view-evolution #graph-topic-title {
  display: block;
  max-width: none;
  width: 100%;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

#view-evolution .graph-topic-head-actions {
  width: 100%;
}

#view-evolution #graph-topic-stats {
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  #view-evolution #graph-topic-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  #view-evolution #graph-topic-stats {
    grid-template-columns: 1fr;
  }
}

/* Final local-graph modal overrides: professional graph analysis workspace. */
body.knowledge-graph-modal-open {
  overflow: hidden;
}

#knowledge-graph-modal .modal-backdrop {
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(6px);
}

#knowledge-graph-modal .knowledge-graph-modal-panel {
  width: min(100% - 48px, 1400px);
  height: min(860px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(15, 35, 70, 0.1);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 35, 70, 0.24);
  overflow: hidden;
}

#knowledge-graph-modal .modal-panel > .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 0 0 16px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

#knowledge-graph-modal .modal-panel > .panel-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

#knowledge-graph-modal .modal-panel > .panel-head .panel-subhead {
  max-width: 720px;
  margin-top: 6px;
  color: #526173;
  font-size: 13px;
  line-height: 1.65;
}

#knowledge-graph-modal .preview-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

#knowledge-graph-modal .preview-head-actions button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(22, 93, 255, 0.22);
  background: #fff;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
}

#knowledge-graph-modal .preview-head-actions #knowledge-graph-close-icon-btn {
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

#knowledge-graph-modal .knowledge-graph-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 18px;
  background: #f8faff;
}

#knowledge-graph-modal #knowledge-graph-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#knowledge-graph-modal #knowledge-graph-stats .result-pill {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(22, 93, 255, 0.16);
  background: rgba(22, 93, 255, 0.08);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

#knowledge-graph-modal .knowledge-graph-filters {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

#knowledge-graph-modal .knowledge-graph-filters .library-topic-chip {
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(15, 35, 70, 0.1);
  background: #fff;
  color: #526173;
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

#knowledge-graph-modal .knowledge-graph-filters .library-topic-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

#knowledge-graph-modal .knowledge-graph-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
  gap: 20px;
}

#knowledge-graph-modal .knowledge-graph-canvas-wrap {
  min-width: 0;
  min-height: 0;
  position: relative;
  display: grid;
}

#knowledge-graph-modal .knowledge-graph-canvas-wrap::before {
  content: "图谱分析";
  position: absolute;
  z-index: 3;
  left: 16px;
  top: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 35, 70, 0.08);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 850;
  pointer-events: none;
}

#knowledge-graph-modal .knowledge-graph-canvas {
  position: relative;
  min-height: 620px;
  height: 100%;
  border-radius: 22px;
  border: 1px solid rgba(15, 35, 70, 0.09);
  background:
    radial-gradient(circle at 50% 44%, rgba(22, 93, 255, 0.11), transparent 28%),
    linear-gradient(rgba(22, 93, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 93, 255, 0.045) 1px, transparent 1px),
    #f8faff;
  background-size: auto, 28px 28px, 28px 28px, auto;
  overflow: hidden;
}

#knowledge-graph-modal .knowledge-graph-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#knowledge-graph-modal .knowledge-graph-edge {
  stroke: rgba(82, 97, 115, 0.34);
  stroke-width: 1.35;
  pointer-events: none;
}

#knowledge-graph-modal .knowledge-graph-edge.is-derived {
  stroke: rgba(82, 97, 115, 0.24);
  stroke-dasharray: 8 7;
}

#knowledge-graph-modal .knowledge-graph-edge-hit {
  stroke: transparent;
  stroke-width: 18;
  pointer-events: stroke;
}

#knowledge-graph-modal .knowledge-graph-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 150px;
  min-width: 0;
  max-width: 150px;
  min-height: 58px;
  max-height: 86px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(22, 93, 255, 0.18);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 26px rgba(15, 35, 70, 0.11);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

#knowledge-graph-modal .knowledge-graph-node:hover,
#knowledge-graph-modal .knowledge-graph-node.is-selected {
  transform: translate(-50%, -50%) translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(22, 93, 255, 0.12), 0 18px 36px rgba(15, 35, 70, 0.15);
}

#knowledge-graph-modal .knowledge-graph-node strong {
  display: -webkit-box;
  margin: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.42;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#knowledge-graph-modal .knowledge-graph-node span {
  color: rgba(82, 97, 115, 0.9);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

#knowledge-graph-modal .knowledge-graph-node.is-center {
  width: 190px;
  max-width: 190px;
  min-height: 78px;
  padding: 14px 16px;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #123c73);
  color: #fff;
}

#knowledge-graph-modal .knowledge-graph-node.is-center span {
  color: rgba(255, 255, 255, 0.82);
}

#knowledge-graph-modal .knowledge-graph-node.type-topic {
  border-color: rgba(22, 93, 255, 0.34);
  background: rgba(22, 93, 255, 0.1);
  color: var(--accent-deep);
}

#knowledge-graph-modal .knowledge-graph-node.type-case {
  border-color: rgba(22, 93, 255, 0.22);
  background: #fff;
}

#knowledge-graph-modal .knowledge-graph-node.type-issue,
#knowledge-graph-modal .knowledge-graph-node.type-rule {
  border-color: rgba(124, 58, 237, 0.2);
  background: rgba(124, 58, 237, 0.08);
  color: #4c1d95;
}

#knowledge-graph-modal .knowledge-graph-node.type-law {
  border-color: rgba(14, 116, 144, 0.18);
  background: rgba(14, 116, 144, 0.08);
  color: #155e75;
}

#knowledge-graph-modal .knowledge-graph-node.type-cause,
#knowledge-graph-modal .knowledge-graph-node.type-court,
#knowledge-graph-modal .knowledge-graph-node.type-keyword {
  border-color: rgba(82, 97, 115, 0.12);
  background: #f7f9fd;
  color: #3f4c5a;
}

#knowledge-graph-modal .knowledge-graph-sidebar {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(15, 35, 70, 0.09);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 30px rgba(15, 35, 70, 0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 93, 255, 0.22) transparent;
}

#knowledge-graph-modal .knowledge-graph-node-kicker {
  width: fit-content;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.1);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 850;
}

#knowledge-graph-modal .knowledge-graph-sidebar h4 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 850;
  line-height: 1.45;
}

#knowledge-graph-modal .knowledge-graph-summary {
  margin: 0;
  color: #3f4c5a;
  font-size: 13px;
  line-height: 1.7;
}

#knowledge-graph-modal .knowledge-graph-sidebar-section {
  padding-top: 14px;
  border-top: 1px solid rgba(15, 35, 70, 0.08);
}

#knowledge-graph-modal .knowledge-graph-sidebar-section-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

#knowledge-graph-modal .knowledge-graph-node-stats,
#knowledge-graph-modal .knowledge-graph-related-list {
  display: grid;
  gap: 8px;
}

#knowledge-graph-modal .knowledge-graph-node-stats {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

#knowledge-graph-modal .knowledge-graph-related-item,
#knowledge-graph-modal .knowledge-graph-meta-item {
  padding: 11px 12px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 14px;
  background: #f8faff;
}

#knowledge-graph-modal .knowledge-graph-related-item strong {
  display: -webkit-box;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#knowledge-graph-modal .knowledge-graph-related-item span,
#knowledge-graph-modal .knowledge-graph-meta-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

#knowledge-graph-modal .knowledge-graph-meta {
  display: grid;
  gap: 8px;
}

#knowledge-graph-modal .knowledge-graph-meta-item strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.5;
}

#knowledge-graph-modal .knowledge-graph-sidebar-actions button {
  width: 100%;
  min-height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #123c73);
  border-color: transparent;
  color: #fff;
  font-weight: 850;
}

#knowledge-graph-modal .knowledge-graph-tooltip {
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 35, 70, 0.12);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 18px 38px rgba(15, 35, 70, 0.18);
  backdrop-filter: blur(8px);
}

@media (max-width: 1100px) {
  #knowledge-graph-modal .knowledge-graph-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  #knowledge-graph-modal .knowledge-graph-sidebar {
    max-height: 320px;
  }
}

@media (max-width: 768px) {
  #knowledge-graph-modal .knowledge-graph-modal-panel {
    width: min(100% - 20px, 760px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    padding: 14px;
    border-radius: 18px;
  }

  #knowledge-graph-modal .modal-panel > .panel-head,
  #knowledge-graph-modal .knowledge-graph-toolbar {
    grid-template-columns: 1fr;
  }

  #knowledge-graph-modal .preview-head-actions,
  #knowledge-graph-modal .knowledge-graph-filters {
    justify-content: flex-start;
  }

  #knowledge-graph-modal .knowledge-graph-canvas {
    min-height: 520px;
  }
}

/* 原文阅读弹窗：CSS 全屏兜底。必须压过通用 modal-panel 的宽高限制。 */
html.original-fullscreen-open,
body.original-fullscreen-open {
  overflow: hidden !important;
}

body.original-fullscreen-open #preview-modal,
body.original-fullscreen-open .modal.is-original-fullscreen-shell {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 99999 !important;
  display: block !important;
  place-items: stretch !important;
  overflow: hidden !important;
}

body.original-fullscreen-open [data-original-modal-overlay],
body.original-fullscreen-open #preview-backdrop {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 99999 !important;
  display: block !important;
  overflow: hidden !important;
  background: rgba(15, 23, 42, 0.72) !important;
}

body.original-fullscreen-open [data-original-modal],
body.original-fullscreen-open #preview-modal .modal-panel.is-original-fullscreen {
  position: fixed !important;
  inset: 12px !important;
  width: calc(100vw - 24px) !important;
  height: calc(100vh - 24px) !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  transform: none !important;
  border-radius: 18px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  z-index: 100000 !important;
}

body.original-fullscreen-open [data-original-modal] > .panel-head,
body.original-fullscreen-open [data-original-modal] [data-original-modal-header] {
  flex: 0 0 auto !important;
}

body.original-fullscreen-open [data-original-modal-body],
body.original-fullscreen-open [data-original-modal] .original-modal-body,
body.original-fullscreen-open [data-original-modal] .original-text-content,
body.original-fullscreen-open [data-original-modal] .original-preview-body,
body.original-fullscreen-open #preview-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  overflow: auto !important;
}

body.original-fullscreen-open [data-original-modal-body] > *,
body.original-fullscreen-open #preview-content > * {
  max-width: none !important;
}

/* Original text modal: keep long legal/OCR tokens inside the reading pane. */
[data-original-modal] {
  width: min(1180px, calc(100vw - 48px));
  max-width: min(1180px, calc(100vw - 48px));
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
}

[data-original-modal-body],
[data-original-modal] .original-modal-body,
[data-original-modal] .original-preview-body,
[data-original-modal] .original-text-content,
#preview-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.85;
}

[data-original-modal-body] > *,
[data-original-modal] .original-text-content > *,
#preview-content > * {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

[data-original-modal-body] pre,
[data-original-modal] .original-text-content,
[data-original-modal] .original-text-content pre,
[data-original-modal] .original-preview-body pre,
#preview-content .preview-verbatim-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}

[data-original-modal] .original-text-content,
#preview-content .preview-verbatim-text {
  line-height: 1.8;
}

body.original-fullscreen-open [data-original-modal-body],
body.original-fullscreen-open [data-original-modal] .original-modal-body,
body.original-fullscreen-open [data-original-modal] .original-text-content,
body.original-fullscreen-open [data-original-modal] .original-preview-body,
body.original-fullscreen-open #preview-content {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.original-fullscreen-open [data-original-modal-body] > *,
body.original-fullscreen-open #preview-content > *,
body.original-fullscreen-open #preview-content .preview-verbatim-text {
  max-width: 100% !important;
  min-width: 0 !important;
}

/* 用户中心：账号资产仪表盘 */
#view-research .user-center-hero-summary {
  display: none !important;
}

#view-account .user-center-page {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 0 24px 48px;
}

#view-account .user-center-container {
  display: grid;
  gap: 20px;
}

#view-account .user-center-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: center;
  gap: 24px;
  padding: 28px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 12%, rgba(22, 93, 255, 0.08), transparent 30%),
    #fff;
  box-shadow: 0 18px 42px rgba(15, 35, 70, 0.07);
}

#view-account .user-center-hero .page-kicker {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.09);
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

#view-account .user-center-hero h2 {
  margin: 8px 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

#view-account .user-center-hero .page-desc {
  max-width: 660px;
  margin: 0;
  color: #526173;
  font-size: 14px;
  line-height: 1.75;
}

#view-account .user-center-hero-summary {
  display: grid;
  gap: 10px;
}

#view-account .user-center-hero-summary span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 14px;
  background: #f8faff;
  color: #526173;
  font-size: 12px;
  font-weight: 750;
}

#view-account .user-center-hero-summary strong {
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 900;
}

#view-account .account-overview-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 20px;
}

#view-account .account-status-card,
#view-account .asset-overview-card,
#view-account .quick-entry-section,
#view-account .capability-section {
  border: 1px solid rgba(15, 35, 70, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 34px rgba(15, 35, 70, 0.06);
}

#view-account .account-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#view-account .account-info-grid .report-meta-item {
  min-height: 82px;
  border-radius: 14px;
  background: #f8faff;
}

#view-account .account-info-grid .report-meta-item span,
#view-account .asset-stat-card span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

#view-account .account-info-grid .report-meta-item strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

#view-account .account-notice {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(22, 93, 255, 0.14);
  border-radius: 16px;
  background: rgba(22, 93, 255, 0.07);
  display: grid;
  gap: 5px;
}

#view-account .account-notice span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

#view-account .account-notice strong {
  color: #1f2a37;
  font-size: 14px;
  line-height: 1.65;
}

#view-account .account-status-tags {
  margin-top: 14px;
}

#view-account .account-status-tags span {
  padding: 6px 10px;
  border: 1px solid rgba(22, 93, 255, 0.16);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 850;
}

#view-account .subscribe-actions {
  margin-top: 16px;
}

#view-account .subscribe-actions button:first-child,
#view-account .quick-entry-card.is-primary {
  background: linear-gradient(135deg, var(--accent), #123c73);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 22px rgba(22, 93, 255, 0.18);
}

#view-account .asset-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#view-account .asset-stat-card {
  min-height: 124px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 8px;
  border-radius: 16px;
  background: #f8faff;
}

#view-account .asset-stat-card strong {
  color: var(--ink);
  font-size: 30px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

#view-account .asset-stat-card em {
  color: #526173;
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
}

#view-account .asset-stat-card.is-workbench {
  border-color: rgba(22, 93, 255, 0.24);
  background:
    radial-gradient(circle at 88% 12%, rgba(22, 93, 255, 0.12), transparent 32%),
    #f4f8ff;
}

#view-account .asset-stat-card.is-workbench strong {
  color: var(--accent);
}

#view-account .quick-entry-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

#view-account .quick-entry-card {
  min-height: 104px;
  padding: 15px;
  display: grid;
  align-content: start;
  gap: 7px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(15, 35, 70, 0.1);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

#view-account .quick-entry-card strong {
  font-size: 14px;
  font-weight: 900;
}

#view-account .quick-entry-card span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

#view-account .quick-entry-card:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 93, 255, 0.24);
  box-shadow: 0 12px 26px rgba(15, 35, 70, 0.08);
}

#view-account .capability-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

#view-account .capability-block {
  min-height: 100%;
  padding: 17px;
  border-radius: 18px;
  display: grid;
  align-content: start;
  gap: 10px;
}

#view-account .capability-block h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

#view-account .capability-block h4::after {
  content: "当前可用";
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(22, 93, 255, 0.1);
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 850;
}

#view-account .capability-block.is-limited h4::after {
  content: "需升级";
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

#view-account .capability-block.is-backstage h4::after {
  content: "后台角色";
  background: rgba(124, 58, 237, 0.1);
  color: #5b21b6;
}

#view-account .capability-block p {
  color: #526173;
  font-size: 13px;
  line-height: 1.65;
}

#view-account .capability-list {
  padding-left: 18px;
  gap: 8px;
}

#view-account .capability-list li {
  color: #334155;
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 1100px) {
  #view-account .user-center-hero,
  #view-account .account-overview-grid {
    grid-template-columns: 1fr;
  }

  #view-account .quick-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-account .capability-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #view-account .user-center-page {
    padding: 0 14px 36px;
  }

  #view-account .user-center-hero,
  #view-account .account-status-card,
  #view-account .asset-overview-card,
  #view-account .quick-entry-section,
  #view-account .capability-section {
    border-radius: 18px;
    padding: 18px;
  }

  #view-account .account-info-grid,
  #view-account .asset-stat-grid,
  #view-account .quick-entry-grid {
    grid-template-columns: 1fr;
  }
}

/* Favorite action state guard. */
body:not(.library-entry-active) #view-library .case-actions .favorite-btn.is-active,
body:not(.library-entry-active) #view-library .case-actions button[data-action="toggle-favorite"].is-active {
  background: rgba(22, 93, 255, 0.1);
  border-color: rgba(22, 93, 255, 0.34);
  color: var(--accent-deep);
}

/* Final related-cases layout override: fixed 2-column grid, no horizontal scroll. */
#view-library #detail-related-cases,
#view-library #detail-related-cases .related-case-grid,
body.library-reading-active #view-library #detail-related-cases,
body.library-reading-active #view-library #detail-related-cases .related-case-grid {
  overflow: visible !important;
}

#view-library #detail-related-cases .related-case-grid,
body.library-reading-active #view-library #detail-related-cases .related-case-grid {
  display: grid !important;
  grid-auto-flow: row !important;
  grid-auto-columns: unset !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  width: 100%;
  padding-bottom: 0 !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  scroll-snap-type: none !important;
  white-space: normal !important;
}

#view-library #detail-related-cases .related-case-card,
body.library-reading-active #view-library #detail-related-cases .related-case-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: none !important;
  scroll-snap-align: unset !important;
}

#view-library #detail-related-cases .related-case-card *,
body.library-reading-active #view-library #detail-related-cases .related-case-card * {
  min-width: 0;
}

@media (max-width: 1024px) {
  #view-library #detail-related-cases .related-case-grid,
  body.library-reading-active #view-library #detail-related-cases .related-case-grid {
    grid-template-columns: 1fr !important;
  }
}
