:root {
  --bg-page: #f2f3f7;
  --bg-panel: #f8f9fc;
  --bg-card: #ffffff;
  --line: #dfe3eb;
  --line-strong: #cdd4df;
  --text-strong: #222733;
  --text-normal: #4d5666;
  --text-soft: #7d879a;
  --accent: #4c73ff;
  --warn: #dc2626;
  --success: #15803d;
  --col2-width: 224px;
  --col3-width: 336px;
  --col2-width-md: 200px;
  --col3-width-md: 288px;
  --rail-width: 72px;
  --settings-top-offset: 0px;
  --font-size-xs: 12px;
  --font-size-sm: 13px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  background: var(--bg-page);
  color: var(--text-strong);
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 72px var(--col2-width) var(--col3-width) minmax(420px, 1fr);
  overflow: hidden;
}

.rail,
.nav-panel,
.list-panel,
.detail-panel {
  border-right: 1px solid var(--line);
  min-height: 0;
}

.rail {
  background: #f6f7fb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 8px;
}

.rail-top {
  display: grid;
  gap: 12px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin: 0 auto;
  background: linear-gradient(135deg, #7cc7ff, #ffd65f);
  color: #17304e;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.view-switch {
  display: grid;
  gap: 8px;
}

.rail-btn,
.rail-menu-btn,
.icon-btn,
.soft-btn,
.detail-action,
.batch-btn,
.mini-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text-normal);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.rail-btn {
  min-height: 34px;
  padding: 0 4px;
}

.rail-link-btn {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.rail-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #eff3ff;
}

.rail-tooltip {
  position: fixed;
  z-index: 240;
  max-width: 160px;
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(31, 35, 44, 0.96);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.rail-tooltip.show {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.rail-tooltip::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 10px;
  height: 10px;
  background: inherit;
  transform: translateY(-50%) rotate(45deg);
}

.rail-bottom {
  display: grid;
  gap: 8px;
}

.rail-menu-btn {
  min-height: 34px;
  padding: 0 6px;
}

.nav-panel {
  background: #f7f8fb;
  padding: 12px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
}

.stat-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 2px 7px;
  text-align: center;
  box-shadow: none;
}

.stat-card strong {
  display: block;
  font-size: 20px;
  color: var(--text-strong);
  line-height: 1.12;
}

.stat-card span {
  color: var(--text-soft);
  font-size: 11px;
}

.sync-block {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 3px 2px 6px;
  box-shadow: none;
}

#summaryText,
#syncStatusText {
  margin: 0;
  font-size: 11px;
}

#summaryText {
  color: var(--text-normal);
}

.sync-status {
  margin-top: 3px;
  color: var(--text-soft);
}

.sync-status[data-level="success"] {
  color: var(--success);
}

.sync-status[data-level="warn"] {
  color: #d97706;
}

.sync-status[data-level="error"] {
  color: var(--warn);
}

.side-block {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 4px 4px;
  box-shadow: none;
}

.side-block.fill {
  flex: 1;
  min-height: 180px;
}

.side-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.side-title-row h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: #657187;
}

.mini-btn {
  width: 22px;
  height: 22px;
  border-radius: 999px;
}

.nav-list,
.sub-list,
.tag-list {
  display: grid;
  gap: 1px;
}

.nav-item,
.sub-item,
.tag-item {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-normal);
  cursor: pointer;
  min-height: 27px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  text-align: left;
}

.nav-item:hover,
.sub-item:hover,
.tag-item:hover {
  background: #eceff4;
}

.nav-item>span:first-child,
.sub-item>span:first-child,
.tag-item>span:first-child {
  position: relative;
  padding-left: 13px;
}

.nav-item>span:first-child::before,
.sub-item>span:first-child::before,
.tag-item>span:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 999px;
  background: #c6cbd5;
}

.nav-item em,
.sub-item em,
.tag-item em {
  font-style: normal;
  color: #384050;
  background: #f0f2f6;
  border-radius: 999px;
  font-size: 11px;
  min-width: 24px;
  min-height: 18px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: right;
}

.nav-item.active,
.sub-item.active,
.tag-item.active {
  background: #e9edf3;
  border-color: transparent;
  color: #222733;
}

.nav-item.active>span:first-child::before,
.sub-item.active>span:first-child::before,
.tag-item.active>span:first-child::before {
  background: #597ce7;
}

.nav-item.active em,
.sub-item.active em,
.tag-item.active em {
  background: #f0f2f6;
}

#navBlock .side-title-row,
#tagsBlock .side-title-row,
#cardNavBlock .side-title-row,
#cardColorBlock .side-title-row {
  border-bottom: 1px solid #e3e7ef;
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.list-panel {
  background: #f7f8fb;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.list-toolbar {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #fff;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.soft-btn,
.detail-action,
.batch-btn {
  padding: 8px 10px;
}

.icon-btn {
  min-width: 38px;
  font-size: 14px;
}

.search-box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  padding: 0 10px;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  height: 34px;
}

.sort-box {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 12px;
}

.sort-box select {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text-normal);
  font-size: 13px;
  padding: 6px 8px;
}

#wereadImportBtn {
  border-color: #b5c8ff;
  background: #eef3ff;
  color: #2f4fb8;
  font-weight: 700;
  min-height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

#wereadImportBtn:hover {
  background: #e3ecff;
}

.weread-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}

.weread-modal[hidden] {
  display: none;
}

.weread-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.weread-modal-card {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  border: 1px solid #d4dceb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.24);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.weread-modal-card h3 {
  margin: 0;
  font-size: 16px;
  color: #1f2937;
}

#wereadModalImportBtn {
  min-height: 38px;
  font-size: 14px;
  font-weight: 700;
  border-color: #b5c8ff;
  background: #eef3ff;
  color: #2f4fb8;
}

#wereadModalImportBtn:hover {
  background: #e3ecff;
}

#wereadModalImportBtn.is-loading {
  cursor: wait;
  opacity: 0.85;
}

#hl-note-editor-overlay {
  all: initial;
  position: fixed;
  inset: 0;
  z-index: 180;
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hl-note-editor-panel {
  position: fixed;
  width: min(360px, calc(100vw - 24px));
  min-height: 200px;
  max-height: min(320px, calc(100vh - 24px));
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  padding: 12px;
  box-sizing: border-box;
  overflow: hidden;
}

.hl-note-editor-panel * {
  box-sizing: border-box;
}

.hl-note-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hl-note-editor-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  line-height: 1.2;
}

.hl-note-editor-close {
  all: unset;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7c8699;
  font-size: 18px;
}

.hl-note-editor-close:hover {
  background: #e2e8f0;
}

.hl-note-editor-input {
  margin-top: 10px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 120px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  padding: 10px 12px;
  outline: none;
  box-sizing: border-box;
  max-width: 100%;
}

.hl-note-editor-input::placeholder {
  color: #9ca3af;
}

.hl-note-editor-input:focus {
  border-color: #c7d2fe;
  box-shadow: inset 0 0 0 1px #c7d2fe;
}

.hl-note-editor-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.hl-note-editor-save {
  all: unset;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #818aa1;
}

.hl-note-editor-save:hover {
  background: #e2e8f0;
  color: #64748b;
}

.hl-note-editor-save svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#hl-tag-editor-overlay {
  all: initial;
  position: fixed;
  inset: 0;
  z-index: 180;
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hl-tag-editor-panel {
  position: fixed;
  width: min(420px, calc(100vw - 24px));
  min-height: 210px;
  max-height: min(380px, calc(100vh - 24px));
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  padding: 12px;
  box-sizing: border-box;
  overflow: hidden;
}

.hl-tag-editor-panel * {
  box-sizing: border-box;
}

.hl-tag-editor-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.hl-tag-editor-input {
  margin-top: 10px;
  width: 100%;
  height: 40px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0 12px;
  font-size: 15px;
  color: #334155;
  outline: none;
}

.hl-tag-editor-input:focus {
  border-color: #c7d2fe;
  box-shadow: inset 0 0 0 1px #c7d2fe;
}

.hl-tag-selected {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hl-tag-groups {
  margin-top: 10px;
  flex: 1;
  overflow: auto;
  padding-right: 2px;
}

.hl-tag-group+.hl-tag-group {
  margin-top: 10px;
}

.hl-tag-group-title {
  margin: 0 0 8px;
  font-size: 12px;
  color: #64748b;
}

.hl-tag-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hl-tag-chip {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #d7deea;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1;
}

.hl-tag-chip:hover {
  border-color: #b6c2d8;
}

.hl-tag-chip.active {
  border-color: #a5b4fc;
  background: #e0e7ff;
  color: #4338ca;
}

.hl-tag-chip.selected {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #2563eb;
  padding-left: 10px;
  padding-right: 8px;
  gap: 8px;
}

.hl-tag-chip-label {
  display: inline-flex;
  align-items: center;
}

.hl-tag-chip-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  font-size: 14px;
  color: #64748b;
  background: #e2e8f0;
}

.hl-tag-chip.selected:hover .hl-tag-chip-close {
  color: #334155;
  background: #cbd5e1;
}

.hl-tag-editor-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.hl-tag-editor-cancel,
.hl-tag-editor-save {
  all: unset;
  cursor: pointer;
  min-width: 84px;
  height: 36px;
  border-radius: 10px;
  text-align: center;
  font-size: 15px;
  line-height: 36px;
}

.hl-tag-editor-cancel {
  color: #475569;
  background: #f1f5f9;
}

.hl-tag-editor-cancel:hover {
  background: #e2e8f0;
}

.hl-tag-editor-save {
  color: #ffffff;
  background: #1e293b;
}

.hl-tag-editor-save:hover {
  background: #0f172a;
}

#hl-note-chat-overlay {
  all: initial;
  position: fixed;
  inset: 0;
  z-index: 186;
  background: rgba(12, 15, 16, 0.22);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hl-note-chat-panel {
  width: min(440px, calc(100vw - 24px));
  max-height: min(86vh, 760px);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
  border: 1px solid rgba(173, 179, 181, 0.26);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(45, 51, 53, 0.12);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
  gap: 0;
}

.hl-note-chat-panel * {
  box-sizing: border-box;
}

.hl-note-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(222, 227, 230, 0.9);
  background: rgba(255, 255, 255, 0.4);
}

.hl-note-chat-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: #2d3335;
  font-weight: 700;
  font-family: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hl-note-chat-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: #5a6062;
  line-height: 1.35;
}

.hl-note-chat-close {
  all: unset;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #5a6062;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.hl-note-chat-close:hover {
  background: rgba(235, 238, 240, 0.9);
  color: #2d3335;
}

.hl-note-chat-context {
  position: relative;
  margin: 12px 14px 0;
  border: 1px solid rgba(173, 179, 181, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 12px 10px 14px;
}

.hl-note-chat-context::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: #4a78ff;
}

.hl-note-chat-context-title {
  margin: 0;
  font-size: 12px;
  color: #5a6062;
}

.hl-note-chat-context-text {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: #2d3335;
  white-space: pre-wrap;
  word-break: break-word;
}

.hl-note-chat-context-note {
  margin: 8px 0 0;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(74, 120, 255, 0.24);
  background: rgba(74, 120, 255, 0.08);
  color: #2f57d9;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.hl-note-chat-auth-tip {
  margin: 10px 14px 0;
  border: 1px solid rgba(253, 230, 138, 0.9);
  background: rgba(255, 251, 235, 0.95);
  color: #8a4b08;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.hl-note-chat-auth-tip button {
  all: unset;
  cursor: pointer;
  border-radius: 999px;
  background: #f59e0b;
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  padding: 7px 12px;
  font-weight: 600;
}

.hl-note-chat-auth-tip button:hover {
  background: #d97706;
}

.hl-note-chat-messages {
  flex: 1 1 auto;
  min-height: 160px;
  max-height: min(44vh, 460px);
  overflow-y: auto;
  margin: 10px 14px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 2px 0 0;
}

.hl-note-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.hl-note-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.hl-note-chat-messages::-webkit-scrollbar-thumb {
  background: #dee3e6;
  border-radius: 10px;
}

.hl-note-chat-msg {
  display: flex;
  margin: 0 0 11px;
}

.hl-note-chat-msg:last-child {
  margin-bottom: 0;
}

.hl-note-chat-msg.is-user {
  justify-content: flex-end;
}

.hl-note-chat-msg.is-assistant {
  justify-content: flex-start;
}

.hl-note-chat-bubble {
  max-width: min(88%, 380px);
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
  box-shadow: 0 3px 10px rgba(45, 51, 53, 0.08);
}

.hl-note-chat-msg.is-user .hl-note-chat-bubble {
  border: 1px solid rgba(74, 120, 255, 0.2);
  background: rgba(74, 120, 255, 0.1);
  color: #2f57d9;
  border-bottom-right-radius: 5px;
}

.hl-note-chat-msg.is-assistant .hl-note-chat-bubble {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(241, 244, 245, 0.88);
  color: #2d3335;
  border-bottom-left-radius: 5px;
}

.hl-note-chat-msg.is-loading .hl-note-chat-bubble {
  opacity: 0.84;
}

.hl-note-chat-msg-body {
  white-space: pre-wrap;
}

.hl-note-chat-markdown {
  font-size: 13px;
  line-height: 1.62;
  color: #2d3335;
}

.hl-note-chat-markdown>*:first-child {
  margin-top: 0;
}

.hl-note-chat-markdown>*:last-child {
  margin-bottom: 0;
}

.hl-note-chat-markdown h1,
.hl-note-chat-markdown h2,
.hl-note-chat-markdown h3 {
  margin: 0 0 7px;
  line-height: 1.42;
  color: #2d3335;
}

.hl-note-chat-markdown h1 {
  font-size: 16px;
}

.hl-note-chat-markdown h2 {
  font-size: 15px;
}

.hl-note-chat-markdown h3 {
  font-size: 14px;
}

.hl-note-chat-markdown p {
  margin: 0;
}

.hl-note-chat-markdown p+p {
  margin-top: 7px;
}

.hl-note-chat-markdown ul,
.hl-note-chat-markdown ol {
  margin: 8px 0;
  padding-left: 1.35em;
}

.hl-note-chat-markdown li {
  margin: 3px 0;
}

.hl-note-chat-markdown code {
  background: rgba(173, 179, 181, 0.18);
  border: 1px solid rgba(173, 179, 181, 0.32);
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 0.86em;
}

.hl-note-chat-markdown pre {
  margin: 8px 0;
  padding: 10px;
  border-radius: 8px;
  background: #2d3335;
  color: #f8f9fa;
  overflow-x: auto;
}

.hl-note-chat-markdown pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

.hl-note-chat-markdown blockquote {
  margin: 8px 0;
  padding: 8px 10px;
  border-left: 3px solid rgba(74, 120, 255, 0.5);
  background: rgba(74, 120, 255, 0.09);
  border-radius: 0 8px 8px 0;
}

.hl-note-chat-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
  border: 1px solid #dee3e6;
}

.hl-note-chat-markdown th,
.hl-note-chat-markdown td {
  border: 1px solid #dee3e6;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.hl-note-chat-markdown th {
  background: #f1f4f5;
}

.hl-note-chat-markdown hr {
  border: 0;
  border-top: 1px solid #dee3e6;
  margin: 8px 0;
}

.hl-note-chat-quick-row {
  margin: 10px 14px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hl-note-chat-quick {
  all: unset;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(173, 179, 181, 0.28);
  background: rgba(201, 231, 247, 0.4);
  color: #395663;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 500;
  transition: all 0.18s ease;
}

.hl-note-chat-quick:hover {
  border-color: rgba(74, 120, 255, 0.36);
  background: rgba(201, 231, 247, 0.75);
  color: #2f57d9;
}

.hl-note-chat-quick:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hl-note-chat-composer {
  margin: 12px 14px 14px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid rgba(173, 179, 181, 0.3);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 10px;
  box-shadow: 0 2px 8px rgba(45, 51, 53, 0.06);
}

.hl-note-chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 180px;
  resize: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #2d3335;
  padding: 2px 0;
  font-size: 13px;
  line-height: 1.45;
  outline: none;
}

.hl-note-chat-input::placeholder {
  color: #adb3b5;
}

.hl-note-chat-input:focus {
  border-color: transparent;
  box-shadow: none;
}

.hl-note-chat-send {
  all: unset;
  cursor: pointer;
  min-width: 56px;
  height: 36px;
  border-radius: 999px;
  background: #1853da;
  color: #ffffff;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 36px;
  box-shadow: 0 4px 10px rgba(24, 83, 218, 0.24);
  transition: transform 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}

.hl-note-chat-send:hover {
  background: #0046c9;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(24, 83, 218, 0.28);
}

.hl-note-chat-send:disabled {
  background: #adb3b5;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.global-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  z-index: 10000;
  min-width: 220px;
  max-width: min(78vw, 760px);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #d2dae8;
  background: rgba(255, 255, 255, 0.97);
  color: #1f2937;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.global-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.global-toast[data-level="success"] {
  border-color: #b7ebc9;
  background: rgba(242, 255, 247, 0.97);
  color: #166534;
}

.global-toast[data-level="warn"] {
  border-color: #fde68a;
  background: rgba(255, 251, 235, 0.97);
  color: #92400e;
}

.global-toast[data-level="error"] {
  border-color: #fecaca;
  background: rgba(254, 242, 242, 0.97);
  color: #b91c1c;
}

.batch-bar {
  margin: 8px 12px 0;
  border: none;
  background: #eef3ff;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  box-shadow: 0 1px 3px rgba(20, 30, 55, 0.08);
}

.batch-bar span {
  font-size: 12px;
  color: #2f4ba7;
}

.batch-btn {
  margin-left: auto;
}

.batch-btn+.batch-btn {
  margin-left: 0;
}

.batch-btn.danger {
  border-color: #fecaca;
  color: var(--warn);
  background: #fff6f6;
}

.article-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.article-item {
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 11px 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: none;
  min-width: 0;
}

.article-item:hover {
  background: #edf1f7;
}

.article-item.active {
  border-color: #c8d7ff;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 1px #d9e4ff, 0 2px 6px rgba(30, 49, 92, 0.08);
}

.article-check {
  display: none;
  padding-top: 2px;
}

.article-check-input {
  width: 14px;
  height: 14px;
}

.article-list.batch-mode .article-check {
  display: block;
}

.article-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.article-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.article-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-meta {
  margin: 8px 0 4px;
  font-size: 12px;
  color: var(--text-soft);
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
}

.article-meta-date {
  white-space: nowrap;
}

.article-meta-source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-meta-count {
  text-align: right;
  white-space: nowrap;
}

.article-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-action-btn {
  border: 1px solid #d8e0ef;
  background: #fff;
  color: var(--text-main);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.article-action-btn:hover:not(:disabled) {
  background: #eef4ff;
  border-color: #bfd2ff;
  color: #1f4fbf;
}

.article-action-btn:disabled,
.article-action-btn.is-busy {
  cursor: wait;
  opacity: 0.68;
}

body[data-view-mode="card"] .article-item {
  padding: 16px;
}

.detail-panel {
  border-right: none;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.detail-header {
  padding: 14px 20px 8px;
  border-bottom: none;
  background: var(--bg-page);
}

.detail-header-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.detail-header h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.detail-title-row h2 {
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 36px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-title-rename-btn {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: #edf3ff;
  color: #1f6fff;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.detail-title-rename-btn:hover {
  background: #edf3ff;
  color: #1f6fff;
}

.detail-title-rename-btn:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.detail-title-rename-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-meta {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#detailUrl {
  margin-top: 6px;
  display: inline-block;
  font-size: 12px;
  color: #536a97;
  word-break: break-all;
  text-decoration: none;
}

#detailUrl[hidden] {
  display: none !important;
}

.detail-menu {
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 2px;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
  scrollbar-width: none;
}

.detail-menu::-webkit-scrollbar {
  display: none;
}

.detail-menu-btn {
  width: 50px;
  min-width: 50px;
  height: 62px;
  padding: 8px 4px 7px;
  border: none;
  border-radius: 9px;
  background: #f3f4f6;
  color: #6f7d99;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  line-height: 1;
}

.detail-menu-btn:hover {
  background: #edf5ff;
  color: #1677ff;
}

.detail-menu-btn.active,
.detail-menu-btn.is-active,
.detail-menu-btn[aria-pressed="true"] {
  background: #e6f1ff;
  color: #1677ff;
}

.detail-sort-mode-btn,
.detail-sort-toggle-btn,
#detailAddCustomBtn,
#detailShareBtn,
#detailQuizBtn,
#detailFlashcardsBtn,
#detailExportMenuBtn {
  background: #f3f4f6;
  color: #6f7d99;
}

.detail-sort-mode-btn:hover,
.detail-sort-toggle-btn:hover,
#detailAddCustomBtn:hover,
#detailShareBtn:hover,
#detailQuizBtn:hover,
#detailFlashcardsBtn:hover,
#detailExportMenuBtn:hover {
  background: #edf5ff;
  color: #1677ff;
}

.detail-sort-mode-btn.active,
.detail-sort-mode-btn.is-active,
.detail-sort-toggle-btn.is-active,
#detailAddCustomBtn.is-active,
#detailShareBtn.is-active,
#detailQuizBtn.is-active,
#detailFlashcardsBtn.is-active,
#detailExportMenuBtn.active,
#detailExportMenuBtn.is-active {
  background: #e6f1ff;
  color: #1677ff;
}

.detail-sort-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.detail-sort-mode-btn {
  width: 62px;
  min-width: 62px;
  flex-direction: column;
  gap: 5px;
  padding: 8px 6px 7px;
}

.detail-sort-toggle-btn {
  width: 78px;
  min-width: 78px;
  flex-direction: column;
  gap: 5px;
  padding: 8px 6px 7px;
}

.detail-sort-mode-btn span,
.detail-sort-toggle-btn span {
  white-space: nowrap;
}

.detail-sort-mode-btn .detail-sort-icon,
.detail-sort-toggle-btn .detail-sort-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.detail-sort-mode-btn .detail-sort-label-row,
.detail-sort-toggle-btn .detail-sort-label-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  max-width: 100%;
}

.detail-sort-mode-btn .detail-sort-label-row span,
.detail-sort-toggle-btn .detail-sort-label-row span {
  display: inline-block;
}

.detail-sort-mode-btn .detail-sort-up-arrow,
.detail-sort-mode-btn .detail-sort-down-arrow {
  opacity: 0.42;
  transition: opacity 0.16s ease, stroke-width 0.16s ease;
}

.detail-sort-mode-btn[data-sort-order="desc"] .detail-sort-down-arrow,
.detail-sort-mode-btn[data-sort-order="asc"] .detail-sort-up-arrow {
  opacity: 1;
  stroke-width: 2.4;
}

.detail-menu-btn.danger {
  background: #fff0f3;
  color: #e0594f;
}

.detail-sort-pop-wrap {
  position: relative;
}

.detail-sort-menu {
  min-width: 118px;
  right: auto;
  left: 0;
  top: calc(100% + 6px);
  z-index: 80;
}

.detail-menu-btn.danger:hover {
  background: #fbe9e7;
}

.detail-menu-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-menu-btn span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.12;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#detailAddCustomBtn {
  width: 62px;
  min-width: 62px;
}

#detailShareBtn {
  width: 62px;
  min-width: 62px;
}

.notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 40px;
  display: grid;
  gap: 12px;
  align-content: start;
}

#detailDeleteConfirmModal,
#detailRenameModal {
  position: fixed;
  inset: 0;
  z-index: 145;
  display: grid;
  place-items: center;
}

#detailDeleteConfirmModal[hidden],
#detailRenameModal[hidden] {
  display: none;
}

#detailDeleteConfirmModal [data-detail-delete-confirm-close="true"],
#detailRenameModal [data-detail-rename-close="true"] {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 36, 0.45);
}

.detail-delete-confirm-card,
.detail-rename-card {
  position: relative;
  z-index: 1;
  max-height: calc(100vh - 22px);
  border: 1px solid #d7dce6;
  border-radius: 14px;
  background: #f8f9fc;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.detail-delete-confirm-card {
  width: min(460px, calc(100vw - 24px));
}

.detail-rename-card {
  width: min(480px, calc(100vw - 24px));
}

#detailDeleteConfirmModal header,
#detailRenameModal header {
  border-bottom: 1px solid #dde3ee;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
}

#detailDeleteConfirmModal header h3,
#detailRenameModal header h3 {
  margin: 0;
  font-size: 16px;
  color: #20273a;
}

.detail-delete-confirm-meta {
  margin: 4px 0 0;
  color: #6f7890;
  font-size: 12px;
}

.detail-rename-meta {
  margin: 4px 0 0;
  color: #6f7890;
  font-size: 12px;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#detailDeleteConfirmCloseBtn,
#detailRenameCloseBtn {
  border: 1px solid #d0d7e4;
  border-radius: 8px;
  background: #fff;
  color: #647089;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

#detailDeleteConfirmCloseBtn:hover,
#detailRenameCloseBtn:hover {
  background: #edf1f8;
}

.detail-delete-confirm-body {
  display: grid;
  gap: 10px;
  padding: 18px 18px 10px;
}

.detail-delete-confirm-message,
.detail-delete-confirm-warning {
  margin: 0;
}

.detail-delete-confirm-message {
  color: #20273a;
  font-size: 14px;
  line-height: 1.6;
}

.detail-delete-confirm-warning {
  color: #6a7285;
  font-size: 12px;
  line-height: 1.6;
}

.detail-delete-confirm-foot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.detail-rename-body {
  display: grid;
  gap: 8px;
  padding: 18px 18px 10px;
}

.detail-rename-field {
  display: grid;
  gap: 7px;
}

.detail-rename-field span {
  color: #697288;
  font-size: 12px;
}

.detail-rename-field input {
  width: 100%;
  height: 38px;
  border: 1px solid #d4d9e3;
  border-radius: 9px;
  background: #fff;
  color: #293146;
  padding: 0 11px;
  font-size: 14px;
  outline: none;
}

.detail-rename-field input:focus {
  border-color: #9fb7ff;
  box-shadow: 0 0 0 3px rgba(89, 124, 231, 0.16);
}

.detail-rename-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-rename-status,
.detail-rename-counter {
  margin: 0;
  color: #6a7285;
  font-size: 12px;
  line-height: 1.5;
}

.detail-rename-status[data-tone="error"] {
  color: #c33a35;
}

.detail-rename-counter {
  flex: 0 0 auto;
}

.detail-rename-foot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

#detailDeleteConfirmCancelBtn,
#detailDeleteConfirmSubmitBtn,
#detailRenameCancelBtn,
#detailRenameSubmitBtn {
  border: 1px solid #d4dbe8;
  border-radius: 8px;
  background: #fff;
  color: #3d465f;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#detailDeleteConfirmCancelBtn:hover:not(:disabled),
#detailDeleteConfirmSubmitBtn:hover:not(:disabled),
#detailRenameCancelBtn:hover:not(:disabled),
#detailRenameSubmitBtn:hover:not(:disabled) {
  background: #eef3ff;
  border-color: #c2d1ff;
}

#detailRenameSubmitBtn {
  border-color: #597ce7;
  background: #597ce7;
  color: #fff;
}

#detailRenameSubmitBtn:hover:not(:disabled) {
  background: #486bd2;
  border-color: #486bd2;
}

#detailDeleteConfirmSubmitBtn {
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
}

#detailDeleteConfirmSubmitBtn:hover:not(:disabled) {
  background: #dc2626;
  border-color: #dc2626;
}

#detailDeleteConfirmCancelBtn:disabled,
#detailDeleteConfirmSubmitBtn:disabled,
#detailRenameCancelBtn:disabled,
#detailRenameSubmitBtn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

body.dark-theme .detail-rename-meta,
body.dark-theme .detail-delete-confirm-meta {
  color: #a8b5d5;
}

body.dark-theme .detail-delete-confirm-card,
body.dark-theme .detail-rename-card {
  background: #283044;
  border-color: #43506e;
}

body.dark-theme #detailDeleteConfirmModal header,
body.dark-theme #detailRenameModal header,
body.dark-theme .detail-delete-confirm-foot,
body.dark-theme .detail-rename-foot {
  background: #2f3950;
  border-color: #465474;
}

body.dark-theme #detailDeleteConfirmModal header h3,
body.dark-theme #detailRenameModal header h3 {
  color: #dbe6ff;
}

body.dark-theme #detailDeleteConfirmCloseBtn,
body.dark-theme #detailRenameCloseBtn {
  background: #313b53;
  border-color: #536080;
  color: #c0cde9;
}

body.dark-theme #detailDeleteConfirmCloseBtn:hover,
body.dark-theme #detailRenameCloseBtn:hover {
  background: #3a4763;
}

body.dark-theme .detail-rename-field span,
body.dark-theme .detail-rename-status,
body.dark-theme .detail-rename-counter {
  color: #a6b3d3;
}

body.dark-theme .detail-rename-status[data-tone="error"] {
  color: #ffaaa5;
}

body.dark-theme .detail-rename-field input {
  background: #313b52;
  border-color: #4f5d7c;
  color: #e3eaff;
}

body.dark-theme .detail-rename-field input:focus {
  border-color: #7f98e8;
  box-shadow: 0 0 0 3px rgba(127, 152, 232, 0.18);
}

body.dark-theme #detailDeleteConfirmCancelBtn,
body.dark-theme #detailDeleteConfirmSubmitBtn,
body.dark-theme #detailRenameCancelBtn,
body.dark-theme #detailRenameSubmitBtn {
  background: #313b53;
  border-color: #536080;
  color: #d9e4ff;
}

body.dark-theme #detailDeleteConfirmCancelBtn:hover:not(:disabled),
body.dark-theme #detailDeleteConfirmSubmitBtn:hover:not(:disabled),
body.dark-theme #detailRenameCancelBtn:hover:not(:disabled),
body.dark-theme #detailRenameSubmitBtn:hover:not(:disabled) {
  background: #3a4763;
  border-color: #6d7da3;
}

body.dark-theme #detailRenameSubmitBtn {
  background: #6f8df0;
  border-color: #6f8df0;
  color: #101827;
}

body.dark-theme #detailDeleteConfirmSubmitBtn {
  background: #f87171;
  border-color: #f87171;
  color: #1f1111;
}

@media (max-width: 760px) {
  .detail-delete-confirm-card,
  .detail-rename-card {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 10px);
  }
}

.note-card {
  --note-accent: #ff8f73;
  --note-content-indent: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.note-card.is-ai-note {
  border-style: dashed;
  background: #f8fbff;
}

.note-main {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  position: relative;
}

.note-accent-bar {
  width: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: var(--note-accent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.note-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding-right: 38px;
  font-size: 16px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-main-edit-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: rgba(24, 83, 218, 0.1);
  color: #1853da;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.note-main-edit-btn:hover {
  background: rgba(24, 83, 218, 0.18);
  transform: translateY(-1px);
}

.note-main-edit-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.md-content {
  white-space: normal;
  word-break: break-word;
  line-height: 1.7;
}

.md-content>*:first-child {
  margin-top: 0;
}

.md-content>*:last-child {
  margin-bottom: 0;
}

.md-content h1,
.md-content h2,
.md-content h3 {
  margin: 10px 0 8px;
  line-height: 1.45;
  font-weight: 700;
  color: #182032;
}

.md-content h1 {
  font-size: 20px;
}

.md-content h2 {
  font-size: 18px;
}

.md-content h3 {
  font-size: 16px;
}

.md-content p {
  margin: 8px 0;
  line-height: 1.72;
}

.md-content ul,
.md-content ol {
  margin: 8px 0;
  padding-left: 22px;
}

.md-content li {
  margin: 4px 0;
}

.md-content code {
  background: #eef2f7;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.md-content pre {
  margin: 10px 0;
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
}

.md-content pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: 13px;
}

.md-content blockquote {
  margin: 10px 0;
  padding: 7px 10px;
  border-left: 3px solid #93c5fd;
  background: #eff6ff;
  color: #334155;
  border-radius: 0 8px 8px 0;
}

.md-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
  background: #fff;
  border: 1px solid #dbe4ff;
  border-radius: 8px;
  overflow: hidden;
}

.md-content th,
.md-content td {
  border: 1px solid #e2e8f0;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.md-content th {
  background: #f8fafc;
  font-weight: 700;
}

.md-content hr {
  border: 0;
  border-top: 1px solid #dbe4ff;
  margin: 10px 0;
}

.md-content a {
  color: #1d4ed8;
  text-decoration: underline;
}

.md-content .hl-math-inline,
.hl-card-markdown .hl-math-inline {
  display: inline-block;
  max-width: 100%;
  vertical-align: baseline;
}

.md-content .hl-math-block,
.hl-card-markdown .hl-math-block {
  display: block;
  max-width: 100%;
  margin: 10px 0;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
}

.md-content .hl-math-katex-pending,
.md-content .hl-math-katex-error,
.hl-card-markdown .hl-math-katex-pending,
.hl-card-markdown .hl-math-katex-error {
  color: inherit;
}

.md-content .hl-math-katex-pending code,
.md-content .hl-math-katex-error,
.hl-card-markdown .hl-math-katex-pending code,
.hl-card-markdown .hl-math-katex-error {
  white-space: pre-wrap;
  word-break: break-word;
}

.md-content .katex-display,
.hl-card-markdown .katex-display {
  margin: 0.35em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.md-content .katex,
.hl-card-markdown .katex {
  max-width: 100%;
  font-size: 1em;
}

.card-text.md-content {
  display: block;
  -webkit-line-clamp: initial;
  line-clamp: initial;
  overflow: visible;
  text-overflow: initial;
}

.card-text.md-content.md-compact {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.note-note-wrap {
  margin: 10px 0 0;
  margin-left: var(--note-content-indent);
  width: calc(100% - var(--note-content-indent));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: start;
  gap: 8px;
  border-radius: 10px;
  background: #edf2ff;
  padding: 8px 10px;
}

.note-note {
  margin: 0;
  color: #2845a1;
  font-size: 14px;
  line-height: 1.55;
  min-width: 0;
}

.note-note-edit-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 9px;
  background: rgba(40, 69, 161, 0.1);
  color: #2845a1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.note-note-edit-btn:hover {
  background: rgba(40, 69, 161, 0.18);
  color: #183581;
  transform: translateY(-1px);
}

.note-note-edit-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: var(--note-content-indent);
  width: calc(100% - var(--note-content-indent));
}

.note-tags span {
  border: 1px solid #d6def4;
  border-radius: 999px;
  background: #f4f7ff;
  color: #3f4f74;
  font-size: 12px;
  padding: 2px 8px;
}

.note-footer {
  margin-top: 10px;
  margin-left: var(--note-content-indent);
  width: calc(100% - var(--note-content-indent));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.note-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
  white-space: nowrap;
  flex: 0 0 auto;
  text-align: right;
}

.note-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  margin-top: 0;
  margin-left: 0;
  width: auto;
}

.note-color-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-color-dot {
  border: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.32), 0 0 0 2px #fff inset;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.note-color-dot:hover {
  transform: scale(1.14);
}

.note-color-dot.is-active {
  box-shadow: 0 0 0 2px #6366f1, 0 0 0 2px #fff inset;
}

.note-color-dot[data-color="yellow"] {
  background: #fff3a0;
}

.note-color-dot[data-color="green"] {
  background: #b8f5cf;
}

.note-color-dot[data-color="blue"] {
  background: #b8e1ff;
}

.note-color-dot[data-color="purple"] {
  background: #e5d1ff;
}

.note-actions-sep {
  width: 1px;
  height: 16px;
  background: #e2e8f0;
  margin: 0 2px;
}

.note-action-btn {
  all: unset;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.note-action-btn:hover {
  background: #f1f5f9;
  color: #475569;
}

.note-action-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.note-action-btn.danger:hover {
  background: #ffe4e6;
  color: #e11d48;
}

.empty {
  margin: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fff;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-soft);
}

.empty h3 {
  margin: 0 0 6px;
  color: var(--text-normal);
}

.empty p {
  margin: 0;
  font-size: 13px;
}

.empty.is-error {
  border-color: #fecdd3;
  background: #fff7f7;
}

.empty.is-error h3 {
  color: #be123c;
}

.empty-action-btn {
  margin-top: 14px;
  border: 1px solid #bfd2ff;
  border-radius: 999px;
  background: #eef4ff;
  color: #1f4fbf;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  min-height: 34px;
  padding: 8px 16px;
}

.empty-action-btn:hover {
  background: #dfeaff;
  border-color: #9ebaff;
}

body.nav-collapsed .app-shell {
  grid-template-columns: 72px 0 var(--col3-width) minmax(420px, 1fr);
}

body.nav-collapsed .nav-panel {
  padding: 0;
  border: 0;
  overflow: hidden;
}

body.dark-theme {
  --bg-page: #1f2230;
  --bg-panel: #262b3b;
  --bg-card: #2c3346;
  --line: #3b4359;
  --line-strong: #505a76;
  --text-strong: #f2f4fa;
  --text-normal: #cfd5e8;
  --text-soft: #9ba6c5;
}

body.dark-theme .search-box,
body.dark-theme .curator-search-box,
body.dark-theme .curator-search-menu,
body.dark-theme .sort-box select,
body.dark-theme .rail-btn,
body.dark-theme .rail-menu-btn,
body.dark-theme .icon-btn,
body.dark-theme .soft-btn,
body.dark-theme .detail-action,
body.dark-theme .batch-btn,
body.dark-theme .mini-btn,
body.dark-theme .note-card,
body.dark-theme .detail-header-card,
body.dark-theme .sync-block,
body.dark-theme .side-block,
body.dark-theme .stat-card,
body.dark-theme .empty {
  background: var(--bg-card);
  color: var(--text-normal);
}

body.dark-theme .empty.is-error {
  border-color: #7f1d1d;
  background: rgba(127, 29, 29, 0.18);
}

body.dark-theme .empty.is-error h3 {
  color: #fca5a5;
}

body.dark-theme .stat-card,
body.dark-theme .sync-block,
body.dark-theme .side-block {
  border-color: #4d5973;
  box-shadow: none;
}

body.dark-theme .side-title-row h3 {
  color: #9ba7c7;
}

body.dark-theme .curator-search-option:hover {
  background: rgba(114, 161, 255, 0.12);
}

body.dark-theme .curator-search-option-icon {
  background: rgba(114, 161, 255, 0.16);
  color: #8fb7ff;
}

body.dark-theme .curator-search-option-title strong {
  color: #8fb7ff;
}

body.dark-theme .nav-item,
body.dark-theme .sub-item,
body.dark-theme .tag-item {
  background: transparent;
}

body.dark-theme .nav-item:hover,
body.dark-theme .sub-item:hover,
body.dark-theme .tag-item:hover {
  background: #353f57;
}

body.dark-theme .nav-item.active,
body.dark-theme .sub-item.active,
body.dark-theme .tag-item.active {
  background: #3a4765;
  border-color: #63739e;
  color: #d8e2ff;
}

body.dark-theme #navBlock .side-title-row,
body.dark-theme #tagsBlock .side-title-row,
body.dark-theme #cardNavBlock .side-title-row,
body.dark-theme #cardColorBlock .side-title-row {
  border-bottom-color: #4e5a76;
}

body.dark-theme .detail-menu {
  background: transparent;
  border-color: transparent;
}

body.dark-theme .detail-menu-btn {
  background: #34405a;
  color: #93a0c2;
}

body.dark-theme .detail-title-rename-btn {
  background: #213f68;
  color: #8ec5ff;
}

body.dark-theme .detail-menu-btn:hover {
  background: #3a4560;
  color: #b7c2df;
}

body.dark-theme .detail-title-rename-btn:hover {
  background: #213f68;
  color: #8ec5ff;
}

body.dark-theme .detail-menu-btn.active,
body.dark-theme .detail-menu-btn.is-active,
body.dark-theme .detail-menu-btn[aria-pressed="true"] {
  background: #213f68;
  color: #8ec5ff;
}

body.dark-theme .note-action-btn {
  color: #9ba6c5;
}

body.dark-theme .note-action-btn:hover {
  background: #3a445d;
  color: #d5dcf1;
}

body.dark-theme .note-actions-sep {
  background: #4a5470;
}

body.dark-theme .article-item {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.dark-theme .article-item:hover {
  background: #323a4f;
}

body.dark-theme .article-item.active {
  background: var(--bg-card);
  border-color: #5d709c;
  box-shadow: 0 0 0 1px #5d709c, 0 2px 6px rgba(13, 18, 35, 0.45);
}

body.dark-theme .article-action-btn {
  background: #2b3346;
  border-color: #445372;
  color: #e7ecfa;
}

body.dark-theme .article-action-btn:hover:not(:disabled) {
  background: #33405a;
  border-color: #6d84b5;
  color: #f7f9ff;
}

body.dark-theme .detail-rename-meta {
  color: #a8b5d5;
}

body.dark-theme .detail-rename-field span,
body.dark-theme .detail-rename-status,
body.dark-theme .detail-rename-counter {
  color: #a6b3d3;
}

body.dark-theme .detail-rename-status[data-tone="error"] {
  color: #ffaaa5;
}

body.dark-theme .detail-rename-field input {
  background: #313b52;
  border-color: #4f5d7c;
  color: #e3eaff;
}

body.dark-theme .detail-rename-field input:focus {
  border-color: #7f98e8;
  box-shadow: 0 0 0 3px rgba(127, 152, 232, 0.18);
}

.color-filter-list {
  display: grid;
  gap: 6px;
}

.color-filter-item {
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f7f8fb;
  color: var(--text-normal);
  cursor: pointer;
  min-height: 34px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  text-align: left;
}

.color-filter-item.active {
  background: #eef3ff;
  border-color: #c8d7ff;
  color: #2747ac;
}

.color-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.32);
}

.color-dot.all-colors {
  background: linear-gradient(135deg, #fff3a0 0%, #b8f5cf 33%, #b8e1ff 66%, #e5d1ff 100%);
}

#cardNavBlock,
#cardColorBlock {
  display: none;
}

#cardNavList .nav-item>span:first-child {
  position: relative;
  padding-left: 12px;
}

#cardNavList .nav-item>span:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 999px;
  background: #c7cfdd;
}

#cardNavList .nav-item.active>span:first-child::before {
  background: #3f67d8;
}

.card-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 0;
}

.card-color-chip {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: #fff;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.42);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card-color-chip:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.card-color-chip.active {
  box-shadow: 0 0 0 2px #6366f1;
}

.card-color-chip.all {
  background: linear-gradient(135deg, #fff3a0 0%, #b8f5cf 33%, #b8e1ff 66%, #e5d1ff 100%);
}

.card-color-chip[data-color-filter="yellow"] {
  background: #fff3a0;
}

.card-color-chip[data-color-filter="green"] {
  background: #b8f5cf;
}

.card-color-chip[data-color-filter="blue"] {
  background: #b8e1ff;
}

.card-color-chip[data-color-filter="purple"] {
  background: #e5d1ff;
}

.card-toolbar {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  display: none;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.card-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.column-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text-normal);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.column-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #eff3ff;
}

.cards-grid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: none;
  gap: 12px;
  align-content: start;
}

.cards-grid[data-columns="1"] {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.cards-grid[data-columns="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cards-grid[data-columns="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-grid[data-columns="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cards-grid[data-columns="5"] {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cards-grid[data-columns="6"] {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.card-item {
  --card-accent: #ff8f73;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(20, 30, 55, 0.08);
  width: 100%;
  margin: 0;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.card-time {
  font-size: 12px;
  color: var(--text-soft);
  flex-shrink: 0;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-action-btn {
  all: unset;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.card-action-btn[hidden] {
  display: none;
}

.card-action-btn:hover {
  background: #f1f5f9;
  color: #475569;
}

.card-action-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.card-content {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.card-accent-bar {
  width: 4px;
  flex: 0 0 4px;
  border-radius: 999px;
  background: var(--card-accent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.card-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  display: block;
  overflow: visible;
  text-overflow: initial;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tags span {
  border: 1px solid #d6def4;
  border-radius: 999px;
  background: #f4f7ff;
  color: #3f4f74;
  font-size: 11px;
  padding: 2px 8px;
}

.card-note {
  margin: 0;
  border-radius: 8px;
  background: #edf2ff;
  color: #2845a1;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.5;
  display: none;
}

.card-note:not(:empty) {
  display: block;
}

.tile-toolbar {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
}

.tile-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.tile-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tile-search-box {
  width: min(420px, 44vw);
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  padding: 0 10px;
}

.tile-search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  height: 34px;
}

.tile-sort-box {
  margin-left: 0;
}

.tile-sort-box select {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text-normal);
  font-size: 13px;
  padding: 6px 8px;
}

.tile-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: none;
  flex-direction: column;
  background: #f7f8fb;
}

.tile-canvas {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 20px 30px;
  display: grid;
  gap: 16px;
  align-content: start;
  background: #ececec;
}

.tile-page-card {
  border: 1px solid #e3e7ee;
  border-radius: 12px;
  background: #fff;
  padding: 15px 18px 16px;
  box-shadow: 0 1px 2px rgba(20, 30, 55, 0.04);
}

.tile-group-list {
  margin-top: 12px;
  display: grid;
  gap: 15px;
}

.tile-page-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.42;
  word-break: break-word;
}

.tile-page-meta {
  margin: 7px 0 0;
  font-size: 11px;
  color: var(--text-soft);
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
}

.tile-page-meta>span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-page-meta>span:last-child {
  text-align: right;
}

.tile-page-url {
  margin-top: 4px;
  display: inline-block;
  font-size: 10px;
  color: #536a97;
  text-decoration: none;
  word-break: break-all;
}

.tile-highlight-item {
  --tile-accent: #ff8f73;
  position: relative;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0 0 0 24px;
  box-shadow: none;
}

.tile-highlight-main {
  display: block;
  min-width: 0;
}

.tile-highlight-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 0;
  background: var(--tile-accent);
}

.tile-highlight-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.66;
  white-space: pre-wrap;
  word-break: break-word;
}

.tile-highlight-note {
  margin: 9px 0 0;
  border-radius: 20px;
  background: #d7ddec;
  color: #2845a1;
  padding: 12px 16px;
  font-size: 16px;
  line-height: 1.58;
  display: none;
}

.tile-highlight-note:not(:empty) {
  display: block;
}

.tile-highlight-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tile-highlight-tags:empty {
  display: none;
}

.tile-highlight-tags span {
  border: 1px solid #d7d7d7;
  border-radius: 999px;
  background: #f2f2f2;
  color: #303646;
  font-size: 13px;
  padding: 4px 12px;
}

.tile-highlight-source {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.45;
  color: #536a97;
  text-decoration: none;
  word-break: break-all;
}

.tile-highlight-source:hover {
  text-decoration: underline;
}

body[data-view-mode="card"] .list-toolbar {
  display: none;
}

body[data-view-mode="card"] .card-toolbar {
  display: flex;
}

body[data-view-mode="card"] .article-list {
  display: none;
}

body[data-view-mode="card"] .cards-grid {
  display: grid;
}

body[data-view-mode="card"] .detail-panel {
  display: none;
}

body[data-view-mode="card"] .app-shell {
  grid-template-columns: 72px var(--col2-width) 1fr 0;
}

body[data-view-mode="card"].nav-collapsed .app-shell {
  grid-template-columns: 72px 0 1fr 0;
}

body[data-view-mode="card"] #syncBlock {
  display: none;
}

body[data-view-mode="card"] #navBlock {
  display: none;
}

body[data-view-mode="card"] #cardNavBlock {
  display: block;
}

body[data-view-mode="card"] #cardColorBlock {
  display: block;
}

body[data-view-mode="card"] #tagsBlock {
  display: block;
}

body[data-view-mode="tile"] .list-toolbar,
body[data-view-mode="tile"] .card-toolbar,
body[data-view-mode="tile"] .article-list,
body[data-view-mode="tile"] .cards-grid,
body[data-view-mode="tile"] .batch-bar {
  display: none;
}

body[data-view-mode="tile"] .tile-toolbar {
  display: flex;
}

body[data-view-mode="tile"] .tile-container {
  display: flex;
}

body[data-view-mode="tile"] .detail-panel {
  display: none;
}

body[data-view-mode="tile"] .app-shell {
  grid-template-columns: 72px var(--col2-width) 1fr 0;
}

body[data-view-mode="tile"].nav-collapsed .app-shell {
  grid-template-columns: 72px 0 1fr 0;
}

body.dark-theme .card-toolbar,
body.dark-theme .card-item {
  background: var(--bg-card);
  color: var(--text-normal);
}

body.dark-theme .card-color-chip {
  border-color: #ffffff;
}

body.dark-theme .card-color-chip.active {
  box-shadow: 0 0 0 2px #6366f1;
}

body.dark-theme .card-action-btn {
  color: #9ba6c5;
}

body.dark-theme .card-action-btn:hover {
  background: #3a445d;
  color: #d5dcf1;
}

body.dark-theme .column-btn {
  background: var(--bg-card);
  color: var(--text-normal);
}

body.dark-theme .column-btn.active {
  background: #475570;
  color: #d5dcf1;
}

body.dark-theme #wereadImportBtn {
  border-color: #5f74a8;
  background: #3a4869;
  color: #d7e2ff;
}

body.dark-theme #wereadImportBtn:hover {
  background: #44567a;
}

body.dark-theme .weread-modal-card {
  border-color: #4c5872;
  background: #2c3346;
}

body.dark-theme .weread-modal-card h3 {
  color: #dbe4fc;
}

body.dark-theme #wereadModalImportBtn {
  border-color: #5f74a8;
  background: #3a4869;
  color: #d7e2ff;
}

body.dark-theme #wereadModalImportBtn:hover {
  background: #44567a;
}

body.dark-theme .global-toast {
  border-color: #4c5872;
  background: rgba(44, 51, 70, 0.96);
  color: #e5ebfb;
}

body.dark-theme .global-toast[data-level="success"] {
  border-color: #2f6f4f;
  background: rgba(24, 53, 39, 0.96);
  color: #bef7d2;
}

body.dark-theme .global-toast[data-level="warn"] {
  border-color: #7a6528;
  background: rgba(72, 55, 22, 0.96);
  color: #ffe4a3;
}

body.dark-theme .global-toast[data-level="error"] {
  border-color: #7a3232;
  background: rgba(72, 24, 24, 0.96);
  color: #ffc2c2;
}

body.dark-theme .tile-toolbar,
body.dark-theme .tile-search-box,
body.dark-theme .tile-sort-box select,
body.dark-theme .tile-page-card,
body.dark-theme .tile-highlight-item {
  background: var(--bg-card);
  color: var(--text-normal);
}

body.dark-theme .tile-page-card {
  border-color: #4b566f;
  box-shadow: none;
}

body.dark-theme .tile-highlight-note {
  background: #3d4760;
  color: #d8e5ff;
}

body.dark-theme .tile-highlight-tags span {
  border-color: #5f6b88;
  background: #313a50;
  color: #d3dcf4;
}

body.dark-theme .tile-page-url {
  color: #9eb7ff;
}

body.dark-theme .tile-highlight-source {
  color: #9eb7ff;
}

body.dark-theme .md-content h1,
body.dark-theme .md-content h2,
body.dark-theme .md-content h3 {
  color: #ecf2ff;
}

body.dark-theme .md-content code {
  background: #2f3a54;
  border-color: #445174;
  color: #d8e5ff;
}

body.dark-theme .md-content pre {
  background: #0b1223;
  color: #e2e8f0;
}

body.dark-theme .md-content blockquote {
  background: #2b3856;
  border-left-color: #7092df;
  color: #d8e5ff;
}

body.dark-theme .md-content table {
  background: #212a40;
  border-color: #42506f;
}

body.dark-theme .md-content th,
body.dark-theme .md-content td {
  border-color: #42506f;
}

body.dark-theme .md-content th {
  background: #2a3652;
}

body.dark-theme .md-content hr {
  border-top-color: #42506f;
}

body.dark-theme .md-content a {
  color: #9eb7ff;
}

body.dark-theme .md-content .hl-math-katex-pending code,
body.dark-theme .md-content .hl-math-katex-error {
  background: #2f3a54;
  border-color: #445174;
  color: #d8e5ff;
}

@media (max-width: 1440px) {
.app-shell {
    grid-template-columns: 72px var(--col2-width-md) var(--col3-width-md) minmax(360px, 1fr);
  }

  body.nav-collapsed .app-shell {
    grid-template-columns: 72px 0 var(--col3-width-md) minmax(360px, 1fr);
  }

  body[data-view-mode="card"] .app-shell {
    grid-template-columns: 72px var(--col2-width-md) 1fr 0;
  }

  body[data-view-mode="card"].nav-collapsed .app-shell {
    grid-template-columns: 72px 0 1fr 0;
  }

  body[data-view-mode="tile"] .app-shell {
    grid-template-columns: 72px var(--col2-width-md) 1fr 0;
  }

  body[data-view-mode="tile"].nav-collapsed .app-shell {
    grid-template-columns: 72px 0 1fr 0;
  }
}

@media (max-width: 1180px) {
:root {
    --rail-width: 64px;
  }


.app-shell {
    grid-template-columns: 64px 1fr;
    grid-template-rows: 1fr 1fr 1fr;
  }

  .rail {
    grid-row: 1 / span 3;
  }

  .nav-panel,
  .list-panel,
  .detail-panel {
    grid-column: 2;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .nav-panel {
    grid-row: 1;
    max-height: 35vh;
  }

  .list-panel {
    grid-row: 2;
    max-height: 30vh;
  }

  .detail-panel {
    grid-row: 3;
  }

  body.nav-collapsed .nav-panel {
    display: none;
  }
}

.action-feedback-bubble {
  position: fixed;
  z-index: 220;
  min-width: 64px;
  max-width: min(72vw, 360px);
  min-height: 28px;
  line-height: 1.45;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: rgba(239, 246, 255, 0.98);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  white-space: normal;
  overflow-wrap: anywhere;
  transform: translate(-50%, 8px);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.action-feedback-bubble.is-error {
  border-color: #fecaca;
  background: rgba(254, 242, 242, 0.98);
  color: #b91c1c;
}

.action-feedback-bubble.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 文字卡片预览 */
#hl-card-preview-overlay {
  all: initial;
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hl-card-scroll {
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  border-radius: 12px;
}

.hl-card {
  width: 420px;
  background: var(--hl-card-bg, #f5f0ea);
  color: var(--hl-card-text, #3d3428);
  padding: var(--hl-card-pad-top, 48px) var(--hl-card-pad-x, 40px) var(--hl-card-pad-bottom, 36px);
  box-sizing: border-box;
  text-align: center;
  position: relative;
  font-family: var(--hl-card-font-family, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.hl-card[data-template="classic"] {
  text-align: left;
  padding: 30px 34px 28px;
  border: 1px solid rgba(62, 45, 27, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.hl-card[data-template="ink"] {
  text-align: left;
  padding: 22px 34px 20px;
  box-shadow: none;
}

.hl-card-ink-bars,
.hl-card-ink-head {
  display: none;
}

.hl-card-ink-bars span {
  display: block;
  width: 100%;
}

.hl-card-ink-bars span:first-child {
  height: 8px;
  background: var(--hl-card-ink-accent, #2f2418);
}

.hl-card-ink-bars span:last-child {
  margin-top: 5px;
  height: 4px;
  background: var(--hl-card-ink-accent, #2f2418);
  opacity: 0.62;
}

.hl-card-ink-head {
  margin: 24px 0 20px;
  min-height: 270px;
  display: none;
  justify-content: space-between;
  align-items: flex-start;
}

.hl-card-ink-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.hl-card-ink-title-col {
  margin: 0;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 1px;
  color: var(--hl-card-ink-meta, #6f6358);
  font-size: 24px;
  line-height: 1.08;
  font-weight: 600;
  white-space: pre-wrap;
}

.hl-card-ink-title-col.is-main {
  color: var(--hl-card-ink-accent, #2f2418);
  font-size: 28px;
  font-weight: 700;
}

.hl-card-ink-meta {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.hl-card-ink-meta-col {
  margin: 0;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 1px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--hl-card-ink-meta, #6f6358);
  padding: 0 9px;
  border-left: 1px solid var(--hl-card-divider, #b7aea4);
  border-right: 1px solid var(--hl-card-divider, #b7aea4);
}

.hl-card.is-dark-bg[data-template="classic"] {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.hl-card-classic-head {
  display: none;
}

.hl-card-classic-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(187, 174, 154, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hl-card-classic-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hl-card-classic-avatar-fallback {
  font-size: 20px;
  font-weight: 700;
  color: var(--hl-card-text, #3d3428);
  line-height: 1;
}

.hl-card-classic-user-name {
  margin: 14px 0 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--hl-card-text, #3d3428);
}

.hl-card-classic-date {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--hl-card-sub-text, #7c7164);
}

.hl-card-date-day {
  font-size: var(--hl-card-day-size, 72px);
  font-weight: 800;
  color: var(--hl-card-text, #3d3428);
  line-height: 1;
  margin: 0;
  letter-spacing: -2px;
}

.hl-card-date-month {
  font-size: var(--hl-card-month-size, 18px);
  font-weight: 700;
  color: var(--hl-card-text, #3d3428);
  letter-spacing: var(--hl-card-month-tracking, 3px);
  margin: 6px 0 2px;
}

.hl-card-date-weekday {
  font-size: var(--hl-card-weekday-size, 13px);
  color: var(--hl-card-sub-text, #7c7164);
  margin: 0;
}

.hl-card-divider {
  width: var(--hl-card-divider-width, 32px);
  height: 2px;
  background: var(--hl-card-divider, #c9bfb2);
  margin: var(--hl-card-divider-gap-top, 20px) auto var(--hl-card-divider-gap-bottom, 24px);
  border: none;
}

.hl-card-text-wrap {
  margin: 0 0 28px;
}

.hl-card-markdown {
  font-size: var(--hl-card-body-size, 20px);
  line-height: var(--hl-card-body-line-height, 1.8);
  color: var(--hl-card-text, #3d3428);
  text-align: left;
  word-break: break-word;
}

.hl-card-markdown>*:first-child {
  margin-top: 0;
}

.hl-card-markdown>*:last-child {
  margin-bottom: 0;
}

.hl-card-markdown h1,
.hl-card-markdown h2,
.hl-card-markdown h3 {
  margin: 0 0 10px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--hl-card-text, #3d3428);
}

.hl-card-markdown h1 {
  font-size: calc(var(--hl-card-body-size, 20px) * 1.24);
}

.hl-card-markdown h2 {
  font-size: calc(var(--hl-card-body-size, 20px) * 1.14);
}

.hl-card-markdown h3 {
  font-size: calc(var(--hl-card-body-size, 20px) * 1.04);
}

.hl-card-markdown p {
  margin: 0;
  line-height: inherit;
}

.hl-card-markdown p+p {
  margin-top: var(--hl-card-body-gap, 16px);
}

.hl-card-markdown ul,
.hl-card-markdown ol {
  margin: 10px 0;
  padding-left: 1.4em;
}

.hl-card-markdown li {
  margin: 6px 0;
}

.hl-card-markdown code {
  background: rgba(125, 114, 98, 0.16);
  border: 1px solid rgba(125, 114, 98, 0.3);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.84em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.hl-card-markdown pre {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(28, 31, 39, 0.88);
  color: #f3f4f6;
  overflow-x: auto;
}

.hl-card-markdown pre code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
  font-size: 0.82em;
}

.hl-card-markdown blockquote {
  margin: 10px 0;
  padding: 8px 10px;
  border-left: 3px solid var(--hl-card-note-border, rgba(125, 114, 98, 0.38));
  background: var(--hl-card-note-bg, rgba(125, 114, 98, 0.08));
  color: var(--hl-card-text, #3d3428);
  border-radius: 0 8px 8px 0;
}

.hl-card-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.8em;
  border: 1px solid rgba(125, 114, 98, 0.28);
  background: rgba(255, 255, 255, 0.24);
}

.hl-card-markdown th,
.hl-card-markdown td {
  border: 1px solid rgba(125, 114, 98, 0.24);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.hl-card-markdown th {
  font-weight: 700;
  background: rgba(125, 114, 98, 0.1);
}

.hl-card-markdown hr {
  border: 0;
  border-top: 1px solid var(--hl-card-divider, #c9bfb2);
  margin: 10px 0;
}

.hl-card-markdown a {
  color: inherit;
  text-decoration: underline;
}

.hl-card-text {
  font-size: var(--hl-card-body-size, 20px);
  line-height: var(--hl-card-body-line-height, 1.8);
  color: var(--hl-card-text, #3d3428);
  text-align: left;
  margin: 0;
  word-break: break-word;
  white-space: pre-wrap;
}

.hl-card-text+.hl-card-text {
  margin-top: var(--hl-card-body-gap, 16px);
}

.hl-card-note-block {
  margin: 0 0 20px;
  padding: 12px 12px 12px 14px;
  border-left: 3px solid var(--hl-card-note-border, rgba(125, 114, 98, 0.38));
  background: var(--hl-card-note-bg, rgba(125, 114, 98, 0.08));
  text-align: left;
}

.hl-card-note-text {
  margin: 0;
  font-size: var(--hl-card-body-size, 20px);
  line-height: var(--hl-card-body-line-height, 1.8);
  font-weight: var(--hl-card-note-weight, 400);
  color: var(--hl-card-note-text, #7c7164);
  text-align: left;
  word-break: break-word;
  white-space: pre-wrap;
}

.hl-card-note-text+.hl-card-note-text {
  margin-top: var(--hl-card-body-gap, 16px);
}

.hl-card-source-title {
  font-size: var(--hl-card-source-title-size, 14px);
  color: var(--hl-card-sub-text, #7c7164);
  margin: 0 0 4px;
}

.hl-card-source-site {
  display: none;
  font-size: var(--hl-card-source-site-size, 12px);
  color: var(--hl-card-muted-text, #a49a8e);
  margin: 0;
}

.hl-card-bottom-divider {
  display: none;
  border: 0;
  border-top: 1px solid rgba(125, 114, 98, 0.25);
  margin: 30px 0 20px;
}

.hl-card-bottom-meta {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hl-card-bottom-meta .hl-card-qr-wrap {
  order: 1;
}

.hl-card-bottom-meta .hl-card-brand-wrap {
  order: 2;
}

.hl-card-qr-wrap {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hl-card-qr-canvas {
  width: var(--hl-card-qr-size, 92px);
  height: var(--hl-card-qr-size, 92px);
  display: block;
  image-rendering: pixelated;
}

.hl-card-qr-caption {
  margin: 0;
  font-size: 12px;
  color: var(--hl-card-qr-caption-color, #a49a8e);
}

.hl-card-brand-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hl-card-brand-name {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  color: var(--hl-card-brand-name-color, #8f846f);
}

.hl-card-brand-slogan {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  color: var(--hl-card-brand-slogan-color, #8f846f);
}

.hl-card[data-template="classic"] .hl-card-classic-head,
.hl-card.hl-card-template-classic .hl-card-classic-head {
  display: block;
  margin-bottom: 44px;
}

.hl-card[data-template="ink"] .hl-card-ink-bars,
.hl-card.hl-card-template-ink .hl-card-ink-bars {
  display: block;
}

.hl-card[data-template="ink"] .hl-card-ink-head,
.hl-card.hl-card-template-ink .hl-card-ink-head {
  display: flex;
}

.hl-card[data-template="ink"] .hl-card-classic-head,
.hl-card[data-template="ink"] .hl-card-date-day,
.hl-card[data-template="ink"] .hl-card-date-month,
.hl-card[data-template="ink"] .hl-card-date-weekday,
.hl-card[data-template="ink"] .hl-card-divider,
.hl-card[data-template="ink"] .hl-card-source-title,
.hl-card.hl-card-template-ink .hl-card-classic-head,
.hl-card.hl-card-template-ink .hl-card-date-day,
.hl-card.hl-card-template-ink .hl-card-date-month,
.hl-card.hl-card-template-ink .hl-card-date-weekday,
.hl-card.hl-card-template-ink .hl-card-divider,
.hl-card.hl-card-template-ink .hl-card-source-title {
  display: none;
}

.hl-card[data-template="ink"] .hl-card-note-block,
.hl-card.hl-card-template-ink .hl-card-note-block {
  margin: 0 0 16px;
}

.hl-card[data-template="ink"] .hl-card-text-wrap,
.hl-card.hl-card-template-ink .hl-card-text-wrap {
  margin: 0;
}

.hl-card[data-template="ink"] .hl-card-bottom-divider,
.hl-card.hl-card-template-ink .hl-card-bottom-divider {
  display: block;
  margin: 24px 0 18px;
}

.hl-card[data-template="ink"] .hl-card-bottom-meta,
.hl-card.hl-card-template-ink .hl-card-bottom-meta {
  margin-top: 0;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.hl-card[data-template="ink"] .hl-card-brand-wrap,
.hl-card.hl-card-template-ink .hl-card-brand-wrap {
  align-items: flex-start;
  gap: 6px;
  margin-top: 29px;
}

.hl-card[data-template="ink"] .hl-card-brand-name,
.hl-card.hl-card-template-ink .hl-card-brand-name {
  font-size: 16px;
}

.hl-card[data-template="ink"] .hl-card-brand-slogan,
.hl-card.hl-card-template-ink .hl-card-brand-slogan {
  font-size: 12px;
}

.hl-card[data-template="ink"] .hl-card-qr-wrap,
.hl-card.hl-card-template-ink .hl-card-qr-wrap {
  gap: 8px;
}

.hl-card[data-template="ink"] .hl-card-qr-canvas,
.hl-card.hl-card-template-ink .hl-card-qr-canvas {
  width: 94px;
  height: 94px;
}

.hl-card[data-template="ink"] .hl-card-qr-caption,
.hl-card.hl-card-template-ink .hl-card-qr-caption {
  display: block;
  text-align: center;
}

.hl-card[data-template="ink"] .hl-card-ink-bars-bottom,
.hl-card.hl-card-template-ink .hl-card-ink-bars-bottom {
  margin-top: 24px;
}

.hl-card[data-template="classic"] .hl-card-date-day,
.hl-card[data-template="classic"] .hl-card-date-month,
.hl-card[data-template="classic"] .hl-card-date-weekday,
.hl-card[data-template="classic"] .hl-card-divider,
.hl-card.hl-card-template-classic .hl-card-date-day,
.hl-card.hl-card-template-classic .hl-card-date-month,
.hl-card.hl-card-template-classic .hl-card-date-weekday,
.hl-card.hl-card-template-classic .hl-card-divider {
  display: none;
}

.hl-card[data-template="classic"] .hl-card-text-wrap,
.hl-card.hl-card-template-classic .hl-card-text-wrap {
  margin: 0 0 22px;
}

.hl-card[data-template="classic"] .hl-card-text,
.hl-card.hl-card-template-classic .hl-card-text {
  font-size: 21px;
  line-height: 1.72;
  font-weight: 600;
}

.hl-card[data-template="classic"] .hl-card-note-block,
.hl-card.hl-card-template-classic .hl-card-note-block {
  margin: 0 0 24px;
}

.hl-card[data-template="classic"] .hl-card-source-title,
.hl-card.hl-card-template-classic .hl-card-source-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
}

.hl-card[data-template="classic"] .hl-card-source-site,
.hl-card.hl-card-template-classic .hl-card-source-site {
  font-size: 15px;
}

.hl-card[data-template="classic"] .hl-card-bottom-divider,
.hl-card.hl-card-template-classic .hl-card-bottom-divider {
  display: block;
}

.hl-card[data-template="classic"] .hl-card-bottom-meta,
.hl-card.hl-card-template-classic .hl-card-bottom-meta {
  margin-top: 0;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.hl-card[data-template="classic"] .hl-card-brand-wrap,
.hl-card.hl-card-template-classic .hl-card-brand-wrap {
  order: 1;
  align-items: flex-start;
  gap: 6px;
  margin-top: 36px;
}

.hl-card[data-template="classic"] .hl-card-brand-name,
.hl-card.hl-card-template-classic .hl-card-brand-name {
  font-size: 15px;
}

.hl-card[data-template="classic"] .hl-card-brand-slogan,
.hl-card.hl-card-template-classic .hl-card-brand-slogan {
  font-size: 12px;
}

.hl-card[data-template="classic"] .hl-card-qr-wrap,
.hl-card.hl-card-template-classic .hl-card-qr-wrap {
  order: 2;
  gap: 8px;
}

.hl-card[data-template="classic"] .hl-card-qr-canvas,
.hl-card.hl-card-template-classic .hl-card-qr-canvas {
  width: 104px;
  height: 104px;
}

.hl-card[data-template="classic"] .hl-card-qr-caption,
.hl-card.hl-card-template-classic .hl-card-qr-caption {
  display: block;
  text-align: center;
}

.hl-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #cbd5e1;
  border: 1px solid #94a3b8;
}

.hl-card-tool-btn {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 12px;
  color: #334155;
  font-size: 11px;
  transition: background 0.15s, color 0.15s;
}

.hl-card-tool-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.hl-card-tool-btn.is-active {
  background: #e2e8f0;
  color: #0f172a;
}

.hl-card-tool-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hl-card-settings-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(410px, calc(100vw - 12px));
  max-height: min(72vh, 560px);
  padding: 12px 18px 0;
  box-sizing: border-box;
  border-radius: 24px 24px 0 0;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  border-bottom: none;
  box-shadow: 0 -20px 44px rgba(15, 23, 42, 0.28);
  overflow-y: auto;
  overflow-x: hidden;
  transform: translate(-50%, 102%);
  transition: transform 0.24s ease;
}

.hl-card-settings-sheet.is-open {
  transform: translate(-50%, 0);
}

.hl-card-settings-handle {
  width: 62px;
  height: 6px;
  border-radius: 999px;
  margin: 0 auto 16px;
  background: #c0c6d0;
}

.hl-card-settings-group {
  margin-bottom: 18px;
}

.hl-card-settings-title {
  margin: 0 0 12px;
  color: #4b5563;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
}

.hl-card-settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}

.hl-card-settings-row::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.hl-card-settings-row.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.hl-card-choice-btn {
  all: unset;
  cursor: pointer;
  flex: 0 0 auto;
  user-select: none;
  box-sizing: border-box;
  min-width: 118px;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid #d4d8df;
  background: #f3f4f6;
  color: #111827;
  text-align: center;
  line-height: 44px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.hl-card-choice-btn:hover {
  background: #f8fafc;
}

.hl-card-choice-btn.is-active {
  border-color: #1d8fff;
  box-shadow: 0 0 0 1px rgba(29, 143, 255, 0.45);
  background: #ffffff;
}

.hl-card-settings-colors {
  gap: 12px;
}

.hl-card-bg-btn {
  all: unset;
  cursor: pointer;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.hl-card-bg-btn:hover {
  transform: scale(1.08);
}

.hl-card-bg-btn.is-picker {
  background: conic-gradient(#ff5d5d, #ffcb57, #52d67b, #34b6ff, #7a6dff, #d86deb, #ff5d5d);
  border: 2px solid #ffffff;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.85),
    0 0 0 1px rgba(148, 163, 184, 0.5);
}

.hl-card-bg-btn.is-active {
  box-shadow:
    0 0 0 2px #2196f3,
    0 0 0 3px rgba(33, 150, 243, 0.35);
}

#hl-card-bg-picker {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.hl-card-settings-confirm {
  all: unset;
  cursor: pointer;
  user-select: none;
  display: block;
  width: 100%;
  margin-left: 0;
  margin-top: 4px;
  border-top: 1px solid #d1d5db;
  text-align: center;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  padding: 18px 10px;
}

.hl-card-settings-confirm:hover {
  background: rgba(255, 255, 255, 0.35);
}

@media (max-width: 760px) {
.article-title-row {
    align-items: flex-start;
  }

  .hl-card {
    width: calc(100vw - 24px);
    max-width: 420px;
  }

  .hl-card-toolbar {
    gap: 8px;
    padding: 8px 10px;
  }

  .hl-card-tool-btn {
    padding: 6px 12px;
  }

  .hl-card-settings-title {
    font-size: 15px;
  }

  .hl-card-choice-btn {
    min-width: 102px;
    height: 42px;
    line-height: 42px;
    font-size: 15px;
  }

  .hl-card-settings-confirm {
    font-size: 17px;
  }
}

/* ===== Digital Curator Theme (light) ===== */
body:not(.dark-theme) {
  --bg-page: #f8f9fa;
  --bg-panel: #f2f4f8;
  --bg-card: #ffffff;
  --line: rgba(45, 51, 53, 0.14);
  --line-strong: rgba(45, 51, 53, 0.2);
  --text-strong: #2d3335;
  --text-normal: #495360;
  --text-soft: #7a8695;
  --accent: #1853da;
  --warn: #cf3341;
  --success: #1f8a52;
}

body {
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
}

body:not(.dark-theme) {
  background:
    radial-gradient(1200px 680px at 88% -20%, rgba(24, 83, 218, 0.08), transparent 62%),
    linear-gradient(180deg, #fbfcfd 0%, #f8f9fa 100%);
}

body:not(.dark-theme) .app-shell {
  background: transparent;
}

body:not(.dark-theme) .rail,
body:not(.dark-theme) .nav-panel,
body:not(.dark-theme) .list-panel,
body:not(.dark-theme) .detail-panel {
  border-right: none;
  box-shadow: inset -1px 0 0 rgba(45, 51, 53, 0.08);
}

body:not(.dark-theme) .rail {
  background: rgba(245, 247, 250, 0.88);
  backdrop-filter: blur(12px);
  padding: 12px 8px;
}

body:not(.dark-theme) .logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(140deg, #1853da 0%, #4f83f4 58%, #87aef7 100%);
  color: #ffffff;
  font-family: "Manrope", "Inter", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 10px 24px rgba(24, 83, 218, 0.22);
}

body:not(.dark-theme) .view-switch {
  gap: 9px;
}

body:not(.dark-theme) .rail-btn,
body:not(.dark-theme) .rail-menu-btn,
body:not(.dark-theme) .icon-btn,
body:not(.dark-theme) .soft-btn,
body:not(.dark-theme) .detail-action,
body:not(.dark-theme) .batch-btn,
body:not(.dark-theme) .mini-btn,
body:not(.dark-theme) .column-btn {
  border: 1px solid rgba(45, 51, 53, 0.15);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-normal);
  border-radius: 12px;
  box-shadow: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease;
}

body:not(.dark-theme) .rail-btn:hover,
body:not(.dark-theme) .rail-menu-btn:hover,
body:not(.dark-theme) .icon-btn:hover,
body:not(.dark-theme) .soft-btn:hover,
body:not(.dark-theme) .detail-action:hover,
body:not(.dark-theme) .batch-btn:hover,
body:not(.dark-theme) .mini-btn:hover,
body:not(.dark-theme) .column-btn:hover {
  background: #ffffff;
  border-color: rgba(24, 83, 218, 0.26);
  color: #20499f;
  transform: translateY(-1px);
}

body:not(.dark-theme) .rail-btn.active,
body:not(.dark-theme) .column-btn.active {
  border-color: rgba(24, 83, 218, 0.36);
  background: linear-gradient(160deg, #edf3ff 0%, #e4edff 100%);
  color: #1847a7;
}

body:not(.dark-theme) .nav-panel {
  background: var(--bg-panel);
  padding: 14px 10px 12px;
  gap: 10px;
}

body:not(.dark-theme) .stats-grid {
  gap: 8px;
}

body:not(.dark-theme) .stat-card {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 24px rgba(45, 51, 53, 0.04);
  padding: 10px 4px 9px;
}

body:not(.dark-theme) .side-block {
  border-radius: 16px;
  /* background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(45, 51, 53, 0.045); */
  padding: 10px;
}

body:not(.dark-theme) .side-title-row {
  margin-bottom: 8px;
}

body:not(.dark-theme) #navBlock .side-title-row,
body:not(.dark-theme) #tagsBlock .side-title-row,
body:not(.dark-theme) #cardNavBlock .side-title-row,
body:not(.dark-theme) #cardColorBlock .side-title-row {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 8px;
}

body:not(.dark-theme) .side-title-row h3 {
  color: #5b6778;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

body:not(.dark-theme) .nav-list,
body:not(.dark-theme) .sub-list,
body:not(.dark-theme) .tag-list {
  gap: 4px;
}

body:not(.dark-theme) .nav-item,
body:not(.dark-theme) .sub-item,
body:not(.dark-theme) .tag-item {
  border-radius: 10px;
  min-height: 30px;
  padding: 0 8px;
}

body:not(.dark-theme) .nav-item:hover,
body:not(.dark-theme) .sub-item:hover,
body:not(.dark-theme) .tag-item:hover {
  background: #eff2f7;
}

body:not(.dark-theme) .nav-item.active,
body:not(.dark-theme) .sub-item.active,
body:not(.dark-theme) .tag-item.active {
  background: #e8eefb;
  color: #20499f;
}

body:not(.dark-theme) .nav-item em,
body:not(.dark-theme) .sub-item em,
body:not(.dark-theme) .tag-item em {
  background: rgba(24, 83, 218, 0.08);
  color: #3054aa;
}

body:not(.dark-theme) .list-panel {
  background: var(--bg-panel);
}

body:not(.dark-theme) .list-toolbar,
body:not(.dark-theme) .card-toolbar,
body:not(.dark-theme) .tile-toolbar {
  margin: 12px 12px 0;
  border: none;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(45, 51, 53, 0.05);
  backdrop-filter: blur(8px);
  padding: 11px 12px;
}

body:not(.dark-theme) .search-box,
body:not(.dark-theme) .tile-search-box,
body:not(.dark-theme) .sort-box select,
body:not(.dark-theme) .tile-sort-box select {
  border-color: rgba(45, 51, 53, 0.14);
  border-radius: 12px;
  background: #ffffff;
}

body:not(.dark-theme) .search-box:focus-within,
body:not(.dark-theme) .tile-search-box:focus-within {
  border-color: rgba(24, 83, 218, 0.32);
  box-shadow: 0 0 0 3px rgba(24, 83, 218, 0.08);
}

body:not(.dark-theme) .article-list {
  padding: 12px;
  gap: 10px;
}

body:not(.dark-theme) .article-item {
  border: none;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px 10px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

body:not(.dark-theme) .article-item:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(45, 51, 53, 0.06);
}

body:not(.dark-theme) .article-item.active {
  border: none;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(24, 83, 218, 0.12);
}

body:not(.dark-theme) .article-title,
body:not(.dark-theme) .detail-header h2 {
  font-family: "Manrope", "Inter", "PingFang SC", sans-serif;
  letter-spacing: -0.1px;
}

body:not(.dark-theme) .article-title {
  font-size: 17px;
}

body:not(.dark-theme) .detail-panel {
  background: var(--bg-page);
}

body:not(.dark-theme) .detail-header {
  padding: 14px 18px 10px;
  background: transparent;
}

body:not(.dark-theme) .detail-header-card {
  border: none;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(45, 51, 53, 0.08);
  padding: 14px;
}

body:not(.dark-theme) .detail-menu {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 0 2px;
  gap: 8px;
}

body:not(.dark-theme) .detail-menu-btn {
  border-radius: 9px;
}

body:not(.dark-theme) .detail-menu-btn:hover {
  background: #e8edf7;
  color: #415371;
}

body:not(.dark-theme) .detail-title-rename-btn:hover {
  background: #edf3ff;
  color: #1f6fff;
}

body:not(.dark-theme) .detail-menu-btn.active,
body:not(.dark-theme) .detail-menu-btn.is-active,
body:not(.dark-theme) .detail-menu-btn[aria-pressed="true"] {
  background: #e6f1ff;
  color: #1677ff;
}

body:not(.dark-theme) .notes-list {
  padding: 10px 18px 34px;
  gap: 14px;
}

body:not(.dark-theme) .note-card,
body:not(.dark-theme) .card-item,
body:not(.dark-theme) .tile-page-card {
  border: none;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(45, 51, 53, 0.07);
}

body:not(.dark-theme) .note-card {
  padding: 14px;
}

body:not(.dark-theme) .note-card.is-ai-note {
  border-style: solid;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
}

body:not(.dark-theme) .note-accent-bar,
body:not(.dark-theme) .card-accent-bar,
body:not(.dark-theme) .tile-highlight-accent {
  box-shadow: none;
}

body:not(.dark-theme) .note-note,
body:not(.dark-theme) .card-note,
body:not(.dark-theme) .tile-highlight-note {
  background: #eef4ff;
  color: #264892;
  border-radius: 12px;
}

body:not(.dark-theme) .note-tags span,
body:not(.dark-theme) .card-tags span,
body:not(.dark-theme) .tile-highlight-tags span {
  border: none;
  background: #eef2f7;
  color: #435063;
}

body:not(.dark-theme) .note-action-btn,
body:not(.dark-theme) .card-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #7f8ca4;
}

body:not(.dark-theme) .note-action-btn:hover,
body:not(.dark-theme) .card-action-btn:hover {
  background: #edf2f8;
  color: #4a5870;
}

body:not(.dark-theme) .note-color-dot.is-active {
  box-shadow: 0 0 0 2px #1853da, 0 0 0 2px #fff inset;
}

body:not(.dark-theme) .cards-grid {
  padding: 14px;
  gap: 14px;
  background: var(--bg-panel);
}

body:not(.dark-theme) .tile-container {
  background: var(--bg-panel);
}

body:not(.dark-theme) .tile-canvas {
  background:
    radial-gradient(920px 480px at 102% -20%, rgba(24, 83, 218, 0.06), transparent 68%),
    #f1f4f8;
}

body:not(.dark-theme) .tile-highlight-item {
  border-radius: 12px;
  padding: 10px 12px 10px 24px;
  background: rgba(255, 255, 255, 0.78);
}

body:not(.dark-theme) .empty {
  border: none;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(45, 51, 53, 0.06);
}

body:not(.dark-theme) .global-toast {
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 32px rgba(45, 51, 53, 0.16);
}

/* ===== Highcode Layout Override ===== */
body {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body:not(.dark-theme) {
  --rail-width: 84px;
  --col2-width: 248px;
  --col3-width: 360px;
  --col2-width-md: 220px;
  --col3-width-md: 320px;
}

.curator-topbar {
  height: 64px;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px 0 20px;
  border-bottom: 1px solid rgba(45, 51, 53, 0.1);
}

body:not(.dark-theme) .curator-topbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.curator-top-left,
.curator-top-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.curator-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.curator-brand-name {
  font-family: "Manrope", "Inter", "PingFang SC", sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #1853da;
  line-height: 1;
}

.curator-brand-sep {
  width: 1px;
  height: 18px;
  background: rgba(45, 51, 53, 0.18);
}

.curator-brand-slogan {
  margin: 0;
  font-size: 12px;
  color: #6f7d8e;
  white-space: nowrap;
}

.curator-search-wrap {
  position: relative;
  width: min(560px, 44vw);
  min-width: 260px;
}

.curator-search-box {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid rgba(45, 51, 53, 0.12);
  background: rgba(245, 247, 250, 0.95);
  padding: 0 12px;
}

.curator-search-icon {
  width: 18px;
  height: 18px;
  color: #7a8699;
  flex: 0 0 auto;
}

.curator-search-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.curator-search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  height: 38px;
  font-size: 14px;
}

.curator-search-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 80;
  padding: 8px;
  border: 1px solid rgba(45, 51, 53, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 45px rgba(24, 39, 75, 0.14);
  backdrop-filter: blur(14px);
}

.curator-search-option {
  width: 100%;
  border: none;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text-normal);
  text-align: left;
  cursor: pointer;
}

.curator-search-option:hover {
  background: rgba(24, 83, 218, 0.08);
}

.curator-search-option-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(24, 83, 218, 0.1);
  color: #1853da;
  font-size: 12px;
  font-weight: 800;
}

.curator-search-option-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.curator-search-option-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
}

.curator-search-option-title strong {
  color: #1853da;
  font-weight: 800;
}

.curator-search-option-desc {
  font-size: 12px;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.curator-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(24, 83, 218, 0.08);
  color: #34508d;
  white-space: nowrap;
}

.curator-user-name {
  font-size: 12px;
  font-weight: 600;
}

.curator-user-plan {
  border-radius: 999px;
  background: #eceff3;
  color: #596270;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
}

.curator-user-plan[data-account-state="paid_active"] {
  background: #f7d76d;
  color: #5a3b00;
}

.app-shell {
  flex: 1;
  height: auto;
}

body:not(.dark-theme) .app-shell {
  grid-template-columns: var(--rail-width) var(--col2-width) var(--col3-width) minmax(480px, 1fr);
}

body:not(.dark-theme).nav-collapsed .app-shell {
  grid-template-columns: var(--rail-width) 0 var(--col3-width) minmax(480px, 1fr);
}

body:not(.dark-theme)[data-view-mode="card"] .app-shell,
body:not(.dark-theme)[data-view-mode="tile"] .app-shell {
  grid-template-columns: var(--rail-width) var(--col2-width) 1fr 0;
}

body:not(.dark-theme)[data-view-mode="card"].nav-collapsed .app-shell,
body:not(.dark-theme)[data-view-mode="tile"].nav-collapsed .app-shell {
  grid-template-columns: var(--rail-width) 0 1fr 0;
}

body:not(.dark-theme) .rail {
  padding: 12px 10px;
}

body:not(.dark-theme) .view-switch {
  gap: 10px;
}

body:not(.dark-theme) .rail-btn {
  width: 48px;
  min-height: 48px;
  padding: 0;
  margin: 0 auto;
  border-radius: 14px;
  font-size: 0;
  display: grid;
  place-items: center;
}

body:not(.dark-theme) .rail-btn::before {
  font-size: 19px;
  line-height: 1;
}

body:not(.dark-theme) .rail-btn[data-view-mode="article"]::before {
  content: "▤";
}

body:not(.dark-theme) .rail-btn[data-view-mode="card"]::before {
  content: "◫";
}

body:not(.dark-theme) .rail-btn[data-view-mode="tile"]::before {
  content: "☷";
}

body:not(.dark-theme) .rail-btn[data-rail-action="ai"]::before {
  content: "AI";
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

body:not(.dark-theme) .rail-menu-btn {
  border-radius: 10px;
  min-height: 32px;
  font-size: 11px;
}

body:not(.dark-theme) .nav-panel {
  padding: 12px;
}

body:not(.dark-theme) .list-panel,
body:not(.dark-theme) .detail-panel {
  padding-top: 0;
}

body:not(.dark-theme) .list-toolbar,
body:not(.dark-theme) .card-toolbar,
body:not(.dark-theme) .tile-toolbar {
  margin: 10px 10px 0;
}

body:not(.dark-theme) .list-toolbar .toolbar-row:first-child {
  min-height: 36px;
}

body:not(.dark-theme) .list-toolbar .toolbar-row:last-child {
  justify-content: flex-start;
  flex-wrap: wrap;
}

body:not(.dark-theme) #wereadImportBtn {
  background: linear-gradient(135deg, #eaf1ff 0%, #dce8ff 100%);
  border-color: rgba(24, 83, 218, 0.28);
}

body:not(.dark-theme) .article-list {
  padding: 10px;
}

body:not(.dark-theme) .article-item {
  border-radius: 16px;
  padding: 12px;
}

body:not(.dark-theme) .article-item.active {
  box-shadow:
    0 0 0 1px rgba(24, 83, 218, 0.12),
    0 14px 26px rgba(24, 83, 218, 0.08);
}

body:not(.dark-theme) .detail-header {
  padding: 10px 14px 8px;
}

body:not(.dark-theme) .detail-header-card {
  border-radius: 20px;
  padding: 15px 16px;
}

body:not(.dark-theme) .notes-list {
  padding: 10px 14px 30px;
}

body:not(.dark-theme) .note-card,
body:not(.dark-theme) .card-item,
body:not(.dark-theme) .tile-page-card {
  border-radius: 20px;
}

@media (max-width: 1480px) {
.curator-search-wrap {
    width: min(460px, 40vw);
  }

  body:not(.dark-theme) .app-shell {
    grid-template-columns: var(--rail-width) var(--col2-width-md) var(--col3-width-md) minmax(380px, 1fr);
  }

  body:not(.dark-theme).nav-collapsed .app-shell {
    grid-template-columns: var(--rail-width) 0 var(--col3-width-md) minmax(380px, 1fr);
  }
}

@media (max-width: 1180px) {
.curator-topbar {
    padding: 0 10px 0 12px;
    gap: 10px;
  }

  .curator-brand-slogan,
  .curator-user-pill {
    display: none;
  }

  .curator-search-wrap {
    min-width: 0;
    width: min(460px, 100%);
  }

  .curator-search-menu {
    max-height: min(320px, calc(100vh - 90px));
    overflow: auto;
  }
}

